SQL Cheatsheet

Hero image
Rocktim Saikia/1 min read

SQL Cheatsheet

1. See all column names in a table

DESCRIBE table_name;

2. Order by

SELECT * FROM table_name ORDER BY column_name DESC;

3. Null check

SELECT * FROM table_name WHERE column_name IS NULL;

4. Check how many rows in a table

SELECT COUNT(*) FROM table_name;

5. Specify the number of rows to return

SELECT * FROM table_name LIMIT 10;