Challenge - 5 Problems
SQL Statement Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
Identify the category of the SQL statement
Which category does the following SQL statement belong to?
CREATE TABLE Students (ID INT, Name VARCHAR(100));
Attempts:
2 left
💡 Hint
Think about whether this statement changes the structure of the database or the data inside it.
✗ Incorrect
CREATE TABLE is used to define or change the structure of database objects, so it belongs to DDL.
🧠 Conceptual
intermediate2:00remaining
Classify the SQL statement type
What category does this SQL statement belong to?
SELECT * FROM Employees WHERE Department = 'Sales';
Attempts:
2 left
💡 Hint
This statement retrieves data without changing it.
✗ Incorrect
SELECT statements are used to query data, so they belong to DQL.
❓ query_result
advanced2:00remaining
Determine the effect of a DML statement
What will be the result of this SQL statement?
Assuming the Products table initially has 5 rows.
INSERT INTO Products (ID, Name) VALUES (101, 'Pen');
SELECT COUNT(*) FROM Products;
Assuming the Products table initially has 5 rows.
Attempts:
2 left
💡 Hint
INSERT adds a new row to the table.
✗ Incorrect
The INSERT statement adds one row, so the count increases by one.
📝 Syntax
advanced2:00remaining
Identify the correct DCL statement syntax
Which of the following SQL statements correctly grants SELECT permission on the Customers table to user 'Alice'?
Attempts:
2 left
💡 Hint
The correct syntax uses ON before the table name.
✗ Incorrect
The GRANT statement syntax is: GRANT permission ON object TO user;
🔧 Debug
expert2:00remaining
Find the error in this mixed SQL statement
What error will this SQL code produce?
UPDATE Orders SET Status = 'Shipped' WHERE OrderID = 123;
GRANT DELETE ON Orders TO Bob;
Attempts:
2 left
💡 Hint
Both UPDATE and GRANT are valid statements in their categories.
✗ Incorrect
UPDATE is a DML statement and GRANT is a DCL statement; both are syntactically correct and valid.