Search
Close this search box.
Search
Close this search box.

Useful Queries

How to update data in a table

UPDATE table_name 
SET field1 = new-value1, field2 = new-value2
[WHERE Clause]

How to delete all data in a table

DELETE * FROM `table_name`;

How to duplicate a table

CREATE TABLE new_table_name 
SELECT * 
FROM old_table_name

How to copy columns from one table into another table

INSERT INTO staff( firstName, lastName, address )
SELECT firstName, lastName, address
FROM staff_original