Complete the code to select all columns from the employees table.
SELECT [1] FROM employees;The asterisk (*) selects all columns from the table.
Complete the code to create a table named customers with an id column as the primary key.
CREATE TABLE customers (id [1] PRIMARY KEY);The INT type is commonly used for primary keys as unique identifiers.
Fix the error in the code to add a new column named email of type VARCHAR(255) to the users table.
ALTER TABLE users [1] COLUMN email VARCHAR(255);
To add a new column, use the ADD keyword in ALTER TABLE.
Fill both blanks to create a table named orders with order_id as primary key and order_date as a date column.
CREATE TABLE orders (order_id [1] PRIMARY KEY, order_date [2]);
Primary keys are often integers (INT), and dates use the DATE type.
Fill all three blanks to select customer_name and order_date from orders where order_date is after 2023-01-01.
SELECT [1], [2] FROM orders WHERE [3] > '2023-01-01';
You select customer_name and order_date columns, and filter where order_date is greater than the date given.