- Retrieve all data from the table: SELECT * FROM table_name;
- Retrieve data from specific columns: SELECT col1, col2 FROM table_name;
- Retrieve data that meets the criteria: SELECT * FROM table_name WHERE condition;
- Aggregate calculations on data: Calculate the sum of col1 and the average of col2 from the table named table_name, grouped by col3.
- Sort the data: SELECT * FROM table_name ORDER BY col1 DESC;
- Performing pagination on data: Retrieve 10 rows starting from the 20th row in the table.
- Perform a join query on the data: SELECT * FROM table1 JOIN table2 ON table1.id = table2.id;
- Remove duplicate data: SELECT DISTINCT col1, col2 FROM table_name;
- Performing conditional evaluation on data: SELECT col1, CASE WHEN col2 > 100 THEN ‘A’ ELSE ‘B’ END FROM table_name;
- Performing a time window query on data: retrieve all data from the table where the timestamp falls between the start and end times.
✖