
DB QUIZ 1

Quiz
•
Other
•
University
•
Hard
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
Similar Resources on Wayground
15 questions
Partnership Accounts

Quiz
•
University
10 questions
Sql Set 2

Quiz
•
University
10 questions
Dosage Calculation - Label Reading

Quiz
•
10th Grade - University
12 questions
How much social media lingo do you know?

Quiz
•
University
10 questions
Power Point

Quiz
•
University
15 questions
CRMEAE

Quiz
•
University
15 questions
Mastering Power Query Data Cleaning

Quiz
•
University
15 questions
Social Media

Quiz
•
University
Popular Resources on Wayground
55 questions
CHS Student Handbook 25-26

Quiz
•
9th Grade
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
10 questions
Chaffey

Quiz
•
9th - 12th Grade
15 questions
PRIDE

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
22 questions
6-8 Digital Citizenship Review

Quiz
•
6th - 8th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade