LIMIT
SELECT with a LIMIT clause
In this exercise we'll query the products table and return just the first 12 rows.
SELECT product_id,product_name,unit_priceFROM productsLIMIT 12;Run in terminal
This query should return 12 rows.
SELECT with LIMIT and OFFSET clauses
In this exercise we'll query the products table and skip the first 4 rows before selecting the next 12.
SELECT product_id,product_name,unit_priceFROM productsLIMIT 12OFFSET 4;Run in terminal
This query should return 12 rows.
SELECT with LIMIT and ORDER BY clauses
In this exercise we'll query the products table, order the results in a descending order by product_id and limit the rows returned to 12.
SELECT product_id,product_name,unit_priceFROM productsORDER BY product_id DESCLIMIT 12;Run in terminal
This query should return 12 rows.