
Special DB Exam
Quiz
•
Computers
•
University
•
Practice Problem
•
Medium
ELLAINE CERVANTES
Used 1+ times
FREE Resource
Enhance your content in a minute
75 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Which of the following is the correct MySQL command to create a database?
CREATE TABLE database_name;
CREATE DATABASE database_name;
NEW DATABASE database_name;
CREATE SCHEMA database_name;
2.
MULTIPLE CHOICE QUESTION
20 sec • 2 pts
Which of the following queries will return employees who have a salary greater than the average salary of all employees?
SELECT * FROM employees WHERE salary > (SELECT AVG(salary) FROM employees);
SELECT * FROM employees WHERE salary = AVG(salary);
SELECT * FROM employees WHERE salary > (SELECT MAX(salary) FROM employees);
SELECT * FROM employees WHERE salary > 5000;
3.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Which of the following SQL commands is used to prevent new records from being inserted into a table?
DISABLE INSERT INTO table_name;
ALTER TABLE table_name ADD DISABLE_INSERT;
LOCKS TABLES table_name WRITE;
ALTER TABLE table_name SET INSERT RESTRICT;
NO ANSWER
4.
MULTIPLE CHOICE QUESTION
20 sec • 2 pts
What is the result of the following query?
SELECT employee_id, salary FROM employees ORDER BY salary DESC LIMIT 3 OFFSET 2;
The query will return the 3rd, 4th, and 5th highest salaries.
The query will return the top 3 highest salaries.
The query will return the 2nd, 3rd, and 4th highest salaries.
The query will return the top 2 highest salaries starting from the 3rd highest.
5.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
What does the following SQL statement do?
SELECT COUNT(*) FROM employees WHERE department_id IS NULL;
Counts the number of employees in the employees table.
Counts the number of employees with no department.
Counts the number of NULL values in the department_id column
Counts the total number of rows in the employees table.
6.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Which of the following queries will return the second highest salary from the employees table?
SELECT MAX(salary) FROM employees WHERE salary < (SELECT MAX(salary) FROM employees);
SELECT MIN(salary) FROM employees ORDER BY salary DESC LIMIT 1 OFFSET 1;
SELECT DISTINCT salary FROM employees ORDER BY salary DESC LIMIT 1 OFFSET 1;
SELECT salary FROM employees ORDER BY salary LIMIT 1 OFFSET 2;
7.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Which statement will return the count of employees per department, including departments with zero employees?
SELECT department_id, COUNT(employee_id) FROM employees GROUP BY department_id;
SELECT d.department_id, COUNT(e.employee_id) FROM departments d LEFT JOIN employees e ON d.department_id = e.department_id GROUP BY d.department_id;
SELECT department_id, COUNT(*) FROM employees WHERE department_id IS NOT NULL GROUP BY department_id;
SELECT department_id, COUNT(*) FROM employees GROUP BY department_id WITH NULLS;
Create a free account and access millions of resources
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
70 questions
Evaluasi Akhir Semester Genap 2022 WS
Quiz
•
University
80 questions
Day - 8 Complete Syllabus (Core JAVA)
Quiz
•
University
76 questions
Đề 21 E3 HT 23.24
Quiz
•
University
75 questions
APCS Principles Practice Exam
Quiz
•
8th Grade - University
80 questions
TKI MODUL 4 MKJ
Quiz
•
University
76 questions
PSW GRIND
Quiz
•
University
79 questions
NET1L - Lesson 4 (Physical Layer)
Quiz
•
University
75 questions
Chapter 2 Quiz
Quiz
•
University
Popular Resources on Wayground
10 questions
Honoring the Significance of Veterans Day
Interactive video
•
6th - 10th Grade
9 questions
FOREST Community of Caring
Lesson
•
1st - 5th Grade
10 questions
Exploring Veterans Day: Facts and Celebrations for Kids
Interactive video
•
6th - 10th Grade
19 questions
Veterans Day
Quiz
•
5th Grade
14 questions
General Technology Use Quiz
Quiz
•
8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Circuits, Light Energy, and Forces
Quiz
•
5th Grade
19 questions
Thanksgiving Trivia
Quiz
•
6th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)
Quiz
•
8th Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
9 questions
Principles of the United States Constitution
Interactive video
•
University
18 questions
Realidades 2 2A reflexivos
Quiz
•
7th Grade - University
10 questions
Dichotomous Key
Quiz
•
KG - University
25 questions
Integer Operations
Quiz
•
KG - University
7 questions
What Is Narrative Writing?
Interactive video
•
4th Grade - University
20 questions
SER vs ESTAR
Quiz
•
7th Grade - University
