External Exam Download Resources Web Applications Games Recycle Bin

Count, Alias

countalias1.sql

SELECT COUNT(*)
FROM menu
WHERE category = 'burger'

countalias2.sql

SELECT COUNT(*) AS 'Number of burgers to choose from'
FROM menu
WHERE category = 'burger'

countalias3.sql

SELECT category, title AS "Food item"
FROM menu
ORDER BY 2 DESC

/* you can refer to columns by number.
this will sort by column 2 descending. */
  1. Count the number of items that are 19.95 in price
  2. Give the query you just wrote a suitable column alias