NEW
Font size
WorksheetsJ277 - 2.2 - The use of SQL to search for data
Total questions: 10
Worksheet time: 5mins
What is the purpose of the SQL SELECT statement?
To delete data from a database
To retrieve data from a database
To update data in a database
To insert data into a database
Which clause is used to specify the table from which to retrieve data in an SQL query?
SELECT
WHERE
FROM
JOIN
In the SQL statement `SELECT name, age FROM students WHERE age > 16;`, what does the WHERE clause do?
It specifies the columns to be retrieved
It specifies the table to retrieve data from
It filters the data to include only students older than 16
It orders the data by age
Which of the following SQL statements will retrieve all columns from the "employees" table?
SELECT * FROM employees;
SELECT all FROM employees;
SELECT columns FROM employees;
SELECT everything FROM employees;
How would you write an SQL query to select only the "name" and "email" columns from a table called "users"?
SELECT name, email FROM users;
SELECT name email FROM users;
SELECT name AND email FROM users;
SELECT name OR email FROM users;
What does the following SQL query do? `SELECT * FROM products WHERE price < 20;`
It selects all products with a price greater than 20
It selects all products with a price less than 20
It selects all products with a price equal to 20
It selects all products with a price not equal to 20
Which SQL keyword is used to filter records?
SELECT
FILTER
WHERE
ORDER
In the SQL query `SELECT * FROM books WHERE author = 'J.K. Rowling';`, what is the condition being applied?
The author is not 'J.K. Rowling'
The author is 'J.K. Rowling'
The book title is 'J.K. Rowling'
The book genre is 'J.K. Rowling'
What will the SQL query `SELECT name FROM cities WHERE population > 1000000;` return?
Names of cities with a population less than 1,000,000
Names of cities with a population greater than 1,000,000
Names of cities with a population equal to 1,000,000
Names of all cities
Which of the following SQL queries will select all records from the "orders" table where the "status" is "shipped"?
SELECT * FROM orders WHERE status = 'shipped';
SELECT * FROM orders WHERE status IS 'shipped';
SELECT * FROM orders WHERE status LIKE 'shipped';
SELECT * FROM orders WHERE status IN 'shipped';
