SQL Flashcards

1
Q

Insert a row into a table

A

INSERT INTO tablename (field1, field2) VALUES (“value1”, “value2”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Delete a row from a table

A

DELETE FROM tablename WHERE field=”field”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Group results by a field

A

SELECT * FROM tablename GROUP BY field

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Update a row where id=1

A

UPDATE tablename SET field=”field” WHERE id=1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Order by a field

A

SELECT * FROM tablename ORDER BY field

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Join tables together

A

SELECT * FROM table1 LEFT JOIN table2 ON table1.field1=table2.field2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly