SQL Flashcards

(7 cards)

1
Q

How to select all fields from a table.

A

SELECT * FROM table_name

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

how to use conditions in SQL

A

WHERE condition = true/false OR/AND condition = true/false

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

How to use the “LIKE” condition?

A

WHERE -field- LIKE “A%” OR -field- LIKE “B%”

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

How to enter data into a database using SQL?

A

INSERT INTO <table name> (field1, field2, field3….)

VALUES (“string”, “string”, integer)

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

how to delete data from a database?

A

DELETE FROM <table name> WHERE <field> = <condition></condition></field>

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

how do you change values in SQL?

A

UPDATE <table name>

SET <field> = <value></value></field>

WHERE <field> = <condition></condition></field>

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

how do we combine two tables in SQL?

A

SELECT table1.field, table2.field

FROM table1

JOIN table2 <——- JOIN

ON table1.field = table2.field

WHERE condition = true/false

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