NEW
Font size
Worksheets[Program 1] - Lesson 2 - Mastering Basic SQL Concepts
Total questions: 12
Worksheet time: 6mins
Ethan is working on a database for his school project. He needs to choose a SQL data type for storing text, such as 'Hello World'. Which SQL data type should he use?
INT
FLOAT
DATE
VARCHAR
In a database for a school, what is the correct syntax to select all columns from a table named 'Students'?
SELECT * FROM Students;
SELECT ALL FROM Students;
SELECT Students;
GET * FROM Students;
Which operator is used to compare two values for equality in SQL?
<>
=
===
==
What SQL operator is used to filter records that are not equal to a specified value?
<>
==
<>=
=
How do you select records from a table where the 'Status' is 'Active'?
SELECT * FROM Users WHERE Status != 'Active';
SELECT * FROM Users WHERE Status = 'Active';
SELECT * FROM Users WHERE Active = 'True';
SELECT * FROM Users WHERE Status = 'Inactive';
What is the purpose of the WHERE clause in an SQL statement?
It deletes records from the database.
It sorts records in ascending order.
It combines multiple tables into one.
It filters records based on specified conditions.
How can you filter records to show only those with a 'Salary' greater than 50000?
SELECT * FROM Employees WHERE Salary = 50000;
SELECT * FROM Employees WHERE Salary < 50000;
SELECT * FROM Employees WHERE Salary > 50000;
SELECT * FROM Employees;
Which SQL operator is used to check if a value is within a specified range?
IN
LIKE
EQUALS
BETWEEN......AND
Which date format we should use when working with Date data type in SQL?
yy/MM/dd
dd/MM/yyyy
yyyy-MM-dd
01-MM-YYYY
Which operator would you use to find records that contain a specific substring to match predefined patterns?
==
LIKE
IN
MATCH
How do you select distinct values from a column named 'City' in the 'Locations' table?
SELECT DISTINCT * FROM Locations;
SELECT City WHERE DISTINCT FROM Locations;
SELECT City FROM Locations;
SELECT DISTINCT City FROM Locations;
Which SQL statement is used to retrieve unique values from a column named 'Category' in the 'Items' table?
SELECT UNIQUE Category FROM Items;
SELECT DISTINCT Category FROM Items;
SELECT Category FROM Items;
SELECT Category WHERE UNIQUE FROM Items;
