DB QUIZ 1

DB QUIZ 1

University

10 Qs

quiz-placeholder

Similar activities

BTS #1 - True Army Test (مبتدئين)

BTS #1 - True Army Test (مبتدئين)

1st Grade - Professional Development

10 Qs

CompTIA A+ 20200306

CompTIA A+ 20200306

University

15 Qs

Intro to Education Quiz

Intro to Education Quiz

2nd Grade - University

10 Qs

CRMEAE

CRMEAE

University

15 Qs

Mastering Power Query Data Cleaning

Mastering Power Query Data Cleaning

University

15 Qs

Social Media

Social Media

University

15 Qs

Computer Networks

Computer Networks

8th Grade - University

11 Qs

Kpop (Boybands)

Kpop (Boybands)

KG - Professional Development

11 Qs

 DB QUIZ 1

DB QUIZ 1

Assessment

Quiz

Other

University

Hard

Created by

AMMAR NAZAR

Used 2+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

Which of the following queries will correctly select all rows where the "age" column is between 20 and 30, inclusive, and sorted by "name" in descending order?

SELECT * FROM users WHERE age >= 20 OR age <= 30 ORDER BY name DESC;

SELECT * FROM users WHERE age BETWEEN 20 AND 30 ORDER BY name DESC;

SELECT * FROM users WHERE age >= 20 AND age <= 30 ORDER BY name ASC;

SELECT * FROM users WHERE age BETWEEN 20 AND 30 ORDER BY name ASC;

2.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

What is the output of the following query if the "salary" column contains NULL values?

SELECT COUNT(salary) FROM employees;

Count of all rows including NULLs

Count of all rows excluding NULLs

Count of only NULL values

Syntax error

3.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

Which SQL query will delete only the first 10 rows from a table "orders" with 1000 rows?

DELETE FROM orders LIMIT 10;

TRUNCATE orders LIMIT 10;

DELETE TOP 10 FROM orders;

REMOVE FROM orders LIMIT 10;

4.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

8. What does the following query do?

SELECT * FROM users WHERE name LIKE 'A%' AND age > 30 OR city = 'New York';

A. Returns users whose name starts with 'A' and age > 30 and live in New York

B. Returns users whose name starts with 'A' and age > 30 or live in New York

C. Returns only users from New York

D. Syntax error

5.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

13. What does this query return?

SELECT * FROM orders WHERE product_name LIKE '%phone%';

Orders containing 'phone' anywhere in the product name

Orders where the product name starts with 'phone'

Orders where the product name ends with 'phone'

Syntax error

6.

FILL IN THE BLANK QUESTION

45 sec • 1 pt

Retrieve all employees who are either in the 'Sales' department or have a salary above 50,000 but exclude those whose names start with 'A' and who are not in 'HR':

7.

FILL IN THE BLANK QUESTION

45 sec • 1 pt

Select the top 3 highest paid employees, including those with NULL salaries, but order NULLs last:

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 Other