Selection and Sorting in Order
This Tutorial's Database: spicy.db
spicy.db
Table Name: hotpeppers; Showing only first 3 peppers
name
maxSHU
inventory
Jalapeno
8000
12
Serrano
5000
7
Habanero
350000
8
There are 23 named hot peppers in the dataset
name
-> TEXT column of hot pepper namesmaxSHU
-> INTEGER column of each pepper's maximum level of Scoville Heat Unit rangeinventory
-> INTEGER column of random counts of how many peppers are available
Sorting by Inventory from most to least number of items
Query
Output
We can add an ORDER BY
statement to sort based on column. We can also add ASC
for least to greatest or DESC
for the opposite.
An ORDER BY
statement should be written after a WHERE
clause
Exercise
List the names of peppers in alphabetical order with a query
List all the pepper data ordered from least to most spicy
Last updated