Mastering SQL Advanced Commands

Mastering SQL Advanced Commands

12th Grade

10 Qs

quiz-placeholder

Similar activities

RDBMS & SQL QUERIES

RDBMS & SQL QUERIES

12th Grade

15 Qs

L. 3. Introduction to Database Management System - 6

L. 3. Introduction to Database Management System - 6

12th Grade

10 Qs

SQL

SQL

12th Grade - University

10 Qs

BTEC National ICT U2 - Database Theory Lesson 1-3

BTEC National ICT U2 - Database Theory Lesson 1-3

12th Grade

10 Qs

SQL JOIN

SQL JOIN

KG - University

6 Qs

Access - Lesson 7

Access - Lesson 7

9th - 12th Grade

11 Qs

Lesson 3.7

Lesson 3.7

7th Grade - University

10 Qs

SQL

SQL

11th - 12th Grade

12 Qs

Mastering SQL Advanced Commands

Mastering SQL Advanced Commands

Assessment

Quiz

Computers

12th Grade

Easy

Created by

azra amir

Used 1+ times

FREE Resource

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.

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?

Discover more resources for Computers