Lesson 5
ESSENTIAL UPDATE
OVERVIEW
In this lesson, you will learn how to make any changes or updates the
data in your tables available in your database. We cannot avoid to make
any changes in our table, for you not to create again a database and table
at the same time, Update command is being utilized to minimize your time
in updating your database without any hassle.
LEARNING OUTCOMES
Demonstrate the Update statement syntax in a table
Determine the importance of Set keyword
Determine the importance of Where Clause
Discuss the safe mode
Apply the basic commands to update the data in the database.
Just download this file SQL DATABASE FILE FILE http://www.mediafire.com/file/sbjl3tt...
Note: Double-click the dbSocialMedia to reload the database and it will
display the tblUsers.
Press control T (tab) to create another window to compare the last
command we used.
It is a keyword used to indicate what columns is to be updated and what
value should it use to update the data with.
It is a keyword used to update certain rows in the table
Example if you want to update the age you change it into 12, be careful
make sure that mode is on, so that all age will not be changed into 12.
Sammy Sarmiento verified his Account and his UID is 6 and changed his
first name to Samuel.
UPDATE SET VERIFIED = TRUE, FIRSTNAME= ”SAMUEL” WHERE
UID = 6;
Activity
A. Create the SQL code for the following problems
Use below table for the first set of problems
1. Display all records of IT and CS students who got a gwa of 1.75 and above (meaning
1.5, 1.25, 1.00)
2. Display all records of BBF students who got a gwa of 1.75 and CS students who got
a gwa of 1.00
3. Display all records IT students who got a gwa within the range of 1.00 to 1.75. Display
also all records of BBF students.
4. Display all student names which begins with ‘Y’
5. Yoko Hama has GWA of 2.00 her UID is 4 and changed his first name to Yoka.
Just try to do all examples available in this lesson.