SQL Flashcards
1
Q
Insert a row into a table
A
INSERT INTO tablename (field1, field2) VALUES (“value1”, “value2”)
2
Q
Delete a row from a table
A
DELETE FROM tablename WHERE field=”field”
3
Q
Group results by a field
A
SELECT * FROM tablename GROUP BY field
4
Q
Update a row where id=1
A
UPDATE tablename SET field=”field” WHERE id=1
5
Q
Order by a field
A
SELECT * FROM tablename ORDER BY field
6
Q
Join tables together
A
SELECT * FROM table1 LEFT JOIN table2 ON table1.field1=table2.field2