Which type of constraint specifies that the column on which the constraint is defined CANNOT contain a NULL value?
Front
NOT NULL
Back
"How many digits to the right of the decimal point are allowed for a column defined as NUMBER(7,3)?"
Front
three
Back
Which group function computes a total for a group of rows?
Front
SUM
Back
"By default, how is the output of the UNION set operator sorted?"
Front
It is sorted ascending in the order of the columns in the first SELECT list.
Back
What is produced when a join condition is not specified in a multiple-table query?
Front
a Cartesian product or cross join
Back
Which type of join joins two tables by all columns that have the same name in both tables?
Front
a natural join
Back
A multiple-row operator expects how many values?
Front
one or more
Back
Which type of constraint specifies that every value in the column must be unique or have a NULL value?
Front
UNIQUE
Back
Which SELECT statement clause can be used with the JOIN keyword to perform a natural join but limit the columns for the join condition?
Front
a USING clause
Back
Which function returns the first non-null expression in a list?
Front
the COALESCE function
Back
Which statement explicitly makes all pending data modifications permanent?
Front
the COMMIT statement
Back
Multiple-column subqueries are often used as data sources in which clause of an outer SELECT statement?
Front
the FROM clause
Back
What datatype would be used to store binary data in an external file?
Front
BFILE
Back
"If a composite primary key is required, the PRIMARY KEY constraint must be defined at what level?"
Front
the table level
Back
Which type of join containing an equality operator joins two tables by a column that contains a matching value?
Front
an equijoin
Back
Is it possible for the main query to contain a greater than sign in its WHERE clause if the subquery returns only one value?
Front
Yes
Back
"Which statement would you use to change the name of a table, view, sequence, or synonym?"
Front
RENAME. The syntax is RENAME old_name TO new_name;
Back
Which character function substitutes one string for another?
Front
"REPLACE. The syntax of the REPLACE function is REPLACE(column|expression, search_string [, 'replacement_string'])"
Back
An UPDATE statement can update multiple columns in one table by using multiple columns in which clause?
Front
"The SET clause. When multiple columns are included in the SET clause, they should be separated by commas."
Back
Valid table and column names can only contain which characters?
Front
"the characters A-Z, a-z, 0-9, _ (underscore), $, and #. (Normally table names with lower case alphabetics are treated the same as a table with upper case alphabetics. However, you can make case significant if you surround the table name by double quotes at the time it is created.) "
Back
What type of index would be most appropriate to use in a data warehousing application on a column where the cardinality may be poor?
Front
a bitmap index
Back
Which clause of a MERGE statement modifies existing records?
Front
the UPDATE clause
Back
Which DML statement only adds rows to a table?
Front
INSERT
Back
Which comparison operator compares a value to each value returned by a subquery?
Front
ANY
Back
Which clause of the ALTER TABLE statement would you use to add a NOT NULL constraint to an existing table?
Front
the MODIFY clause
Back
What is the default order of precedence for set operators?
Front
The set operators have equal precedence and thus are evaluated from left to right.
Back
"Which datatype stores lengths of time represented in days, hours, minutes, and seconds?"
Front
INTERVAL DAY TO SECOND
Back
Which element would be used in a format model to return the spelled-out year?
Front
YEAR or SYEAR
Back
"How do you insure that values entered in the salary column of the employee table must always be greater than $30,000?"
Front
Use a check constraint indicating salary > 30000.
Back
Which one of the regular expression functions returns the substring value that matches a given pattern in a given string?
Front
REGEXP_SUBSTR
Back
"When adding a DATE datatype and a NUMBER datatype, which datatype is the result?"
Front
a DATE datatype
Back
Which function rounds numeric values to a specified decimal place?
Front
"ROUND. The syntax of the ROUND number function is ROUND(column|expression, n)"
Back
"By default, how is the output of the UNION ALL set operator sorted?"
Front
It is not sorted.
Back
Which set operator returns only results that are common to two queries?
Front
INTERSECT
Back
What is the name of the concept that guarantees that users have a consistent view of the data?
Front
read consistency
Back
What constraint(s) is used to create referential integrity?
Front
the REFERENCES constraint or the FOREIGN KEY constraint
Back
What is the function of the NOCYCLE keyword in a hierarchical query?
Front
It prevents the query from aborting at run time due to an infinite loop
Back
What should enclose subqueries?
Front
parentheses
Back
Which function removes leading and/or trailing characters from a character string?
Front
"TRIM. The syntax of the TRIM function is TRIM(leading|trailing|both, trim_character, FROM column|expression)"
Back
"If within a transaction, a single DML statement fails, what is rolled back?"
Front
only the work of the offending DML statement
Back
"When using the TO_CHAR function to format dates, which format model element will display the three-letter abbreviation for the day of the week?"
Front
DY
Back
Subqueries that return more than one column are referred to as what type of subqueries?
Front
multiple-column subqueries
Back
Which clause of a CREATESEQUENCE statement specifies the starting value for the sequence?
Front
START WITH n
Back
"List the values that would match the following regular expression: ['abc']{3,5}"
Front
abcabcabc or abcabcabcabc or abcabcabcabcabc
Back
Can a group function be included in a HAVING clause?
Front
Yes
Back
Which group function calculates a standard deviation for a group of values?
Front
STDDEV
Back
Which comparison operators can be used with multiple-row subqueries?
Front
"IN, ANY, and ALL"
Back
An index created on multiple columns in a table is called what?
Front
a composite or concatenated index
Back
"When a GROUP BY clause contains multiple columns, which grouping is the most major grouping?"
Front
the first column listed in the GROUP BY clause
Back
Which two older datatypes hold raw binary data?
Front
RAW and LONG RAW
Back
Section 2
(50 cards)
Which system privilege allows a user to connect to the database?
Front
the CREATE SESSION system privilege
Back
Which SELECT statement clause creates an equijoin by specifying a column name common to both tables?
Front
a USING clause
Back
What type of subquery returns more than one row of data?
Front
a multiple-row subquery
Back
What command will insert rows into a table if they don't already exist and will update rows in that same table if they do already exist?
Front
MERGE
Back
"Assuming you have the appropriate object privileges, how should you access a table owned by another user in a FROM clause?"
Front
"prefix the table name with the owner/schema name, as in ownername.tablename"
Back
"When joining more than two tables using an ON clause, in which order are the joins evaluated?"
Front
from left to right
Back
What is the name for a SELECT statement that is embedded in another SELECT statement?
Front
a subquery
Back
Which keyword can be used with the INSERT and UPDATE statement to set a column value to the value previously defined in a DEFAULT constraint?
Front
DEFAULT
Back
"When using Oracle proprietary join syntax, what operator would you use in a WHERE clause to produce an outer join?"
Front
(+)
Back
Which two categories of statements cause an autocommit to occur?
Front
DCL and DDL statements
Back
"When performing a self join, what must be used to qualify table names?"
Front
table aliases
Back
Which function returns the number of characters in a column or character string?
Front
LENGTH. The syntax of the LENGTH function is LENGTH(column|expression)
Back
Which statement would you use to define a default value for an existing column?
Front
"ALTER TABLE. You would also use the ALTER TABLE statement to add, modify, or drop columns."
Back
Which clause of a SELECT statement does Oracle server evaluate last?
Front
the ORDER BY clause
Back
"When using the TO_CHAR function to format numbers, what does a zero in the format model indicate?"
Front
A zero (0) returns a zero in the specified position when there is no number for the position.
Back
A ______ value must either be null or match an existing value in the primary key column of the parent table.
Front
foreign key
Back
Which statement do you use to remove previously granted privileges?
Front
the REVOKE statement
Back
What is the purpose of the START WITH <column name> IS NULL clause in a hierarchical query?
Front
"Hierarchical queries that should begin at the very top of the hierarchy will often have a NULL value for <column name> since that column often will be the name of the parent, and the top row of the query does not have a parent."
Back
"Which statement permanently removes all the rows in a table, the structure of the table, all constraints, all triggers on the table, and any associated indexes?"
Front
the DROPTABLE statement
Back
What is the name of the pseudocolumn which indicates the DML performed on a row?
Front
versions_operation
Back
"When performing a multitable INSERT, what two properties about the columns in the subquery and the columns in the outer query must match?"
Front
they must be equal in number and in datatype
Back
"The CREATE, ALTER, DROP, RENAME, and TRUNCATE statements are examples of which category of SQL statement?"
Front
DDL
Back
What is the default number of decimal positions stored in a timestamp datatype?
Front
6
Back
To how many levels can group functions be nested?
Front
two
Back
What does the IDENTIFIED BY clause of the ALTER USER statement specify?
Front
the assignment of a password for the user
Back
"If today is March 12, 2012, at exactly 12 o'clock noon, what will be the result of executing the statement SELECT sysdate - to_date('12-Mar-2012') FROM dual;?"
Front
0.5
Back
"When using an ORDER BY clause in a compound query, where should you place the clause?"
Front
at the end of the statement
Back
"In a SELECT statement, in which clause must you include all columns in the SELECT list that do NOT use a grouping function of some sort?"
Front
in the GROUP BY clause
Back
Which type of outer join includes all matched rows and all unmatched rows in the second table listed?
Front
a right outer join
Back
What is the syntax to return just the month portion of the values stored in column hire_date?
Front
EXTRACT (MONTH FROM hire_date)
Back
The ADD clause of the ALTER TABLE statement is used to do what?
Front
add a column or constraint to a table
Back
Which SELECT statement clause would you use with the JOIN keyword to specify a traditional join predicate?
Front
the ON clause
Back
Can a multitable INSERT insert rows into multiple tables and views in a single pass?
Front
No. A multitable INSERT cannot insert rows into views.
Back
Can a column be referenced in an ON clause before the column's table has been specified?
Front
No
Back
Reversing the order of the SELECT statements when using the INTERSECT operator has what effect on the results?
Front
It will not affect the results.
Back
Which clause in a hierarchical query specifies the root row of the hierarchy?
Front
START WITH
Back
What is the term for a subquery in which two or more values from the main query are matched to two or more values of the subquery?
Front
a multicolumn subquery
Back
Which set operator returns only the results of the first query that are not in the second query?
Front
MINUS
Back
Which datatype is an extension of the DATE datatype and stores a fractional second value?
Front
TIMESTAMP
Back
How do you recognize a correlated subquery?
Front
The outer query makes reference to the table name in the inner query.
Back
Which character function is functionally equivalent to using the || operator?
Front
"CONCAT. The syntax of the CONCAT function is CONCAT(column1|expression1, column2|expression2)"
Back
"When using the TO_CHAR function to format a date value, are the use of upper and lower case characters significant in the format mask?"
Front
Yes
Back
Which SELECT statement clause would you use to override the implicit sorting of a GROUP BY clause?
Front
an ORDER BY clause
Back
Which expression will add five days to the current date?
Front
SYSDATE + 5
Back
Which type of join joins two tables when the column in one table does not directly correspond to a column in the second table?
Front
a non-equijoin
Back
At which two levels can constraints be defined?
Front
at the column or table level
Back
How do you create a sequence that generates descending sequence values?
Front
"Specify a negative value in the INCREMENT BY clause. For example, INCREMENT BY -1 would generate sequential descending values."
Back
Valid column and table names should begin with what?
Front
an alphabetic character
Back
An owner of an object can grant access to all users using which keyword?
Front
PUBLIC
Back
Which group function calculates the average of a group of values?
Front
AVG
Back
Section 3
(50 cards)
Which database object is an alternate name for a table or view?
Front
a synonym
Back
"What keyword must be included in the equality condition in a hierarchical query, on one side or the other of the equal sign?"
Front
PRIOR
Back
What happens when the = operator is used with a multiple-row subquery?
Front
An ORA-01427: single-row subquery returns more than one row error occurs.
Back
Which character function returns an occurrence of one string of characters within a column value or expression?
Front
"INSTR. The syntax of the INSTR function is INSTR(column|expression, 'string' [, m] [, n])"
Back
Which option for a column in a CREATETABLE statement indicates the value that the column should be given if no value is explicitly specified on an INSERT statement?
Front
the DEFAULT option
Back
Which type of join joins a table to itself?
Front
a self join
Back
"When a character column contains data, can you decrease the width of the column?"
Front
"Yes, but only if the existing data does not violate the new size"
Back
Which statement would you use to add a PRIMARY KEY constraint to a table?
Front
ALTER TABLE ADD CONSTRAINT. The full syntax is ALTER TABLE tablename ADD [CONSTRAINT constraint] type (column);
Back
Which date function returns a DATE datatype representing the current database server date and time?
Front
SYSDATE
Back
What are ten criteria which indicate that a b-tree index would be appropriate to create on a given column in a table?
Front
"1. the column contains many different values (good cardinality) 2. the table is large (or it contains many rows) 3. the value of the column is seldom NULL 4. the column is used often in a WHERE clause 5. the column is used often in a sort clause (ORDER BY) 6. the column is used often when multiple tables are joined together 7. the column is used often in a GROUP BY clause 8. the column, when used in a WHERE clause, does not have an arithmetic expression or function applied to it before the comparison operation is performed 9. updates to the values in that column are kept to a minimum 10. you know the optimizer is going to choose to use that index as opposed to performing a full table scan"
Back
Which date function returns the ending date of the month containing a given date?
Front
LAST_DAY. The syntax of the LAST_DAY function is LAST_DAY(date)
Back
"What is the advantage of writing a multitable INSERT command that will insert rows from table_a into either tablex, tabley, or tablez based upon some condition, as opposed to executing three separate INSERT statements to insert rows one table at a time?"
Front
Performance. The multitable INSERT needs to make only one pass of the data in table_a to get the job done.
Back
What is the primary difference between an index organized table and a regular (heap) table?
Front
"In the index organized table, the rows are physically stored in order by the primary key. "
Back
"If the column order_date has a datatype of date, what would be the value of order_date + 7?"
Front
"Exactly one week after the order date, at the same time of day."
Back
What valid character does Oracle recommend you NOT use for table names?
Front
"The $ character. Because data dictionary tables contain a $ character, using $ in a table name makes it hard to distinguish between a data dictionary object and a user-created object."
Back
When would you use an ORDER BY clause in a subquery?
Front
to perform Top-n Analysis
Back
What are the first two words in the command used to disable a constraint on the column called id on the emp table?
Front
ALTER TABLE
Back
What are the four group functions that can only be used with numeric datatypes?
Front
"SUM, AVG, VARIANCE, and STDDEV"
Back
Which data dictionary view would you query to display objects you can access either by privileges explicitly granted to you or by privileges granted to PUBLIC?
Front
ALL_COL_PRIVS_RECD
Back
"If you have two WHEN conditions in an INSERT statement, what keyword will ensure the insertion is completed after evaluating only one WHEN condition?"
Front
FIRST
Back
"Which function compares two expressions, returning NULL if the expressions are equal and returning the first expression if the expressions are not equal?"
Front
the NULLIF function
Back
"For the statement SELECT * FROM emp WHERE dept_id = (SELECT id FROM dept WHERE dept_name = 'ACCTG'); to execute properly, how many id values should the subquery return?"
Front
one
Back
Which statement do you use to assign a privilege to a user or role?
Front
the GRANT statement
Back
Which statement can be used to alter a view?
Front
CREATE OR REPLACE VIEW
Back
"What type of sort should be done in order to list the 10 highest paid employees in the table, starting with the highest paid person?"
Front
Descending
Back
Which statement removes rows in a table but can be rolled back?
Front
DELETE
Back
What would be the most common reason for an error message if you attempted to drop a primary key constraint on a table?
Front
"The reason for the error would be that the column that had the primary key constraint on it was also acting as the parent in a parent / child relationship. Consequently there is a column in another table which is acting as the child in that relationship, and is pointing (via a foreign key constraint) to the column containing the primary key constraint. The primary key constraint ensures that the parent column in this parent/child relationship is unique, so Oracle prevents you from removing it. If duplicate values were allowed in the primary key column, there could be multiple parents for the same child, a violation of basic database design. "
Back
When using Oracle proprietary join syntax which clause of the SELECT statement represents the join criteria?
Front
the WHERE clause
Back
You can update or delete rows in a table based on rows in another table by including what within your DML statements?
Front
subqueries
Back
What would you use to force the order of evaluation of set operators in a compound query?
Front
parentheses
Back
Can a row be both the child and parent of a given row?
Front
No
Back
"What command could a user issue such that the default format of dates, when displayed as output, are not in the typical dd-Mon-yy format?"
Front
ALTER SESSION
Back
Which type of outer join will include all rows from both tables being joined?
Front
a full outer join
Back
Which two functions can be used to pad a character string to the right or left with a specified character?
Front
the RPAD and LPAD functions
Back
How many ORDER BY clauses are allowed in a compound query?
Front
only one
Back
Which statement removes a sequence from the data dictionary?
Front
DROP SEQUENCE sequence_name;
Back
"When creating a table, column definitions can be omitted if what is used?"
Front
"the AS subquery clause (CTAS, CREATE TABLE AS SELECT)"
Back
Which statement removes an index from the data dictionary?
Front
DROP INDEX indexname;
Back
"What is the effect of using the GROUP BY and ROLLUP keywords in the statement GROUP BY expr1, ROLLUP(expr2, expr3)?"
Front
The subtotals calculated will be all the various combinations of expr2 and expr3 while expr1 stays fixed.
Back
"The NVL2 function accepts three expressions, and returns the second expression if the first expression is ______."
Front
"NOT NULL. If the first expression is null, the third expression is returned."
Back
Which statement would you use to create a nonunique index on a table?
Front
the CREATE INDEX statement
Back
"If an UPDATE statement contains a SELECT statement as a subquery, can the subquery contain both a GROUP BY and a HAVING clause?"
Front
Yes
Back
"When a commit occurs, what happens to existing savepoints?"
Front
All savepoints are erased when a commit occurs.
Back
Are the names of the columns in SELECT lists in a compound query required to be the same?
Front
No. The names of columns can be different. The number and datatypes must be compatible.
Back
Which statement creates a marker in the current transaction to allow you to rollback only a portion of the changes within the transaction?
Front
SAVEPOINT. The syntax is SAVEPOINT name;
Back
Which type of constraint enforces a relationship between the column and another column in the same or a different table?
Front
FOREIGN KEY
Back
"When modifying a sequence, which sequence numbers are affected?"
Front
only future sequence numbers
Back
Which keyword used with group functions causes the function to only consider unique values?
Front
DISTINCT
Back
What is another name for an outer query?
Front
the main query
Back
What is the relationship between the number of groups created by the ROLLUP operation and the number of grouping columns specified in the SELECT clause?
Front
The number of groups created by the ROLLUP operation is one more than the number of grouping columns specified.
Back
Section 4
(50 cards)
"In an INSERT statement, how can you specify that a NULL value is to be inserted into a column?"
Front
omit the column in the column list OR explicitly include the NULL keyword in the INSERT statement's VALUES clause
Back
Which two SQL statements add rows of data to an existing table?
Front
the INSERT and MERGE statements
Back
"When the MIN group function is used with a DATE column, which date is displayed?"
Front
the earliest date
Back
What is the default number of decimal places for the ROUND number function?
Front
"Zero. When the integer representing the number of decimal places is not provided, the ROUND function rounds to zero decimal places (i.e., to the nearest whole number)."
Back
What is the regular expression that could be used to confirm that a given account code is properly formatted?
Front
...
Back
"Valid account codes are seven characters and follow this format:
Front
Character 1: Upper or lowercase A Character 2: Any alpha, but always lowercase Characters 3 - 6: digits (0 thru 9) Character 7: an uppercase M or another digit " '^[Aa][[:lower:]][[:digit:]]{4}[M[:digit:]]$'
Back
"Evaluating MOD(20,3) returns what value?"
Front
2
Back
What two keywords in a hierarchical query establishes the relationship between a parent and a child?
Front
CONNECT BY
Back
Which clause of the SELECT statement constrains columns that use the GROUPING functions?
Front
the HAVING clause
Back
Which option can you include with the CREATEVIEW statement to prevent DML through the view?
Front
"The WITH READ ONLY option of the CREATE VIEW statement prevents any DML operations such as inserts, updates, and deletes from being performed on the view's underlying or base table(s) when using the view."
Back
Which function could be used to return a date without the time portion?
Front
"The TRUNC date function returns a date with the time portion of the day truncated to the specified format unit. If no 'fmt' (format model) is provided, the date is truncated to the nearest day. The syntax of the TRUNC date function is TRUNC(date, 'fmt')."
Back
"To remove a constraint from a table, which clause of the ALTER TABLE statement should you use?"
Front
The DROP clause. The syntax is ALTER TABLE tablename DROP PRIMARY KEY | UNIQUE (column) | CONSTRAINT constraintname [CASCADE];
Back
How many PRIMARY KEY constraints can be defined on a table?
Front
only one
Back
Which clause in a MERGE statement precedes the INSERT statement?
Front
WHEN NOT MATCHED THEN
Back
Which type of join joins all rows in one table to all rows of another table?
Front
a Cartesian product or cross join
Back
"When the MAX group function is used with a NUMBER column, which number is displayed?"
Front
the largest number
Back
"When a GROUP BY clause and no ORDER BY clause is used, in what order does the Oracle server implicitly sort the results?"
Front
in ascending order by the first grouping column
Back
"If the same column name appears in more than one table in a join condition, by what must the column name be prefixed?"
Front
by the table name or a table alias
Back
What should you do to eliminate the need for all database users to qualify an object name with its schema name?
Front
Create a public synonym using CREATEPUBLIC SYNONYM syn_name FOR obj_name;
Back
"When you create an External Table in your schema, can you specify the tablespace in which this table will be stored?"
Front
"No, the actual rows of an External Table are stored as a file in the Operating System."
Back
"What two constraints, when created, also cause an index to be created?"
Front
PRIMARY KEY and UNIQUE
Back
What element of the SELECT FROM emp WHERE salary > ( SELECT 2 MAX(bonus_amt) FROM bonus); query assures that the subquery will return exactly one value?
Front
The group function MAX in the subquery.
Back
What is the name of the function which allows you to determine the exact GROUP BY level when using any of the GROUPING functions?
Front
GROUPING_ID
Back
"If no column list is specified in an INSERT statement, your VALUES clause must list the values in what order?"
Front
the order in which the columns are specified in the table
Back
How can a subquery make reference to a table in the main query?
Front
Through the use of a table alias.
Back
Which type of join is represented by the use of an operator other than an equality operator (=)?
Front
a non-equijoin
Back
Outer join conditions CANNOT use which logical operator?
Front
the IN logical operator
Back
"When using the TO_CHAR function to format dates, what does MON in a format model display?"
Front
the three-letter month abbreviation using three capital letters
Back
"For most small tables, ______ are faster than index searches."
Front
full table scans
Back
Unique indexes are automatically created on columns that have which two types of constraints?
Front
UNIQUE and PRIMARY KEY
Back
"To insert data through a simple view, must you include all NOT_NULL columns that do not have a default value assigned in the view definition?"
Front
Yes
Back
"In which specific area of database administration are the keywords CUBE, ROLLUP, and GROUPING SETS are most often used?"
Front
Data Warehousing
Back
How many primary keys can be in any given table?
Front
Either 0 or 1
Back
"If no schema is explicitly included in a CREATE TABLE statement, where is the table created?"
Front
in the current user's schema
Back
Which option of the CREATESEQUENCE statement allows the sequence to continue to generate values after the maximum sequence value has already been generated?
Front
the CYCLE option
Back
Which pseudocolumn can be used with a sequence to display the current value of that sequence?
Front
CURRVAL
Back
Which regular expression function can be used with a CHECK constraint on a column of a table in order to insure the specific format of the data entered for that column?
Front
REGEXP_LIKE
Back
"Which category of SQL statement includes the INSERT, UPDATE, DELETE, and MERGE statements?"
Front
DML
Back
How do group functions handle NULL values?
Front
Group functions ignore NULL values.
Back
Which two constructs can be used to emulate an IF-THEN-ELSE condition within a SELECT statement?
Front
the DECODE function and the CASE expression
Back
How do you grant UPDATE privileges on specific columns in a table?
Front
"Include a column list in the GRANT statement. This syntax is only valid with the UPDATE, REFERENCES, and INSERT privileges."
Back
How do you create an inline view?
Front
include a subquery as a data source in a FROM clause
Back
"To join n tables together using Oracle proprietary join syntax, how many join conditions are needed in the WHERE clause?"
Front
n - 1
Back
"If the statement SELECT * FROM emp WHERE UPPER(last_name) = :x; was executed many times in your application, what would you consider doing to improve performance?"
Front
Build a function based index on UPPER(last_name).
Back
What is the maximum number of decimal positions you can specify for a timestamp datatype?
Front
9
Back
"What value will be returned by this regular expression? REGEXP_COUNT('AEioUIOUAEiOU','Ei',2,i)"
Front
2
Back
What type of information is stored in the database regarding an External Table and where is that information stored?
Front
"the metadata, which is stored in the data dictionary"
Back
Which clause can you include in a CREATEVIEW statement to ensure that DML operations that would change the result of the view are not allowed?
Front
WITH CHECK OPTION
Back
Which category of SQL statements control access/permission to the data?
Front
"DCL statements, such as GRANT and REVOKE, control access to data."
Back
Will the query SELECT * FROM emp WHERE salary = commission; display rows in which the salary and the commission are both NULL?
Front
"No. If two values are both NULL, they are not equal to each other. Because you don't know the values for salary or commission, there is not enough information to tell whether the condition is TRUE or FALSE. Therefore, the condition evaluates to a logical NULL. Rows in which the WHERE clause evaluates to NULL or FALSE are not displayed when you issue a SELECT."
Back
Section 5
(50 cards)
"Which metacharacter, when used in a SQL regular expression, represents a match to any character in the database character set?"
Front
the period (.)
Back
Which pseudocolumn retrieves the next available sequence value?
Front
NEXTVAL
Back
What type or category of commands is MERGE?
Front
DML
Back
"SELECT title, author, pub_date FROM books WHERE author IN (SELECT name FROM classics WHERE genre = 'ROMANCE'); "
Front
...
Back
"If you are not the DBA, which privilege must you have to create a public synonym on another user's table?"
Front
the CREATE PUBLIC SYNONYM privilege
Back
Can subqueries contain group functions?
Front
Yes
Back
"Which DML statement updates rows conditionally, based on whether a row already exists or not?"
Front
the MERGE statement
Back
Which operator would immediately precede a subquery if that subquery can potentially return more than one row?
Front
IN
Back
Explain the difference between disabling and dropping a constraint.
Front
"A constraint than has been disabled still exists but is not enforced. It can be reenabled a later time. If a constraint is dropped, it will need to be recreated should you need it again."
Back
Outer join conditions CANNOT be linked to another condition by which operator?
Front
the OR operator
Back
"In order to issue a TRUNCATETABLE statement successfully, you must either own the table or have which privilege?"
Front
the DROPANYTABLE system privilege
Back
A subquery that returns a single row of data is known as which type of subquery?
Front
a single-row subquery
Back
Can you modify data through a view that contains a GROUP BY clause?
Front
"No, you also CANNOT modify data if the view contains group functions, the DISTINCT keyword, or the ROWNUM pseudocolumn."
Back
Which option of a CREATEVIEW statement creates the view regardless of whether the underlying tables exist?
Front
the FORCE option
Back
Can any user who owns an object grant object privileges for that object?
Front
Yes
Back
"What does the format of my_string have to be in order for the WHERE clause in the following query to evaluate to TRUE? SELECT * FROM dual WHERE REGEXP_LIKE(my_string,'^[a-z]+$');"
Front
one or more all alphabetic lowercase characters
Back
Rules enforced at the table level concerning acceptable data which can be entered into a table are called what?
Front
constraints
Back
"What is the benefit to setting a column that you no longer want in your table to UNUSED, rather than just dropping the column?"
Front
"Improved performance. Dropping a column is usually labor intensive, so it is delayed until off hours. If you mark the column unused, Oracle adjusts the data dictionary to logically indicate the column and its data are no longer there. Then, during a period of little activity such as the evening, the physical drop can take place and its effect on the users will be minimal."
Back
What's the advantage of using IN rather than = in the following query?
Front
Multiple values could be returned by the subquery without causing the statement to fail.
Back
What form of the INSERT statement will insert all rows from a table into two or more other tables?
Front
INSERTALL
Back
Must a HAVING clause be preceded by a GROUP BY clause?
Front
"No, a HAVING clause can be listed first, but it is usually placed after the GROUP BY clause."
Back
What two values can the GROUPING function return if the argument is a single column?
Front
0 or 1
Back
Which one of the regular expression functions returns a Boolean value?
Front
REGEXP_LIKE
Back
What pseudocolumn name is available for use in a hierarchical query which permits you to control the number of generations in the hierarchy which should be selected for output?
Front
LEVEL
Back
Which privilege must a user be granted to be able to change another user's password?
Front
the ALTER USER privilege
Back
"If today is March 12, 2012, under what conditions will the statement SELECT to_date('12-Mar-2012') sysdate FROM dual; produce the number 0 for its output?"
Front
When it was executed at exactly midnight.
Back
"When no WHERE clause is specified in a DELETE statement, which rows are deleted?"
Front
all the rows in the table
Back
Which function adds or subtracts months from a given date?
Front
"ADD_MONTHS. The syntax of the ADD_MONTHS function is ADD_MONTHS(date, n), where n is a positive or negative integer."
Back
Which option of the ALTER TABLE statement would you use to mark one or more columns in a table as being obsolete so that they may be dropped later?
Front
SET UNUSED. The syntax is ALTER TABLE tablename SET UNUSED (column);
Back
Updates are not allowed through a view if the view definition includes columns that are defined by what?
Front
expressions
Back
Which three functions convert case for character strings?
Front
"UPPER, LOWER, and INITCAP. The UPPER character function converts mixed case or lowercase value to uppercase, LOWER converts mixed or uppercase to lowercase, and INITCAP converts a character string to a value with the first character uppercase and the remaining lowercase."
Back
Which type of queries ask for the n largest or smallest values of a given column?
Front
Top-n queries
Back
Which clause in a SQL expression will enable a single statement to calculate all possible combinations of aggregations?
Front
GROUP BY CUBE
Back
"What command will create a new table which has a similar structure to an existing table, and also include all or some of the rows from that original table?"
Front
Create Table As Select (CTAS)
Back
Which system privilege allows a user to connect to the database?
Front
CREATE SESSION
Back
A WHERE clause condition that uses < ALL will return all records where the value is ______.
Front
a value less than the minimum returned by the subquery
Back
Can more than one row be inserted into the table at a time if the INSERT statement has a subquery instead of a VALUES clause?
Front
Yes
Back
Which datatype is a hexadecimal string representing the unique address of a row in its table?
Front
ROWID
Back
Name three TCL statements.
Front
"COMMIT, ROLLBACK, and SAVEPOINT"
Back
Which clause in an UPDATE statement specifies the rows that will be updated?
Front
the WHERE clause
Back
"What function and arguments would modify the way the hire_date is displayed in a SELECT statement such that hire_date values appear formatted in this way: January 27, 2006?"
Front
"to_char(hire_date, 'fmMonth dd, yyyy')"
Back
Which option of the CREATESEQUENCE or ALTERSEQUENCE statement indicates the largest value that the sequence can generate?
Front
MAXVALUE n
Back
"When a column is dropped using the DROPCOLUMN clause of the ALTER TABLE statement, which columns are physically dropped?"
Front
the specified column and any other columns of that table that have been marked as UNUSED are dropped
Back
Which SELECT statement clause allows you to limit which groups are displayed?
Front
a HAVING clause
Back
Which function can be used to determine the number of months between two dates?
Front
"MONTHS_BETWEEN. The syntax of the MONTHS_BETWEEN function is MONTHS_BETWEEN(date1, date2)"
Back
"If no GROUP BY clause or WHERE clause is included in a simple SELECT statement, what would the COUNT(*) function return?"
Front
the number of rows in the table
Back
In which set operator are duplicate rows included in the result set?
Front
UNION ALL
Back
Which set operator returns all the results from two queries after eliminating any duplicates?
Front
UNION
Back
What keyword(s) in a SQL SELECT can be used instead of the keyword CUBE in order to calculate just the aggregations you need from the GROUP BY clause?
Front
GROUPING SETS
Back
Which SELECT statement clause restricts included rows prior to grouping?
Front
a WHERE clause
Back
Section 6
(50 cards)
Which comparison operator is used when matching character patterns?
Front
the LIKE operator
Back
"According to operator precedence, which of the three logical operators is evaluated first?"
Front
"NOT is evaluated first. The order of precedence for logical operators is NOT, AND, and OR."
Back
"When testing each row in the emp table to determine whether any employee doesn't have an email, how should the WHERE clause be written if you want the information about those employees who don't have an email to be displayed?"
Front
the IS NULL comparison operator
Back
Which datatype holds variable-length character data?
Front
VARCHAR2
Back
"If no ORDER BY clause is included in a SELECT statement, how are the results sorted?"
Front
"The order of the results will be unpredictable. Each time the query is run, the order in which the rows are displayed may be different."
Back
Does one DML statement constitute a complete database transaction?
Front
"No, one DDL or DCL statement constitutes a complete database transaction, but a transaction can contain more than one DML statement."
Back
"When implementing a natural join, must columns with the same names have compatible datatypes?"
Front
Yes
Back
"If you have a five column list with the CUBE extension, how many combinations would be created in the result set?"
Front
25 or 32 combinations
Back
What would you use in an INSERT statement instead of a VALUES clause to copy rows from one table to another?
Front
a subquery
Back
"In a SELECT statement, subqueries are often used in which clause to return values for an unknown conditional value?"
Front
a WHERE clause
Back
What are the two requirements of expressions in a SELECT list in a compound query?
Front
the expressions must match in number and in datatype
Back
Which function replaces a NULL value with a specified value?
Front
NVL
Back
Which type of operators should be used with queries that return only one row?
Front
"Single-row operators. Single-row operators expect only one value and include =, >, >=, <, <=, <>, and LIKE."
Back
"When using the LIKE operator, which option must you include to use the percent (%) and underscore (_) characters as literal values?"
Front
The ESCAPE option identifies a special escape character that when preceding these characters causes them to be interpreted literally.
Back
Name three functions that can be used with group functions to replace NULL values.
Front
"NVL, NVL2, and COALESCE"
Back
Which datatype includes a time zone displacement value that allows Oracle to return data to the client in the user's local session time zone?
Front
TIMESTAMP WITH LOCAL TIME ZONE
Back
Which datatype stores a length of time in months and years?
Front
INTERVAL YEAR TO MONTH
Back
Which two sets of join keywords create a join that will include unmatched rows from the first table specified in the SELECT statement?
Front
LEFT OUTER JOIN and FULL OUTER JOIN
Back
Which comparison operator compares a value to every value returned by a subquery?
Front
ALL
Back
Which SQL capability is demonstrated when two or more tables are linked with a WHERE clause?
Front
joining
Back
What are functions that operate on sets of rows to give one result per group called?
Front
"group functions, or aggregate functions"
Back
Which statement removes all rows from a table while releasing all or most of the storage space used by the table?
Front
the TRUNCATETABLE statement
Back
"If an INSERT statement has a subquery instead of a VALUES clause, what criterion will allow the statement to execute successfully relative to the INSERT and the SELECT?"
Front
The number and datatype of the columns returned by the SELECT must match the number and datatype of columns the INSERT is expecting.
Back
What is the default sort order when using an ORDER BY clause?
Front
ascending
Back
Which SQL capability allows you to control the number of columns returned by a query by choosing the columns in the SELECT clause?
Front
projection
Back
What privilege(s) is required to drop a view?
Front
ownership of the view or the DROPANY VIEW system privilege
Back
In what order are nested functions evaluated?
Front
from the innermost function to the outermost function
Back
Which type of constraint can only be specified at the column level?
Front
NOT NULL
Back
Can a column alias be used in a GROUP BY clause?
Front
No
Back
Which option must you include in a GRANT statement if you intend for the user to grant this privilege to other users?
Front
WITH GRANT OPTION
Back
"SELECT * FROM dual WHERE REGEXP_LIKE(my_name, '^(R|B)ob(ert)?');"
Front
...
Back
Which option of the ROLLBACK statement should you include to roll back only the changes after a particular savepoint?
Front
TO SAVEPOINT. The syntax is ROLLBACK TO SAVEPOINT name;
Back
"If you fail to name a constraint, what will Oracle name the constraint?"
Front
"SYS_Cn, where n is an integer making the constraint name unique in that schema"
Back
In which clause of a SELECT statement can a column alias NOT be used?
Front
A column alias CANNOT be used in a WHERE clause.
Back
Which statement would you use to delete a synonym?
Front
DROP SYNONYM synonym_name;
Back
"In a hierarchical query, is it possible for a row to have more than one immediate ancestor?"
Front
No
Back
Which group function would you use to determine the number of rows that meet a certain condition?
Front
COUNT(*)
Back
"Does the MERGE statement allow you to insert, update, and delete rows from a table?"
Front
Yes
Back
Which SQL capability allows you to choose rows in a table to be returned by a query?
Front
selection
Back
"What are two possible literal names that, if assigned to the variable my_name in the following expression, would return a Boolean TRUE?"
Front
"Robert, Bob"
Back
What are the two operators that are functionally equivalent to the <> operator?
Front
!= and ^=
Back
Which three functions allow you to perform explicit datatype conversions?
Front
"TO_CHAR, TO_DATE, and TO_NUMBER"
Back
The CASCADE CONSTRAINTS option of the REVOKE statement removes any constraints made to the object using which privilege?
Front
REFERENCES (foreign key constraints)
Back
"In a SELECT list, what character should enclose date and character literal values?"
Front
single quotation marks (')
Back
Which set operator returns all the results from two queries without eliminating any duplicates?
Front
UNION ALL
Back
The <> (not equal) comparison operator can only be used with which type of subquery?
Front
a single-row subquery
Back
Which statement ends the current transaction by disregarding all pending changes?
Front
ROLLBACK
Back
"Which character function returns a portion of a character string, beginning at a specified character position up to a specified length?"
Front
"SUBSTR. The syntax of the SUBSTR function is SUBSTR(column|expression, m [, n])"
Back
"In nested functions, which pairs of parentheses are evaluated first?"
Front
The innermost pair of parentheses will be evaluated first.
Back
"When using the TO_CHAR function to format dates, which format model element will display the numeric day number of the month?"
Front
DD or dd
Back
Section 7
(31 cards)
Which comparison operator identifies values that are equal to or larger than a particular value?
Front
>= (greater than or equal to)
Back
"According to operator precedence, are OR conditions evaluated before AND conditions?"
Front
"No, AND conditions are evaluated before OR conditions."
Back
"When using the IS NULL operator, which Boolean value is returned when a NULL value exists?"
Front
TRUE
Back
Which operator compares a value to a specific list of values?
Front
the IN operator
Back
"When testing each row in the emp table to determine whether the employee has an email, how should the WHERE clause be written?"
Front
WHERE email is NULL
Back
Which clause of a SELECT statement sorts the result rows?
Front
the ORDER BY clause
Back
What could you include in a SELECT clause to select all of the columns in a table?
Front
an asterisk (*)
Back
Can you sort by a column that is NOT included in the SELECT list?
Front
"Yes, you can include a column in the ORDER BY clause even if it is not included in the SELECT list."
Back
Which construct specifies a different heading for a column in a SELECT list?
Front
a column alias
Back
"In the SELECT clause of a SQL statement, what is the term for the list of one or more columns to be returned by the query?"
Front
the SELECT list
Back
Which operator combines two character strings yielding one combined character string?
Front
|| (the concatenation operator)
Back
"Which SQL*Plus command displays the structure of a table, view, materialized view, synonym, or the specifications of a specified function or procedure?"
Front
the DESC[RIBE] command
Back
What character should separate columns in the SELECT list?
Front
commas
Back
What value will always be returned in comparisons between nulls and other values?
Front
an unknown value (or NULL)
Back
Which value will the NOT logical condition return when the condition following it is false?
Front
TRUE
Back
Which keyword overrides the default sort order in an ORDER BY clause?
Front
DESC
Back
What must you do to create a column alias containing spaces?
Front
"Enclose the column alias in double quotes ("")"
Back
Which keyword when used in a SELECT clause returns only the unique values or combination of values for the column(s) that follow?
Front
DISTINCT
Back
"When the DESC keyword is included in an ORDER BY clause, where will NULL values be displayed?"
Front
first
Back
Which logical operator separating two conditions will return TRUE when at least one of two conditions is true?
Front
OR
Back
Which clause of a SELECT statement includes a condition to restrict the rows returned by the query?
Front
the WHERE clause
Back
"When using a LIKE condition to perform pattern matching, what does an underscore represent?"
Front
any single character
Back
Which comparison operator allows you to compare a value to a range of values?
Front
the BETWEEN... AND operator
Back
Which clause of a SELECT statement specifies the name of the table or tables being queried?
Front
the FROM clause
Back
Which logical condition returns TRUE when both of the conditions are met and returns FALSE if either condition is FALSE?
Front
AND
Back
Arithmetic expressions that include a NULL value always evaluate to what value?
Front
NULL
Back
Using compound OR conditions is functionally equivalent to using which operator?
Front
the IN operator (assuming the subject of each of the OR clauses is the same)
Back
What is the result of 3 + 2 * 5?
Front
"13. Multiplication has higher precedence than addition, so 2 * 5 is evaluated first."
Back
"When sorting by multiple columns in an ORDER BY clause, in what sequence are the sorts performed?"
Front
from left to right
Back
"When using a LIKE operator, if the escape character appears in the pattern before the '%' or '_', how does Oracle interpret the character?"
Front
"the character is interpreted literally in the pattern, rather than as a special pattern-matching character"