






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Which statement removes all rows from a table while releasing all storage space used by the table? correct answer: the TRUNCATE TABLE statement Outer join conditions CANNOT use which logical operator? correct answer: the IN logical operator What must you do to create a column alias containing spaces? correct answer: Enclose the column alias in double quotes ("). If within a transaction, a single DML statement fails, what is rolled back? correct answer: only the offending DML statement Which statement ends the current transaction by disregarding all pending changes? correct answer: ROLLBACK When performing a self join, what must be used to qualify table names? correct answer: table aliases When using the IS NULL operator, which Boolean value is returned when a null value exists? correct answer: TRUE Which clause of a SELECT statement sorts the result rows? correct answer: the ORDER BY clause Which comparison operator allows you to compare a value to a range of values? correct answer: the BETWEEN... AND operator In a SELECT statement, subqueries are often used in which clause to return values for an unknown conditional value? correct answer: a WHERE clause What is the syntax of the TRUNC date function? correct answer: TRUNC(date, 'fmt') To remove a constraint from a table which clause of the ALTER TABLE statement should you use? correct answer: The DROP clause. The syntax is: ALTER TABLE tablename DROP PRIMARY KEY | UNIQUE (column) | CONSTRAINT constraintname [CASCADE]; Which type of outer join includes all matched rows and all unmatched rows in the second table listed? correct answer: a right outer join
When adding a DATE datatype and a NUMBER datatype, which datatype is the result? correct answer: a DATE datatype How do you create an inline view? correct answer: include a subquery as a data source in a FROM clause Which four group functions can only be used with numeric datatypes? correct answer: SUM, AVG, VARIANCE, and STDDEV Which two constraints can be used to emulate an IF-THEN-ELSE condition within a SELECT statement? correct answer: the DECODE function and the CASE expression When using the TO_CHAR function to format dates, which format model element will display the numeric day of the month? correct answer: DD Which two types of statements cause an autocommit to occur? correct answer: DCL and DDL statements Which keyword used with group functions causes the function to only consider unique values? correct answer: DISTINCT If no schema is explicitly included in a CREATE TABLE statement, where is the table created? correct answer: in the current user's schema Which type of join joins all rows in one table to all rows of another table? correct answer: a cross join The CREATE, ALTER, DROP, RENAME, and TRUNCATE statements are examples of which type of SQL statement? correct answer: DDL The ADD clause of the ALTER TABLE statement is used to do what? correct answer: add a column or constraint to a table Can a group function be included in a HAVING clause? correct answer: Yes Which operator combines two character strings to yield one combines character string? correct answer: | | (the concatenation operator) Which type of constraint can only be specified at the column level? correct answer: NOT NULL The <> (not equal) comparison operator can only be used with which type of subquery? correct answer: a single-row subquery When testing for null values in a SQL statement, which comparison operator should you use? correct answer: the IS NULL comparison operator
Does one DML statement constitute a complete database transaction? correct answer: No, one DDL or DCL statement constitutes a complete database transaction, but a transaction can contain more than one DML statement. Outer join conditions CANNOT be linked to another condition by which operator? correct answer: the OR operator Arithmetic expressions that include a NULL value will always evaluate to which value? correct answer: NULL Which SELECT statement clause restricts included rows prior to grouping? correct answer: a WHERE clause Which DML statement updates rows conditionally, based on whether a row already exists? correct answer: the MERGE statement Which two sets of join keywords create a join that will include unmatched rows from the first table specified in the SELECT statement correct answer: LEFT OUTER JOIN and FULL OUTER JOIN Which statement permanently removes all data in a table, the structure of the table, and its associated indexes? correct answer: the DROP TABLE statement Which option of the ROLLBACK statement should you include to rollback only the changes after a particular savepoint? correct answer: TO SAVEPOINT. The syntax is: ROLLBACK TO SAVEPOINT name; Which logical operator or keyword separates the two individual conditions of a compound condition if that compound condition returns a value of TRUE even when we know for sure that only one of the who individual conditions is TRUE? correct answer: OR Which option of a CREATE VIEW statement creates the view regardless of whether the underlying tables exist? correct answer: the FORCE option An index created on multiple columns in a table is called what? correct answer: a composite or concatenated index Which SELECT statement clause allows you to limit which groups are displayed? correct answer: a HAVING clause The NVL2 function accepts three expressions, and returns the second expression if the first expression is _____. correct answer: NOT NULL. If the first expression is null, the third expression is returned.
Which SQL*Plus command displays the structure of a table, view, materialized view, synonym, or the specifications of a specified function or procedure? correct answer: the DESC[RIBE] command What datatype would be used to store binary data on an external file? correct answer: BFILE Which type of join containing an equality operator joins two tables by a column that contains a matching value? correct answer: an equijoin Which keyword overrides the default sort order in an ORDER BY clause? correct answer: DESC Which type of join joins two tables by all columns that have the same name in both tables? correct answer: a natural join A multiple-row operator expects how many values? correct answer: one or more What is the name of the concept that guarantees that users have a consistent view of the data? correct answer: read consistency Unique indexes are automatically created on columns that have which two types of constraints? correct answer: UNIQUE and PRIMARY KEY When a GROUP BY clause contains multiple columns, which grouping is the most major grouping? correct answer: the first column listed in the GROUP BY clause If you fail to name a constraint, what will Oracle name the constraint? correct answer: SYS_Cn, where n is an integer making the constraint name unique Reversing the order of the SELECT statements when using the INTERSECT operator has what effect on the results? correct answer: It will not affect the results. For most small tables, _____ are faster than index searches. correct answer: full table scans Which character function returns a portion of a character string, beginning at a specified length? correct answer: SUBSTR. The syntax of the SUBSTR function is: SUBSTR(column|expression, m [, n]) What would you use to force the order of evaluation of set operators in a compound query? correct answer: parentheses A ____ value must either be null or match an existing value in the parent table. correct answer: foreign key Which DML statement only adds rows to a table? correct answer: INSERT
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. Must the names of the columns in SELECT lists in a compound query be the same? correct answer: No. The names of columns can be different. 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 correct answer: the DEFAULT keyword Which group function calculates a standard deviation for a group of values? correct answer: STDDEV How many digits to the right of the decimal point are allowed for a column defined as NUMBER (7,3)? correct answer: three (3) A SELECT statement that is embedded in another SELECT statement is called what? correct answer: a subquery When modifying a sequence, which sequence numbers are affected? correct answer: only future sequence numbers If a composite primary key is required, the PRIMARY KEY constraint must be defined at what level? correct answer: the table level Which function can be used to determine the number of months between two dates? correct answer: MONTHS_BETWEEN. The syntax of the MONTHS_BETWEEN function is MONTHS_BETWEEN (date1, date2) Which clause of a SELECT statement specifies the name of the table or tables being queried correct answer: the FROM clause What are the two requirements of expressions in a SELECT list in a compound query? correct answer: the expressions must match in number and in datatype Which option for a column in a CREATE TABLE statement indicates the value that the column should be given if no value is explicitly specified on an INSERT statement? correct answer: the DEFAULT option Which statement would you use to define a default value for an existing column? correct answer: ALTER TABLE. You would also use the ALTER TABLE statement to add, modify, or drop columns. Rules enforced at the table level are called what? correct answer: constraints Which statement permanently removes rows in a table and can be rolled back? correct answer: DELETE
By default, how is the output of the UNION set operator sorted? correct answer: It is sorted ascending in the order of the columns in the first SELECT list. Which operator compares a value to a specific list of values? correct answer: the IN operator Evaluating MOD (20,3) returns what value? correct answer: 2 Which type of constraint specifies that the column on which the constraint is defined CANNOT contain a null value? correct answer: NOT NULL When using an ORDER BY clause in a compound query, where should you place the clause? correct answer: at the end of the statement If the same column name appears in more than one table in a join condition, by what must the column name be prefixed? correct answer: by the table name or a table alias Can subqueries contain group functions? correct answer: Yes When no WHERE clause is specified in a DELETE statement, which rows are deleted? correct answer: all the rows in the table Which type of SQL statement includes the INSERT, UPDATE, and MERGE statements? correct answer: DML statements Which type of operators should be used with queries that return only one row? correct answer: Single-row operators. Single-row operators expect only one value and include =, >, >=, <, <=, <>, and LIKE. Which set operator returns all the results from two queries after eliminating any duplicates? correct answer: UNION Which type of constraint enforces a relationship between the column and another column in the same or a different table? correct answer: FOREIGN KEY Which clause of a SELECT statement does Oralce server evaluate last? correct answer: the ORDER BY clause When the MAX group function is used with a NUMBER column, which number is displayed? correct answer: the largest number Which type of outer join will include all rows from both tables being joined? correct answer: a full outer join What would you use in an INSERT statement instead of a VALUES clause to copy rows from one table to another? correct answer: a subquery
What are the two operators that are functionally equivalent to the <> operator? correct answer:! = and ^= Which SELECT statement clause creates an equijoin by specifying a column name common to both tables? correct answer: a USING clause Which function replaces a null value with a specified value? correct answer: NVL Which construct specifies a different heading for a column in a SELECT list? correct answer: a column alias What happens when the = operator is used with a multiple-row subquery? correct answer: An ORA-01427: single-row subquery returns more than one row error occurs. When using the TO_CHAR function to format dates, what does MON in a format model display? correct answer: the three-letter month abbreviation To issue a TRUNCATE TABLE statement successfully, you must own the table or which privilege? correct answer: the DROP ANY TABLE system privilege Which statement explicitly makes all pending data modifications permanent? correct answer: the COMMIT statement Which character function returns an occurrence of one string of characters within a column value or expression? correct answer: INSTR. The syntax of the INSTR function is: INSTR (column|expression, 'string' [, m] [, n]) Which option of the ALTER TABLE statement would you use to mark one or more columns in a table as obsolete so that they may be dropped later? correct answer: SET UNUSED. The syntax is: ALTER TABLE tablename SET UNUSED (column); Comparisons between nulls and other values always return what value? correct answer: an unknown value When using Oracle proprietary join syntax, what operator would you use in a WHERE clause to produce an outer join? correct answer: (+) 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? correct answer: DY
In an INSERT statement, how can you specify for null values to be inserted into a column? correct answer: Either omit the column in the column list, or explicitly include the NULL keyword in the INSERT statement's VALUES clause What should you do to eliminate the need for all database users to qualify an object name with its schema name? correct answer: Create a public synonym using CREATE PUBLIC SYNONYM syn_name FOR obj_name; Which SELECT statement clause can be used with the JOIN keyword to perform a natural join but limit the columns for the join condition correct answer: a USING clause Which set operator returns only the results of the first query that are not in the second query? correct answer: MINUS Which three functions allow you to perform explicit datatype conversions? correct answer: TO_CHAR, TO_DATE, and TO_NUMBER How do you create a sequence that generates descending sequence values? correct answer: Specify a negative value in the INCREMENT BY clause. For example, INCREMENT BY - would generate sequential descending values. To join n tables together using Oracle proprietary join syntax, how many join conditions are needed in the WHERE clause? correct answer: n - 1 Which two functions can be used to pad a character string to the right or left with a specified character? correct answer: the RPAD and LPAD functions Which statement would you use to change the name of a table, view, sequence, or synonym? correct answer: RENAME. The syntax is: RENAME old_name to new_name; Which type of queries ask for the n largest or smallest values of a given column? correct answer: Top-n queries Which comparison operators can be used with multiple-row subqueries? correct answer: In, ANY, and ALL Which set operator returns all the results from two queries without eliminating any duplicates? correct answer: UNION ALL When using a LIKE condition to perform patter matching, what does an underscore (_) represent? correct answer: any single character Which function adds or subtracts months from a given date? correct answer: ADD_MONTHS.