Hands-on task
This task is step 6 of the course “SQL with SQLite”
SQLite: update rows by condition (UPDATE)
The database /root/shop.db has a table products(id, name, price). For products with a price of 1000 and above, lower the price by 100 (that is, decrease their price by 100). The prices of the other products must not be touched.
The changes must be saved in the database itself (this is an UPDATE, not a selection into a file).
Reference:sqlite3
What you'll practise:
- sqlite3
- update
- where
- data modification
- set