Complete the code to create a table named 'users' with an 'id' column as the primary key.
CREATE TABLE [1] (id SERIAL PRIMARY KEY);The table name should be 'users' as specified. 'users' is the correct plural form commonly used for user data tables.
Complete the code to add a 'username' column of type VARCHAR with a maximum length of 50 characters.
ALTER TABLE users ADD COLUMN [1] VARCHAR(50);
The column name should be 'username' exactly as specified to store user login names.
Fix the error in the code to create a table with an 'email' column that cannot be null.
CREATE TABLE contacts (id SERIAL PRIMARY KEY, email VARCHAR(100) [1]);
The 'email' column must be declared with 'NOT NULL' to ensure every record has an email address.
Fill both blanks to create a table 'products' with an 'id' as primary key and a 'price' column of type numeric with 2 decimal places.
CREATE TABLE [1] (id [2] PRIMARY KEY, price NUMERIC(10, 2));
The table name is 'products'. The 'id' column uses 'SERIAL' to auto-increment and serve as a primary key.
Fill all three blanks to create a table 'orders' with 'order_id' as primary key, 'order_date' as date type, and 'customer_id' as integer foreign key.
CREATE TABLE [1] ([2] SERIAL PRIMARY KEY, order_date [3], customer_id INTEGER REFERENCES customers(id));
The table name is 'orders'. The primary key column is 'order_id' with auto-increment 'SERIAL'. The 'order_date' column uses the 'DATE' type for storing dates.