课程: Hands-On SQL Challenges: Test Your Knowledge
免费学习该课程!
今天就开通帐号,24,700 门业界名师课程任您挑!
Solution: Print a menu
- [Instructor] To solve this challenge, I used the select keyword. The challenge asked for four specific fields, so I'll use those here in my select clause. These are Type, Name, Description, and Price. All of these fields come from the dishes table, so I'm using From Dishes Here to make that happen. The challenge asked for this information about dishes whose price was $6 or less, so to filter the results on that criteria, I wrote where price is less than or equal to six, and then we were asked to sort the output, not by one field, but by two. So in my order by clause, I have the first field we're sorting by which is type, and then a comma, and then name. This means that if there are records that come back with the same type, then the name field will be used to sort these. By using logic inequality operators in our query, we can narrow down the results that we get by specifying a condition and that lets us target the information we need. So I'll run this and there we go. It looks like…
内容
-
-
-
Solution: Create invitations for a party49 秒
-
(已锁定)
Solution: Create a table to store information1 分钟 31 秒
-
(已锁定)
Solution: Print a menu59 秒
-
(已锁定)
Solution: Sign a customer up for your loyalty program1 分钟 51 秒
-
(已锁定)
Solution: Update a customer's personal information1 分钟 56 秒
-
(已锁定)
Solution: Remove information from the database3 分钟 9 秒
-
(已锁定)
Solution: Log customer responses to an invitation1 分钟 31 秒
-
(已锁定)
Solution: Look up reservations1 分钟 10 秒
-
(已锁定)
Solution: Take a reservation1 分钟 15 秒
-
(已锁定)
Solution: Take a delivery order2 分钟 35 秒
-
(已锁定)
Solution: Track your customer's favorite dishes1 分钟 14 秒
-
(已锁定)
Solution: Prepare a report of your top customers1 分钟 9 秒
-
-
-