Search Header Logo

Mastering SQL Advanced Commands

Authored by azra amir

Computers

12th Grade

Used 1+ times

Mastering SQL Advanced Commands
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the DISTINCT keyword do in SQL?

The DISTINCT keyword limits the number of records returned.

The DISTINCT keyword combines multiple records into one.

The DISTINCT keyword sorts the result set alphabetically.

The DISTINCT keyword removes duplicate records from the result set.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How would you write a query to select unique values from a column named 'city'?

SELECT UNIQUE city FROM table_name;

SELECT city FROM table_name WHERE city IS NOT NULL;

SELECT DISTINCT city FROM table_name;

SELECT city FROM table_name GROUP BY city;

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which SQL clause is used to filter records based on a condition?

WHERE

HAVING

GROUP BY

SELECT

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you combine multiple conditions in a SQL query?

Use SELECT and FROM clauses to combine conditions.

Use AND and OR operators to combine conditions.

Combine conditions by using GROUP BY only.

Conditions can only be combined in subqueries.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the ORDER BY clause in SQL?

To limit the number of rows returned by a query.

To filter the result set of a query.

To sort the result set of a query.

To group the result set of a query.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Write a SQL query to select distinct 'product_name' from 'products' where 'category' is 'electronics'.

SELECT product_name FROM products WHERE category = 'electronics';

SELECT DISTINCT product_name FROM products;

SELECT product_name, category FROM products WHERE category = 'electronics';

SELECT DISTINCT product_name FROM products WHERE category = 'electronics';

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you use the AND operator in a SQL WHERE clause?

Use the OR operator to combine conditions in a WHERE clause.

The AND operator is used only in SELECT statements.

Use the AND operator to combine conditions in a WHERE clause, e.g., WHERE condition1 AND condition2.

You cannot use the AND operator in SQL.

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?