wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

[Program 1] - Lesson 2 - Mastering Basic SQL Concepts

Total questions: 12

Worksheet time: 6mins

Name
Class
Date
1.

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?

a)

INT

b)

FLOAT

c)

DATE

d)

VARCHAR

2.

In a database for a school, what is the correct syntax to select all columns from a table named 'Students'?

a)

SELECT * FROM Students;

b)

SELECT ALL FROM Students;

c)

SELECT Students;

d)

GET * FROM Students;

3.

Which operator is used to compare two values for equality in SQL?

a)

<>

b)

=

c)

===

d)

==

4.

What SQL operator is used to filter records that are not equal to a specified value?

a)

<>

b)

==

c)

<>=

d)

=

5.

How do you select records from a table where the 'Status' is 'Active'?

a)

SELECT * FROM Users WHERE Status != 'Active';

b)

SELECT * FROM Users WHERE Status = 'Active';

c)

SELECT * FROM Users WHERE Active = 'True';

d)

SELECT * FROM Users WHERE Status = 'Inactive';

6.

What is the purpose of the WHERE clause in an SQL statement?

a)

It deletes records from the database.

b)

It sorts records in ascending order.

c)

It combines multiple tables into one.

d)

It filters records based on specified conditions.

7.

How can you filter records to show only those with a 'Salary' greater than 50000?

a)

SELECT * FROM Employees WHERE Salary = 50000;

b)

SELECT * FROM Employees WHERE Salary < 50000;

c)

SELECT * FROM Employees WHERE Salary > 50000;

d)

SELECT * FROM Employees;

8.

Which SQL operator is used to check if a value is within a specified range?

a)

IN

b)

LIKE

c)

EQUALS

d)

BETWEEN......AND

9.

Which date format we should use when working with Date data type in SQL?

a)

yy/MM/dd

b)

dd/MM/yyyy

c)

yyyy-MM-dd

d)

01-MM-YYYY

10.

Which operator would you use to find records that contain a specific substring to match predefined patterns?

a)

==

b)

LIKE

c)

IN

d)

MATCH

11.

How do you select distinct values from a column named 'City' in the 'Locations' table?

a)

SELECT DISTINCT * FROM Locations;

b)

SELECT City WHERE DISTINCT FROM Locations;

c)

SELECT City FROM Locations;

d)

SELECT DISTINCT City FROM Locations;

12.

Which SQL statement is used to retrieve unique values from a column named 'Category' in the 'Items' table?

a)

SELECT UNIQUE Category FROM Items;

b)

SELECT DISTINCT Category FROM Items;

c)

SELECT Category FROM Items;

d)

SELECT Category WHERE UNIQUE FROM Items;