SQL Flashcards

1
Q

ALL

A

*

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

ANY or no characters

A

%

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

Exactly one character

A

_ (underscore)

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

Select every record from the table

A

SELECT * FROM table

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

Select every record from the table with the name attribute “Bob”

A

SELECT name(comma) surname FROM table WHERE name = “Bob”

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

Select every record from the table with the name attribute starting with “B”

A

SELECT * FROM table WHERE name LIKE “B%”

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

Deletes the table

A

DROP TABLE table

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

Delete the records with the name attribute “Bob”

A

DELETE FROM table WHERE name = “Bob”

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

Selects distinct records

A

SELECT DISTINCT

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

Insert a record into a table

A

INSERT INTO Customers (Name (comma) Surname) VALUES (“Bob” (comma) “Smith”)

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

Select ProductID from Orders table and Address from Customers table where shipped is false

A

SELECT Orders.ProductID (comma) Customers.Address FROM Orders JOIN Customers ON Orders.CustomerID = Customers.CustomerID Where Shipped = “False”

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

Update the name of Bob to John in the Customers Table

A

UPDATE Customers SET Name = “John” Where Name = “Bob”

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