1.3.2d SQL Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

How do you insert data into a table using SQL?

A
INSERT INTO  (field1, field2, field3 , ...)
VALUES ("value1", "value2", "value3", ...)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you delete records from a database using SQL?

A
DELETE FROM (tablename)
WHERE (fieldname) = ("condition")
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you update records from a database using SQL?

A

UPDATE (tablename)
SET (headingY = “value”)
WHERE (headingX = “condition”)

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

How would you select all records that begin with an A?

A

SELECT (fieldname1, fieldname2, …)
FROM (tablename)
WHERE (fieldname) LIKE A%

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

How would you join 2 tables together?

A

Use a common fieldname in both tables:
JOIN (fieldname)
ON (1tablename.field = 2tablename.field)
WHERE (tablename.field = “value”)

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

How would you delete a table from SQL?

A

DROP TABLE (tablename)

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