0
0
SQLquery~10 mins

SQL statement categories (DDL, DML, DQL, DCL) - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a new table named 'employees'.

SQL
CREATE [1] employees (id INT, name VARCHAR(100));
Drag options to blanks, or click blank then click option'
ADATABASE
BTABLE
CVIEW
DINDEX
Attempts:
3 left
💡 Hint
Common Mistakes
Using CREATE DATABASE instead of CREATE TABLE.
Using CREATE VIEW when a table is needed.
2fill in blank
medium

Complete the code to insert a new row into the 'employees' table.

SQL
INSERT INTO employees [1] (1, 'Alice');
Drag options to blanks, or click blank then click option'
ASELECT
BSET
CVALUES
DINTO
Attempts:
3 left
💡 Hint
Common Mistakes
Using SET instead of VALUES in INSERT statements.
Using SELECT incorrectly in this context.
3fill in blank
hard

Fix the error in the query to select all columns from 'employees'.

SQL
SELECT [1] FROM employees;
Drag options to blanks, or click blank then click option'
A*
BALL
CEVERY
DALL_COLUMNS
Attempts:
3 left
💡 Hint
Common Mistakes
Using ALL or EVERY which are not valid in this context.
Trying to write ALL_COLUMNS which is not a SQL keyword.
4fill in blank
hard

Fill both blanks to grant SELECT permission on 'employees' to user 'john'.

SQL
GRANT [1] ON employees TO [2];
Drag options to blanks, or click blank then click option'
ASELECT
BINSERT
Cjohn
Dadmin
Attempts:
3 left
💡 Hint
Common Mistakes
Granting INSERT instead of SELECT.
Using the wrong username.
5fill in blank
hard

Fill all three blanks to update the name of employee with id 1 to 'Bob'.

SQL
UPDATE employees SET [1] = [2] WHERE [3] = 1;
Drag options to blanks, or click blank then click option'
Aname
B'Bob'
Cid
Dsalary
Attempts:
3 left
💡 Hint
Common Mistakes
Using salary instead of name.
Forgetting quotes around 'Bob'.
Using wrong condition column.