This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE table_name | |
SET column1 = value1, | |
column2 = value2, ... | |
WHERE condition; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELETE FROM employees | |
WHERE EXISTS | |
( SELECT * | |
FROM contacts | |
WHERE contacts.contact_id = employees.employee_id | |
AND contacts.contact_id < 100 ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELETE TOP (3) FROM Customers WHERE last_name = ‘Johnson’; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELETE FROM Customers; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELETE FROM employees | |
WHERE last_name = ‘Johnson' AND employee_id >= 80; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELETE FROM Customers WHERE CustomerName='Alfreds Futterkiste'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE Customers | |
SET ContactName = 'Alfred Schmidt', City= 'Frankfurt' | |
WHERE CustomerID = 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO contacts (contact_id, last_name, first_name) | |
SELECT employee_id, last_name, first_name | |
FROM employees | |
WHERE employee_id <= 100; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO Employees (employee_id, last_name, first_name) | |
VALUES | |
(10, ‘Bozkurt’,’Bartu’), | |
(11, ‘Anderson,’Sarah’); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO Customers (CustomerName, City, Country) | |
VALUES ('Cardinal', 'Stavanger', 'Norway'); |