Database Flashcards

1
Q

The WITH clause can be used to name a subquery. Which of the following is also true?

A
  • The name of the subquery can be used in the SELECT statement following the WITH clause.
  • The name of the subquery can be joined to other tables in the SELECT statement following the WITH clause.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which three statements are true about multiple row subqueries?

A
  • They can return multiple columns.
  • They can contain GROUP BY clauses.

=Two or more values are always returned from the subquery.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which two are true about savepoints?

A

=After issuing a savepoints, you can roll back to the savepoint name within the current transaction.

=You can commit updates done between two savepoints without committing other updates in the current transaction.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which statement is true regarding external tables?

A

The CREATE TABLE AS SELECT statement can be used to upload data into a normal table in the database from an external table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which statement is true regarding external tables?

A

The CREATE TABLE AS SELECT statement can be used to upload data into a normal table in the database from an external table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Built-in SQL functions:

Choose three.

A

Are available for use within a SELECT statement’s WHERE clause, as well as the SELECT statement’s expression list.

Can be invoked from a DELETE statement’s WHERE clause.

Are available for use from the UPDATE statement.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

An invisible index is an index on one or more columns in a table:

A

And is updated for any DELETE statements performed on the table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which three statements are true about GLOBAL TEMPORARY TABLES?

A

Data Manipulation Language (DML) on GLOBAL TEMPORARY TABLES generates no REDO.

A trigger can be created on a GLOBAL TEMPORARY TABLE.

A GLOBAL TEMPORARY TABLE can be referenced in the defining query of a view.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Which three statements are true about single-row functions?

A

The argument can be a column name, variable, literal or an expression

They can be nested to any level

The data type returned can be different from the data type of the argument

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which statement is true regarding the default behavior of the ORDER BY clause?

A

Numeric values are displayed from the maximum to the minimum value if they have decimal positions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Which two are true about granting privileges on objects?

A

A table owner must grant the REFERENCES privilege to allow other users to create FOREIGN KEY constraints using that table.

The owner of an object acquires all object privileges on that object by default.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which two statements are true regarding views?

A

Rows cannot be deleted through a view if the view definition contains the DISTINCT keyword.

The OR REPLACE option is used to change the definition of an existing view without dropping and re-creating it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

The purpose of NULLIF is to:

A

None of the above

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What can an INSERT statement do?

A

Add data into more than one column in a table

Add rows into more than one table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Which of the following can a subquery be used in?

A

A WHERE clause in a SELECT statement

An INSERT statement’s SELECT

An inline view

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

To list all the currently defined variables, use:

A

DEFINE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What can be granted to a role?

A

System privileges

Object privileges

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

A role:

A

Can be created by a user only if that user has the CREATE ROLE system privilege

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Which two are true about scalar subquery expressions?

A

They can return at most one row.

You must enclose them in parentheses.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

A self-join is:

A

A SELECT statement that joins a table to itself by connecting a column in the table to a different column in the same table

A SELECT statement that specifies one table twice in the FROM clause

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

A multitable INSERT statement:

A

Can use conditional logic

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Which three statements are true regarding single-row functions?

A

The data type returned, can be different from the data type of the argument that is referenced.

They can accept column names, expressions, variable names, or a user-supplied constants as arguments.

They can be used in SELECT, WHERE, and ORDER BY clauses.

23
Q

Which of the following comparison operators can be used with a multiple-row subquery?

A

IN

> = ALL

24
Q

In which three situations does a transaction complete?

A

when a ROLLBACK command is executed

when a TRUNCATE statement is executed after the pending transaction

when a data definition language (DDL) statement is executed

25
Q

Which normal form is a table in if it has no multi-valued attributes and no partial dependencies?

A

Second normal form

26
Q

How many tables can be joined in a query?

A

One, two, three, or more

27
Q

When combining two SELECT statements, which of the following set operators will produce a different result, depending on which SELECT statement precedes or follows the operator?

A

MINUS

28
Q

Which two statements are true about INTERVAL data types?

A

INTERVAL YEAR TO MONTH columns support yearly intervals

INTERVAL DAY TO SECOND columns support fractions of second

29
Q

Which three statements are true regarding group functions?

A

They can be used on columns or expressions.

They can be passed as an argument to another group function.

