-- All Data
SELECT * FROM table_name;
-- Specific Column
SELECT column1, column2 FROM table_name;
-- Limit Rows
-- Get first five rows
SELECT * FROM table_name LIMIT 5;
-- Condition: Exact Match
SELECT * FROM table_name WHERE column1='value1';
-- Condition: Substring
SELECT * FROM table_name WHERE column1 LIKE '%value%';
Update Statement:
-- Update a row where id column data is 5
Update table_name SET column1='val1', column2='val2' WHERE id=5;
-- Update all rows with same value
-- WHERE clause is omitted
Update table_name SET column1='val1';
Delete Statement:
-- Delete a row where id column data is 5
DELETE FROM table_name WHERE id=5;
-- Delete all records
-- WHERE clause is omitted
DELETE FROM table_name;