← Back to CREATE TABLE
Question 86
Your First Table
Your First Table
Create a table calledbuildingswith two columns:id, anINTEGER PRIMARY KEY, andname, aTEXTcolumn that isNOT NULL. A row with no name must be refused, and a row that supplies only a name must be accepted (the key fills itself in).
Expected result:
Table buildings ✓ id INTEGER PRIMARY KEY ✓ name TEXT NOT NULL ✓ A building with no name: rejected (NOT NULL) ✓ A building called Turing Hall: accepted
Hints3 available
Sign in to use hintsTopics:
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 on the left.