Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Databases

John Windmueller
John Windmueller
5,727 Points

Missing table information...

So it appears there might be missing information in this challenge. I've tried using the Date function everywhere in this code, but it never seems to give the "Date Shipped", which it shouldn't, since there is no column for that. However, it seems as though you have to get the "Date Shipped" information from somewhere to complete the challenge. I'm truly stumped.

Challenge Task 1 of 1

In an ecommerce database there's an orders table with the columns id, product_id, user_id, address_id, ordered_on, status and cost. Count the total number of orders that have the status of shipped today. Alias it to shipped_today. Type in your command below.

Well it would be better if you post the challange... Thats why there is a "Get Help" button at every challange/video ;)

3 Answers

ALBERT QERIMI
ALBERT QERIMI
49,872 Points

SELECT COUNT(*) AS shipped_today FROM orders WHERE status = "shipped"

Ryan Carroll
Ryan Carroll
32,144 Points

Hey Albert, I think you're missing the "AND ordered_on = DATE("now")" at the end of your query.

Steven Parker
Steven Parker
229,644 Points

I found that one confusing also. On reflection, I realized that anything that was ordered today and had a status of shipped must have been shipped today, and constructing a query for that seemed to appease the challenge.

But I still thought things ordered on other days might not have been shipped until today, and THOSE are not accounted for. I think there's room for improvement in the way the challenge is stated.

:point_right: So select items that were ordered today and have been shipped.

(or you can copy from Albert if you don't want to figure it out for yourself) :disappointed:

Clare A
Clare A
23,994 Points

Agree with both John and Steven. Unless I'm also missing something, "ordered_on" shouldn't be assumed to be the date the order was shipped - however making that assumption lets you complete the challenge :-(