Essential Question: How can I change information for a record in a SQL database?
Mastery Objectives:
SWBAT change data for a record in a SQL table.
Directions: Enter the following queries into the SQL Editor:
https://www.w3schools.com/sql/trysql.asp?filename=trysql_update_3
then take a screen shot of your findings and put them into a google doc. Describe what is happening for each query. This is the format for updating data:
UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;
Be careful when updating records. If you omit the WHERE clause, ALL records will be updated!
UPDATE Customers SET ContactName='Juan' WHERE Country='USA';
UPDATE Customers SET CustomerName = 'Helix' WHERE CustomerName = Null;
UPDATE Customers SET ContactName = 'Alfred Schmidt', City= 'Frankfurt' WHERE CustomerID = 1;
UPDATE Customers SET ContactName = 'Ms. Moylan', City = 'Walpole' WHERE CustomerID = 65;
Change one of the records to say your name or a name that you make up.
UPDATE Customers SET CustomerName = 'McDonalds', ContactName = 'Ronald McDonald', Address = '500 Adams St.', City = 'Boston', PostalCode = '02124', Country = 'USA' WHERE CustomerID = 93;
Change one of the records to say your name translated into another language, for example 'Peter' to 'Pyotr' or 'Pedro' or a name close to your name, for example 'Jessica' to 'Jesse' or 'Tommy' to 'Thomas'