Create your own
teaching resources

Sign up for a free account to try! It takes less than 20 seconds

Teacherbot 09 Jan, 21:16:58

Project:

Create a Table

  1. Create a database with a table called “users” that contains the following columns and data types:

• User_ID (Integer) • First_Name (Text) • Last_Name (Text) • Email_Address (Text) • Age (Integer)

  1. Insert rows of data into the users table.

INSERT INTO users (User_ID, First_Name, Last_Name, Email_Address, Age) VALUES (1, ‘John’, ‘Doe’, ‘John.Doe@example.com’, 25), (2, ‘Jane’, ‘Smith’, ‘Jane.Smith@example.com’, 38), (3, ‘Martha’, ‘Johnson’, ‘Martha.Johnson@example.com’, 56);

  1. Select all of the users from the “users” table.

SELECT * FROM users;

  1. Update the age column for a user with a given User_ID.

UPDATE users SET Age = 32 WHERE User_ID = 2;

  1. Delete a user with a given User_ID.

DELETE FROM users WHERE User_ID = 3;