Knowledge check: Create, insert and select
The following SQL statement contains the syntax to create a product table with two columns ID and price: CREATE TABLE product_table (ID, price); a. False b. True
a. False This SQL statement does not define which data types must be assigned to each column.
A player with ID = 5, name = "Tina" and age = 23 must be added to the "Players" table for a soccer club database. Select the right SQL syntax to insert the player data into the table. a. INSERT INTO Players (ID, name, age) VALUES (5, "Tina", 23); b. INSERT INTO TABLE Players (ID, name, age) VALUES (5, "Tina", 23);
a. INSERT INTO Players (ID, name, age) VALUES (5, "Tina", 23);
You need to create a table for bank account records in a financial database. Which of the following SQL statements can you use to complete this task? a. CREATE ENTITY bank_account (account_number INT, balance DECIMAL); b. CREATE TABLE bank_account (account_number INT, balance DECIMAL);
b. CREATE TABLE bank_account (account_number INT, balance DECIMAL);
Select the right SQL statement to insert a new record of data into three columns of a table called "Games" with the following values: GameID = 1, gameDate = 2022-10-10 and score = 3 a. INSERT INTO games (GameID, gameDate, score) CONSTRAINT (1, "2022-10-10", 3); b. INSERT INTO games (GameID, gameDate, score) VALUES (1, "2022-10-10", 3);
b. INSERT INTO games (GameID, gameDate, score) VALUES (1, "2022-10-10", 3);
A hockey team requires all available data on their players for an upcoming meeting. Choose the correct SQL statement to select all data available in the players' table a. SELECT * players; b. SELECT * FROM players;
b. SELECT * FROM players;