cmcculloh web design
cmcculloh.com - Personal - Tutorials - SQL Lectures - 2.14.06: Relational Databases - Updating Records

Updating Records

Michael Xue
Christopher McCulloh
2.14.06

Valid XHTML 1.0 Strict

So we use the "update" command with a "where" clause:

Now let's see what happens if we don't use a where clause, and let's see what happens when you try to set something to an invalide date.

So first the invalid date:

That caused it to give a warning, and then set his birthday to 0000-00-00

Now let's get rid of the where clause and see what happens. It changes everyone's birthday to 0000-00-00.

Oracle won't let you insert incorrect things at all. MySQL will just warn you and then insert a default value.

Now, update the rows and set the birthdate back to a valid date. Use a where clause.