Sikau

Databases and SQL · Day 5 · about 30 min

Project: Menu report

Filtering, grouping and sorting together.

The owner's questions

The café owner wants a one-glance report on the menu. Write a single query that answers it.

Present the report

Column names are part of the report. Owners read veg_dishes and avg_price far more easily than count and avg, so alias every computed column. Round money to whole rupees or two decimals, and sort by whatever the owner will scan first, often the number of dishes or the average price.

Finally, save the query in the project with a comment explaining what it answers. Next month someone will want the same report, and a well-named, commented query can be rerun in seconds.

The rest of this lesson

  • Break the report into columnsexplain
  • FILTER: conditional countingexplain
  • Check the numbersexplain
  • Complete the reportfill
  • Which part answers which question?match
  • The reportchallenge
  • Badge quizquiz
  • Unit 1 complete!recap

Continue this lesson free — run real code in your browser

Continue with Google

See all 17 lessons of Databases and SQL