Concepts in Focus
- Update Rows
- SQL – Case Insensitive
Database The database consists of a
player
table that stores the details of players who are a part of a tournament.player
table stores the name, age and score of players.Update Rows
UPDATE
clause is used to update the data of an existing table in database. We can update all the rows or only specific rows as per the requirement.Update All Rows
Syntax
SQL
Example:
Update the
score
of all players to 100 in theplayer
table.SQL
Update Specific Rows
Syntax
SQL
Example
Update the
score
of "Ram" to 150 in theplayer
table.SQL
Try it Yourself!
The database contains a
student
table that stores the information of name, percentage and scholarship amount of students.- Update thescholarship_amountof all students to 15000 in thestudenttable.
- Update thescholarship_amountof "Raju" to 25000 in thestudenttable.
SQLite is Case Insensitive!
- Query 1
SQL
- Query 2
SQL
Note
Best Practice: Both Query 1 and Query 2 gives the same output. But, it is recommended to write keywords in upper case to make the query more readable. Prefer Query 1 format over Query 2.