课程: Level Up: SQL

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Print a menu

Print a menu

(video game sounds) - When customers come to visit our restaurant they want to see what we can serve them. In our database, we have a list of the dishes we serve, but in order to print menus we need to retrieve that information. Using SQL, let's create a few different menus. Here's the challenge. First, output all the dishes from the dishes table, sorted by price, lowest to highest. Then output two customized menus, one for an appetizer hour with just appetizers and beverages and one with all the items except beverages. Those two should be sorted by type of dish. Pause the video here and come up with your solution. Then, I'll show you how I solve this challenge. (upbeat music) To solve this challenge, I used the select keyword. To output a menu of all the dishes sorted by price, I wrote select type, name, price, description, from dishes, order by price. We could also have used select star to see all the columns but I…

内容