Search Header Logo

Lab 5 Review Quiz - Functions and Subqueries

Authored by Nicole Berard

Computers

University

Used 1+ times

Lab 5 Review Quiz - Functions and Subqueries
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a single-row SQL function that converts a string to uppercase in Oracle SQL?

LOWER

UPPER

INITCAP

CONCAT

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the COUNT function in SQL?

To count the number of columns in a table

To count the number of rows in a table

To count the number of distinct values in a column

To count the number of characters in a string

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following SQL statements correctly uses a subquery to find employees who earn more than the average salary?

SELECT * FROM employees WHERE salary > (SELECT AVG(salary) FROM employees);

SELECT * FROM employees WHERE salary > AVG(salary);

SELECT * FROM employees WHERE salary > ALL (SELECT salary FROM employees);

SELECT * FROM employees WHERE salary > (SELECT MAX(salary) FROM employees);

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In a correlated subquery, which of the following is true?

The subquery is executed once for the entire query

The subquery is executed once for each row processed by the outer query

The subquery is executed only if the outer query returns no results

The subquery is executed only if the outer query returns results

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is an example of an aggregate function in SQL?

LENGTH

SUM

SUBSTR

INSTR

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the following SQL statement do? SELECT department_id, MAX(salary) FROM employees GROUP BY department_id;

It selects the maximum salary from the employees table

It selects the department ID and the maximum salary for each department

It selects the department ID and the total salary for each department

It selects the department ID and the average salary for each department

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following SQL functions can be used to find the remainder of a division operation?

MOD

DIV

REM

ROUND

Access all questions and much more by creating a free account

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?