CJCoding With Joseph
15free / daySign inCreate account

Create textbooks with id INTEGER PRIMARY KEY, title TEXT NOT NULL, price REAL NOT NULL and pages INTEGER (optional). REAL is the SQLite type for numbers with a decimal part, which is what a price like 89.99 needs; a textbook with a title but no price must be refused.

Expected result

Table textbooks
✓ id INTEGER PRIMARY KEY
✓ title TEXT NOT NULL
✓ price REAL NOT NULL
✓ pages INTEGER
✓ A textbook priced 89.99: accepted
✓ A textbook with no price: rejected (NOT NULL)
Hints3 available
Topics
CREATE TABLE
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (sel, ins, desc)

Results

Run your SQL to see every statement's output here, then how it compares with the expected answer.

Not sure what is in a table? SHOW TABLES lists them and DESCRIBE students shows the columns, or open the database browser under the question.