They can be used along with the single-row function in the SELECT clause of a SQL statement.

30
Q

Another name for an EXISTS query is:

A

Semijoin

31
Q

Which two statements are true regarding multiple-row subqueries?

A

They can contain group functions.

They should not be used with the NOT IN operator in the main query if NULL is likely to be a part of the result of the subquery.

32
Q

Which statement is true regarding the default behavior of the ORDER BY clause?

A

Numeric values are displayed from the maximum to the minimum value if they have decimal positions.

33
Q

Which three statements are correct regarding indexes?

A

A non-deferrable PRIMARY KEY or UNIQUE KEY constraint in a table automatically attempts to create a unique index.

For each DML operation performed, the corresponding indexes are automatically updated.

When a table is dropped, the corresponding indexes are automatically dropped.

34
Q

Which three are true about system and object privileges?

A

Adding a foreign key constraint pointing to a table in another schema requires the REFERENCES object privilege

WITH GRANT OPTION can be used when granting an object privilege to both users and roles

Revoking a system privilege that was granted with WITH ADMIN OPTION has a cascading effect

35
Q

Which two statements are true about an Oracle database?

A

A table can have multiple foreign keys.

A NUMBER column without data has a zero value

36
Q

Which three statements are true about multiple-row subqueries?

A

They can return multiple columns as well as rows.

They can contain a subquery within a subquery.

They can contain group functions and GROUP BY and HAVING clauses.

37
Q

Which format mask returns the local currency symbol?

A

L

38
Q

Which three are true about the CREATE TABLE command?

A

It implicitly executes a commit

A user must have the CREATE ANY TABLE privilege to create tables

The owner of the table must have the UNLIMITED TABLESPACE system privilege

39
Q

To permanently delete a substitution variable named THE_NAME so that it can no longer be used, use:

A

UNDEFINE THE_NAME

40
Q

Which of the following topics are not included in the SQL Fundamentals I exam but are addressed on the SQL Associate exam?

A

MERGE

External tables

FLASHBACK

Conversion functions

41
Q

A SEQUENCE is

A

None of the above.

42
Q

Which two statements are true regarding the execution of the correlated subqueries?

A

The nested query executes after the outer query returns the row.

Each row returned by the outer query is evaluated for the results returned by the inner query.

43
Q

Which three statements are true about performing Data Manipulation Language (DML) operations on a view in an Oracle Database?

A

Views cannot be used to add rows to an underlying table if the table has columns with NOT NULL constraints lacking default values which are not referenced in the defining query of the view.

Views cannot be used to add or modify rows in an underlying table if the defining query of the view contains the DISTINCT keyword.

Views cannot be used to add or modify rows in an underlying table if the defining query of the view contains aggregating functions.

44
Q

If an ALTER TABLE . . . DROP COLUMN statement is executed against an underlying table upon which a view is based, the status of that view in the data dictionary changes to:

A

INVALID

45
Q

Which of the following forms of subquery never returns more than one row?

A

Scalar

46
Q

Which of the following forms of subquery never returns more than one row?

A

Scalar

47
Q

Which among the following is considered an acceptable query with V$DATAFILE?

A

A query that displays rows from the table with no joins

48
Q

Which of the following are schema objects?

A

INDEX

SEQUENCE

49
Q

Which of the following statements is true about HAVING?

A

It can be used only in the SELECT statement.

It must occur after the WHERE clause.

50
Q

An aggregate function can be called from within:

A

The select list of a SELECT statement

The ORDER BY clause of a SELECT statement

51
Q

Which of the following data dictionary views does not have an OWNER column?

A

USER_TABLES

52
Q

Which three statements are true about a self join?

A

It must be an inner join

The on clause can be used

The query must use two different aliases for the table

53
Q

Which normal form is a table in if it has no multi-valued attributes and no partial dependencies?

A

Second normal form

54
Q

Which three statements are true about performing Data Manipulation Language (DML) operations on a view in an Oracle Database?

A

Views cannot be used to add or modify rows in an underlying table if the defining query of the view contains aggregating functions.

Views cannot be used to add or modify rows in an underlying table if the defining query of the view contains the DISTINCT keyword.

Views cannot be used to add rows to an underlying table if the table has columns with NOT NULL constraints lacking default values which are not referenced in the defining query of the view.