Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Oracle Database SQL Workshop

Total questions: 20

Worksheet time: 13mins

Name
Class
Date
1.

Identify the SELECT statements that execute successfully.

a)

SELECT first_name, last_name, job_id, salary*12,

AS Yearly Sal

FROM employees;

b)

SELECT first_name, last_name, job_id, salary*12

"yearly sal"

FROM employees;

c)

SELECT first_name, last_name, job_id, salary AS

"yearly sal"

FROM employees;

d)

SELECT first_name+last_name AS name, job_Id,

salary*12 yearly sal

FROM employees;

2.

Which four of the following are valid operators for the WHERE clause?

a)

>=

b)

IS NULL

c)

!=

d)

IS LIKE

e)

IN BETWEEN

3.

Which four of the following statements are true about single-row functions?

a)

Manipulate data items

b)

Accept arguments and return one value per argument

c)

Act on each row that is returned

d)

Can be nested

e)

Accept arguments that can be a column or an expression

4.

The TO_NUMBER function converts either character strings or date values to a number in the format specified by the optional format model.

a)

True

b)

False

5.

Identify the two guidelines for group functions and the GROUP BY clause.

a)

You cannot use a column alias in the GROUP BY clause.

b)

The GROUP BY column must be in the SELECT clause.

c)

By using a WHERE clause, you can exclude rows before dividing them into groups.

d)

The GROUP BY clause groups rows and ensures the order of the result set.

e)

If you include a group function in a SELECT clause, you must include a GROUP BY

clause.

6.

If you join a table to itself, what kind of join are you using?

a)

Left OUTER join

b)

Right OUTER join

c)

Full OUTER join

d)

Self-join

e)

Natural join

7.

Using a subquery is equivalent to performing two sequential queries and using the result of the first query as the search values in the second query.

a)

True

b)

False

8.

Identify two set operator guidelines.

a)

The expressions in the SELECT lists must match in number.

b)

Parentheses cannot be used to alter the sequence of execution.

c)

The data type of each column in the second query must match the data type of its

corresponding column in the first query.

d)

The ORDER BY clause can be used only once in a compound query, unless a UNION

ALL operator is used.

9.

The following statements produce the same results:

DELETE FROM copy_emp;

TRUNCATE TABLE copy_emp;

a)

True

b)

False

10.

Identify three actions that you perform by using constraints.

a)

Enforce rules on the data in a table whenever a row is inserted, updated, or deleted.

b)

Prevent the dropping of a table.

c)

Prevent the creation of a table.

d)

Prevent the creation of data in a table.

11.

The dictionary views that are based on the dictionary tables contain information such as:

a)

Definitions of all the schema objects in the database

b)

Default values for the columns

c)

Integrity constraint information

d)

Privileges and roles that each user has been granted

12.

Indexes must be created manually and serve to speed up access to rows in a table

a)

True

b)

False

13.

You cannot add data through a view if the view includes a GROUP BY clause.

a)

True

b)

False

14.

A FOREIGN KEY constraint enforces the following action:

When the data in the parent key is deleted, all the rows in the child table that depend on the deleted parent key values are also deleted.

a)

True

b)

False

15.

With a correlated subquery, the inner SELECT statement drives the outer SELECT statement.

a)

True

b)

False

16.

Which of the following statements are true?

a)

Subqueries are used to retrieve data by using an inline view.

b)

Subqueries cannot be used to copy data from one table to another.

c)

Subqueries update data in one table based on the values of another table.

d)

Subqueries delete rows from one table based on rows in another table.

17.

You can use a subquery in place of the table name in the ______ clause of the INSERT statement.

a)

FROM

b)

INTO

c)

FOR UPDATE

d)

VALUES

18.

Which of the following statements are true?

a)

After a user creates an object, the user can pass along any of the available object privileges to other users by using the GRANT statement.

b)

A user can create roles by using the CREATE ROLE statement to pass along a collection

of system or object privileges to other users.

c)

Users can change their own passwords.

d)

Users can view the privileges granted to them and those that are granted on their

objects.

19.

When you use the INSERT or UPDATE command, the DEFAULT keyword saves you from hard-coding the default value in your programs or querying the dictionary to find it.

a)

True

b)

False

20.

The TIME_ZONE session parameter may be set to:

a)

A relative offset

b)

Database time zone

c)

OS local time zone

d)

A named region