Add an Email Column
Mediumsql
The customers table currently has only id and name. Write an ALTER TABLE statement that adds a new nullable email column of type TEXT. The checker will insert a row using the new column and read the table back to confirm it exists.
sqlCREATE TABLE customers ( id INTEGER PRIMARY KEY, name TEXT NOT NULL );
Starting data:
sqlINSERT INTO customers (id, name) VALUES (1, 'Asha'), (2, 'Rohan');
Example 1
Input
(none)
Output
id name email 1 Asha NULL 2 Rohan NULL 99 Placeholder test@x.com
ALTER TABLE ... ADD COLUMN adds a new column to an existing table without touching existing rows (they get NULL for the new column). Reference: ALTER TABLE customers ADD COLUMN email TEXT;