CRUD Flashcards

Create, Read, Update and Delete Commands

1
Q

Inserts a new record in the “Customers” table with name as “Darren McBride” and age as 29

A

INSERT INTO Customers (name, age)

VALUES (“Darren McBride”, 29)

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

Updates the first customer (CustomerID = 1) with a new contact person and a new city

A

UPDATE Customers
SET ContactName = ‘Alfred Sharpe’, City=’Frankfurt’
WHERE CustomerID = 1

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

Update the contactname to “Juan” for all records where country is “Mexico”

A

UPDATE Customers
SET ContactName = “Juan”
WHERE Country = “Mexico”

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

Delete the customer “Alfreds Futterkiste” from the “Customers” table

A

DELETE FROM Customers

WHERE CustomerName = “Alfreds Futterkiste”

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

Delete all rows in the “Customers” table, without deleting the table

A

DELETE FROM Customers

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