Overall SQL Exam

Overall SQL Exam

Professional Development

30 Qs

quiz-placeholder

Similar activities

Rereshment Kp Kendal Sesion 2 Maret

Rereshment Kp Kendal Sesion 2 Maret

Professional Development

31 Qs

Organizational Behavior - Unit 4  & 5

Organizational Behavior - Unit 4 & 5

Professional Development

30 Qs

SQL Quiz-3

SQL Quiz-3

Professional Development

30 Qs

Chapter 31

Chapter 31

Professional Development

29 Qs

Ujian FSD Blueprint DCT Outstanding Finance

Ujian FSD Blueprint DCT Outstanding Finance

Professional Development

30 Qs

Final Review

Final Review

Professional Development

30 Qs

ERP & Business Acumen

ERP & Business Acumen

Professional Development

30 Qs

NCPDP Rejection Codes

NCPDP Rejection Codes

Professional Development

26 Qs

Overall SQL Exam

Overall SQL Exam

Assessment

Passage

Professional Development

Professional Development

Hard

Created by

Data_Analyst_Harish undefined

Used 2+ times

FREE Resource

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
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?