Overall SQL Exam

Overall SQL Exam

Professional Development

30 Qs

quiz-placeholder

Similar activities

UEENEEE103A Chapter 3 revision

UEENEEE103A Chapter 3 revision

Professional Development

28 Qs

Quant_Permutation_Quiz

Quant_Permutation_Quiz

University - Professional Development

35 Qs

GROAP 14 - 2022

GROAP 14 - 2022

Professional Development

35 Qs

Salesforce 101 Assessment

Salesforce 101 Assessment

Professional Development

30 Qs

JB Standards

JB Standards

Professional Development

26 Qs

Aplikasi android

Aplikasi android

Professional Development

27 Qs

DLC Questionnaire

DLC Questionnaire

Professional Development

35 Qs

Purchase Contracts

Purchase Contracts

Professional Development

27 Qs

Overall SQL Exam

Overall SQL Exam

Assessment

Passage

Professional Development

Professional Development

Practice Problem

Hard

Created by

Data_Analyst_Harish undefined

Used 5+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Already have an account?