Overall SQL Exam

Overall SQL Exam

Professional Development

30 Qs

quiz-placeholder

Similar activities

T1 Pro 5G

T1 Pro 5G

Professional Development

27 Qs

Latihan UP PGSD Daljab 2022

Latihan UP PGSD Daljab 2022

Professional Development

35 Qs

Ohm’s law - simple electrical circuits and problems

Ohm’s law - simple electrical circuits and problems

Professional Development

27 Qs

Data & Automation

Data & Automation

Professional Development

26 Qs

e-Golf

e-Golf

Professional Development

26 Qs

Introduction to Landforms

Introduction to Landforms

Professional Development

26 Qs

Review PKP Surabaya

Review PKP Surabaya

Professional Development

31 Qs

Education Session: Learn with Fun 2

Education Session: Learn with Fun 2

Professional Development

27 Qs

Overall SQL Exam

Overall SQL Exam

Assessment

Passage

Professional Development

Professional Development

Hard

Created by

Data_Analyst_Harish undefined

Used 4+ 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

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?

Discover more resources for Professional Development