
Overall SQL Exam
Passage
•
Professional Development
•
Professional Development
•
Practice Problem
•
Hard
Data_Analyst_Harish undefined
Used 5+ times
FREE Resource
Enhance your content in a minute
30 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which query fetches all customers whose name starts with “A”?
SELECT * FROM customers WHERE name = 'A%';
SELECT * FROM customers WHERE name LIKE 'A%';
SELECT * FROM customers WHERE name STARTS WITH 'A';
SELECT * FROM customers WHERE name IN ('A%');
2.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Which of the following is TRUE about PRIMARY KEY? (Select all that applies)
Allows NULL values
Must be unique
A table can have multiple PRIMARY KEYS
A values must be entered in a PRIMARY KEY Column
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which query finds the 2nd highest salary?
SELECT MAX(salary) FROM employees WHERE salary < (SELECT MAX(salary) FROM employees);
SELECT DISTINCT salary FROM employees ORDER BY salary DESC LIMIT 1 OFFSET 1;
SELECT salary FROM employees ORDER BY salary DESC LIMIT 2,1;
Both a and b
4.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Which query finds each employee’s salary compared to previous employee in order of hire_date?
SELECT name, salary,
LAG(salary) OVER(ORDER BY hire_date) prev_salary
FROM employees;
SELECT name, salary,
LEAD(salary) OVER(ORDER BY hire_date) prev_salary
FROM employees;
SELECT name, salary FROM employees ORDER BY hire_date;
SELECT name, salary, salary-1 FROM employees;
5.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Which of the following queries creates a VIEW of active customers?
CREATE VIEW active_customers AS
SELECT * FROM customers WHERE status='active';
CREATE OR REPLACE VIEW active_customers AS
SELECT * FROM customers WHERE status='active';
CREATE TABLE active_customers AS
SELECT * FROM customers WHERE status='active';
Both a and b
6.
MULTIPLE SELECT QUESTION
45 sec • 2 pts
Which query finds employees who do not have a manager assigned? (Select all that applies)
SELECT * FROM employees WHERE manager_id IS NULL;
SELECT * FROM employees WHERE manager_id = NULL;
SELECT * FROM employees WHERE manager_id NOT IN (SELECT id FROM employees);
SELECT * FROM employees WHERE manager_id = 0;
7.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Which query checks employees working in more than one department? (emp_dept table)
SELECT emp_id FROM emp_dept
GROUP BY emp_id
HAVING COUNT(DISTINCT dept_id) > 1;
SELECT emp_id FROM emp_dept WHERE dept_id > 1;
SELECT DISTINCT emp_id FROM emp_dept;
SELECT emp_id FROM emp_dept GROUP BY dept_id;
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
Already have an account?
Similar Resources on Wayground
30 questions
Session 1LNMIIT
Quiz
•
Professional Development
30 questions
LV03 mock exam
Quiz
•
Professional Development
26 questions
e-COM 2024/s0s5 MID TERM
Quiz
•
Professional Development
31 questions
Cold Water Systems | 6035-02 | Picture Quiz
Quiz
•
Professional Development
30 questions
MSG PST Week 4 Refresher
Quiz
•
Professional Development
28 questions
Ducati Quiz
Quiz
•
Professional Development
30 questions
Comptia Sec+ 421-450
Quiz
•
Professional Development
28 questions
Quiz on Applications and Apps
Quiz
•
Professional Development
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
