Hands-on task
SQLite: CHECK constraint on a column
Create a table products(id INTEGER PRIMARY KEY, name TEXT, price INTEGER) in the database /root/store.db with a CHECK constraint that forbids a non-positive price: price must be strictly greater than 0. The schema must accept a correct insert (price > 0) and reject a "bad" one (price 0 or negative).
- check
- constraints
- create table
- data validation
- sqlite3