【Oracle学习】 OCP-071 练习题中
Q101.
Which three statements are true about a self join?
A. It must be an inner join.
B. It must be an equijoin.
C. The query must use two different aliases for the table.
A synonym can have a synonym.
A synonym has an object number. Any user can create a public synonym.
All private synonym names must be unique in the database. A synonym can be created on an object in a package.
D.
E.
F.
Answer:CDF
Q102.
Which two statements are true about the results of using the intersect operator in compound queries?
The on clause can be used. The on clause must be used. It can be an outer join.
A.
B.
C.
D.
E.
Answer:CD
Q103.
Which two statements are true about the order by clause when used with a sql statement containing a set operator such as union?
intersect ignores nulls.
Reversing the order of the intersected tables can sometimes affect the output. Column names in each select in the compound query can be different.
intersect returns rows common to both sides of the compound query.
The number of columns in each select in the compound query can be different.
A. column positions must be used in the order by clause.
B. The first column in the first select of the compound query with the union operator is used
by default to sort output in the absence of an order by clause.
C.
D.
E.
Answer:BD
Q104.
Which three statements are true about Data Manipulation Language (DML)?
Each select statement in the compound query must have its own order by clause.
only column names from the first select statement in the compound query are recognized.
Each select statement in the compound query can have its own order by clause.
A.
B.
C.
D.
E.
column.
Answer:ABE
Q105.
Examine the description of the transactions table: Examine the description of the transactions table:
delete statements can remove multiple rows based on multiple conditions. insert statements can insert nulls explicitly into a column.
insert into. . .select. . .from statements automatically commit.
DML statements require a primary key be defined on a table.
update statements can have different subqueries to specify the values for each updated
Name
TRANSACTION_ID
TRANSACTION_DATE
AMOUNT
CUSTOMER_ID
Which two SQL statements execute successfully?
TYPE VARCHAR2(6)
DATE NUMBER(10,2)
VARCHAR2(6)
NULL? NOT NULL
A. SELECT customer_id AS "CUSTOMER-ID", transaction_date AS DATE, amount+100 "DUES" from transactions;
B. SELECT customer_id AS 'CUSTOMER-ID',transaction_date AS DATE, amount+100 'DUES' from transactions;
C. SELECT customer_id CUSTID, transaction_date TRANS_DATE,amount+100 DUES FROM transactions;
D. SELECT customer_id AS "CUSTOMER-ID", transaction_date AS "DATE", amount+100 DUES FROM transactions;
E. SELECT customer id AS CUSTOMER-ID, transaction_date AS TRANS_DATE, amount+100 "DUES AMOUNT"
FROM transactions;
Answer:CD
Q106.
What is true about non-equijoin statement performance?
A.
B.
C.
D.
E.
Answer:CE
Q107.
Which two statements are true regarding the UNION ALL operators?
The between condition always performs less well than using the >= and <= conditions. The Oracle join syntax performs better than the SQL: 1999 compliant ANSI join syntax. The join syntax used makes no difference to performance.
The between condition always performs better than using the >= and <= conditions. Table aliases can improve performance.
A.
B.
C.
D.
E.
Answer:AD
Q108.
Which three are true about multiple INSERT statements?
NULLS are not ignored during duplicate checking.
Duplicates are eliminated automatically by the UNION ALL operator
The names of columns selected in each SELECT statement must be identical.
The number of columns selected in each SELECT statement must be identical The output is sorted by the UNION ALL operator.
A.
B.
C.
D.
E.
F.
Answer:ABD
Q109.
Which three are true about privileges and roles? A. A role is owned by the user who created it.
They can be performed only by using a subquery. They can be performed on relational tables.
They can be performed on views.
They can be performed on remote tables.
They can be performed on external tables using SQL*Loader. They can insert each computed row into more than one table.
B. System privileges always set privileges for an entire database.
C. All roles are owned by the SYS schema.
D. A role can contain a combination of several privileges and roles.
E. A user has all object privileges for every object in their schema by default. F. PUBLIC can be revoked from a user.
G. PUBLIC acts as a default role granted to every user in a database
参考 Answer::DEG
Answer:DEG
Q110.
Which two are true about granting privilege on objects?
A) An object privilege can be granted to a role only by the owner of that object
B) An object privilege can be granted to other users only by the owner of that object C) The owner of an object acquires all object privilege on that object by default
D) A table owner must grant the REFERENCES privilege to allow other users to create FOREIGN KEY constraints using that table
E) The WITH GRANT OPTION clause can be used only by DBA users
Answer:CD
Q111.
Which two are true about the data dictionary?
A. Base tables in the data dictionary have the prefix DBA_.
B. All user actions are recorded in the data dictionary.
C. The data dictionary is constantly updated to reflect changes to database objects, permissions, and data.
D. All users have permissions to access all information in the data dictionary by default
E. The SYS user owns all base tables and user-accessible views in the data dictionary. Answer:CE
Q112.
Which two statements are true about the rules of precedence for operators?
A. Arithmetic operators with equal precedence are evaluated from left to right within an expression.
B. Multiple parentheses can be used to override the default precedence of operators in an expression.
C.
D.
E. expression. Answer:AB Q113.
The + binary operator has the highest precedence in an expression in a SQL statements. NULLS influence the precedence of operators in an expression.
The concatenation operator || is always evaluated before addition and subtraction in an
You execute this command:
ALTER TABLE employees SET UNUSED (department_id); Which two are true?
A. A query can display data from the DEPARTMENT_ID column.
B. The storage space occupied by the DEPARTMENT_ID column is released only after a
COMMIT is issued.
C.
D.
E.
F. Answer:DE Q114.
The DEPARTMENT_ID column is set to null for all tows in the table
A new column with the name DEPARTMENT_ID can be added to the EMPLOYEES table.
No updates can be made to the data in the DEPARTMENT_ID column. The DEPARTMENT_ID column can be recovered from the recycle bin
Which three statements are true about time zones, date data types, and timestamp data types in an Oracle database?
A. The DBTIMEZONE function can return an offset from Universal Coordinated Time (UTC)
B. A TIMESTAMP WITH LOCAL TIMEZONE data type column is stored in the database using
the time zone of the session that inserted the row
C. A TIMESTAMP data type column contains information about year, month, and day
D. The SESSIONTIMEZONE function can return an offset from Universal Coordinated Time (UTC)
E. The CURRENT_TIMESTAMP function returns data without time zone information Answer:ABD
Q115.
Which three statements are true about the DESCRIBE command?
A.
B.
C.
D.
E.
F.
constraint.
Answer:ABD
Q116.
Which three are true about system and object privileges
A. WITH GRANT OPTION can be used when granting an object privilege to both users and roles
B. WITH GRANT OPTION cannot be used when granting an object privilege to PUBLIC
C. Revoking a system privilege that was granted with the WITH ADMIN OPTION has a cascading effect.
D. Revoking an object privilege that was granted with the WITH GRANT OPTION clause has a cascading effect
E. Adding a primary key constraint to an existing table in another schema requires a system privilege
F. Adding a foreign key constraint pointing to a table in another schema requires the REFERENCEs object privilege
Answer:DEF
Q117.
Which statement is true about aggregate functions?
A) The AVG function implicitly converts NULLS to zero.
B) The MAX and MIN functions can be used on columns with character data types
C) Aggregate functions can be used in any clause of a SELECT statement
D) Aggregate functions can be nested to any number of levels
Answer:B
Q118.
Which two statements are true about the ORDER BY clause?
A. Numeric values are displayed in descending order if they have decimal positions.
It can be used from SQL Developer.
It can be used to display the structure of an existing view. It can be used only from SQL*Plus.
It displays the NOT NULL constraint for any columns that have that constraint. It displays all constraints that are defined for each column.
It displays the PRIMARY KEY constraint for any column or columns that have that
B.
C.
D.
E.
Answer:CD
Q119.
Which three statements are true regarding single row subqueries?
Only columns that are specified in the SELECT list can be used in the ORDER BY clause. In a character sort, the values are case-sensitive.
Column aliases can be used in the ORDER BY clause.
NULLS are not included in the sort operation.
A.
B.
C.
D.
E.
F.
Answer:CDF
Q120.
Which three privileges can be restricted to a subset of columns in a table? A. ALTER
They must be placed on the left side of the comparison operator or condition. They must return a row to prevent errors in the SQL statement.
A SQL statement may have multiple single row subquery blocks.
They can be used in the HAVING clause.
They must be placed on the right side of the comparison operator or condition. They can be used in the clause.
B. REFERENCES C. UPDATE
D. SELECT
E. INDEX
F. INSERT
G. DELETE
Answer:BCF
Q121.
Which four statements are true about constraints on Oracle tables?
A.
B.
C.
D.
E.
F.
G. Answer:CDFG Q122.
A Column can have only one CHECK Constraint.
A NOT NULL Constraint can be defined at the table level. A UNIQUE constraint permits NULLS.
A PRIMARY KEY Constraint can be added after a table has been created and populated. A CHECK Constraint can refer to values in other rows.
A UNIQUE Constraint can use a pre-existing index on the constrained column or columns.
A FOREIGN KEY Column can contain NULLS.
Which statement is true about TRUNCATE and DELETE?
A. For large tables TRUNCATE is faster than DELETE.
B. For tables with multiple indexes and triggers is faster than TRUNCATE.
C. You can never TRUNCATE a table if foreign key constraints will be violated.
D. You can never tows from a table if foreign key constraints will be violated.
Answer:A
Q123.
Examine the description or the BOOKS_TRANSACTIONS table: Name Null? Type
CUST_ID
CUST_FIRST_NAME
CUST_LAST_NAME
CUST_CREDIT_LIMIT
FOR customers whose income level has a value, you want to display the first name and due amount as 5% of their
credit limit. Customers whose due amount is null should not be displayed.
Which query should be used?
A. SELECT cust_first_name, cust_credit_limit * . 05 AS DUE AMOUNT FROM customers
WHERE cust income_level !=NULL
AND cust credit_level !=NULL;
B. SELECT cust_first_name, cust_credit_limit * . 05 AS DUE AMOUNT FROM customers
WHERE cust income_level IS NOT NULL
AND due_amount IS NOT NULL;
C. SELECT cust_first_name, cust_credit_limit * . 05 AS DUE AMOUNT FROM customers
WHERE cust income_level <> NULL
AND due_amount <> NULL;
D. SELECT cust_first_name, cust_credit_limit * . 05 AS DUE AMOUNT FROM customers
WHERE cust_income_level IS NOT NULL
AND cust_credit_limit IS NOT NULL;
E. SELECT cust_first_name, cust_credit_limit * . 05 AS DUE AMOUNT FROM customers
WHERE cust income_level !=NULL
AND due_amount !=NULL;
Answer:D
Q124.
View the Exhibits and examine the structure of the COSTS and PROMOTIONS tables.
You want to display PROD IDS whose promotion cost is less than the highest cost PROD ID in a pro motion time interval.
Examine this SQL statement:
SELECT prod id
FROM costs
WHERE promo id IN
(SELECT promo id
FROM promotions
WHERE promo_cost < ALL
(SELECT MAX (promo cost)
FROM promotions
GROUP BY (promo_end date-promo_begin_date)) );
NOT Null NOT Null
NUMBER VARCHAR2 (20)
VARCHAR2 (30) NUMBER
What will be the result?
A. It executes successfully but does not give the required result.
B. It gives an error because the ALL keyword is not valid.
C. It gives an error because the GROUP BY clause is not valid
D. It executes successfully and gives the required result.
Answer:A
Q125.
Which three actions can you perform on an existing table containing date?
A.
B.
C.
D.
E.
F.
Answer:CEF
Q126.
Examine these statements executed in a single Oracle session: CREATE TABLE product (pcode NUMBER(2),pname VARCHAR2(20)); INSERT INTO product VALUES(1,'pen');
Add a new column as the table's first column.
Define a default value that is automatically inserted into a column containing nulls. Add a new NOT NULL Column with a DEFAULT value.
Change a DATE Column containing data to a NUMBER data type. Increase the width of a numeric column.
Change the default value of a column.
INSERT INTO product VALUES (2,'pencil');
INSERT INTO product VALUES(3,'fountain pen'); SAVEPOINT a;
UPDATE product SET pcode=10 WHERE pcode =1; COMMIT;
DELETE FROM product WHERE pcode =2; SAVEPOINT b;
UPDATE product SET pcode=30 WHERE pcode =3; SAVEPOINT c;
DELETE FROM product WHERE pcode =10; ROLLBACK TO SAVEPOINT b;
COMMIT;
Which three statements are true?
A.
B.
C.
D.
E.
F.
Answer:ACE
Q127.
Question:
View the Exhibit and examine the structure of the PRODUCTS table. Which two tasks require subqueries?
A. Display the total number of products supplied by supplier 102 which have a product
The code for pen is 10.
There is no row containing fountain pen. There is no row containing pencil.
The code for pen is 1.
The code for fountain pen is 3 There is no row containing pen
status of obsolete.
B. Display suppliers whose PROD_LIST_PRICE is less than 1000.
C. Display the number of products whose PROD_LIST_PRICE is more than the average PROD_LIST_PRICE.
D. Display the minimum PROD_LIST_PRICE for each product status.
E. Display products whose PROD_MIN_PRICE is more than the average PROD_LIST_PRICE of all products, and whose status is orderable.
Answer:CE
Q128.
Which two are true about multiple table INSERT statements?
A. They always use subqueries.
B. They can transform a row from a source table into multiple rows in a target table.
C. The conditional INSERT FIRST statement always inserts a row into a single table.
D. The conditional INSERT ALL statement inserts rows into a single table by aggregating
source rows.
E. The unconditional INSERT ALL statement must have the same number of columns in both the source and target tables.
Answer:AB
Q129.
Which three statements are true about inner and outer joins?
A.
B.
C.
D.
E.
F.
Answer:ACE
Q130.
Which three statements are true about built-in data types?
A. A VARCHAR2 blank-pads column values only if the data stored is non-numeric and contains no special characters.
A full outer join returns matched and unmatched rows.
A full outer join must use Oracle syntax.
Outer joins can be used when there are multiple join conditions on two tables.
Outer joins can only be used between two tables per query. An inner join returns matched rows.
A left or right outer join returns only unmatched rows.
The default length for a CHAR column is always one character.
A VARCHAR2 column definition does not require the length to be specified. A BLOB stores unstructured binary data within the database.
A CHAR column definition does not require the length to be specified. A BFILE stores unstructured binary data in operating system files.
B.
C.
D.
E.
F.
Answer:BDF
Q131.
Which three are true about the MERGE statement?
A. B. C. D. E.
It can merge rows only from tables.
It can use views to produce source rows.
It can combine rows from multiple tables conditionally to insert into a single table.
It can use subqueries to produce source rows.
It can update the same row of the target table multiple times.
F. It can update, insert, or delete rows conditionally in multiple tables. Answer:BDE
Q132.
Examine the description of the BOOKS table:
Name TRANSACTION_ID TRANSACTION_DATE AMOUNT CUSTOMER_ID
Null? NOT NULL
Type VARCHAR2(6)
The table has 100 rows.
Examine this sequence of statements issued in a new session;
INSERT INTO BOOKS VALUES (‘ADV112’ , ‘Adventures of Tom Sawyer’, NULL, NULL); SAVEPOINT a;
DELETE from books;
ROLLBACK TO SAVEPOINT a; ROLLBACK;
Which two statements are true?
A. The first ROLLBACK command restores the 101 rows that were deleted, leaving the inserted row still to be committed.
B. The second ROLLBACK command does nothing.
C. The first ROLLBACK command restores the 101 rows that were deleted and commits the
inserted row.
D. The second ROLLBACK command replays the delete. E. The second ROLLBACK command undoes the insert. Answer:AE
Q133.
Examine the description of the PRODUCTS table:
Name
PROD_ID
QTY
COST
Which two statements execute without errors?
A. MERGE INTO new_prices n
USING (SELECT * FROM products) p
WHEN MATCHED THEN
UPDATE SET n.price= p.cost* 01
WHEN NOT MATCHED THEN
INSERT(n.prod_id, n.price) VALUES(p.prod_id, cost*.01) WHERE(p.cost<200);
Null? NOT NULL
Type NUMBER(2)
NUMBER(5,2) NUMBER(8,2)
DATE VARCHAR2(6)
NUMBER(10,2)
B. MERGE INTO new_prices n
USING (SELECT * FROM products WHERE cost>150) p
ON (n.prod_id= p.prod_id)
WHEN MATCHED THEN
UPDATE SET n.price= p.cost.01
DELETE WHERE (p.cost<200);
C. MERGE INTO new_prices n
USING products p
ON (p.prod_id =n.prod_id)
WHEN NOT MATCHED THEN
INSERT (n.prod _id, n.price) VALUES (p.prod_id, cost.01)
WHERE (p.cost<200);
D. MERGE INTO new_prices n
USING (SELECT * FROM products WHERE cost>150) p
ON (n.prod_id= p.prod_id)
WHEN MATCHED THEN
DELETE WHERE (p.cost<200)
Answer:BD
Q134.
Which three statements are true about Structured Query Language (SQL)?
A.
B.
C.
D.
E.
F.
underlying physical data storage Answer:BCF
It guarantees atomicity, consistency, isolation, and durability (ACID) features It best supports relational databases
It is used to define encapsulation and polymorphism for a relational table
It requires that data be contained in hierarchical data storage
It is the only language that can be used for both relational and object-oriented databases
It provides independence for logical data structures being manipulated from the
Q135. Which two statements are true about truncate and delete?
A. the result of a delete can be undone by issuing a rollback
B. delete can use a where clause to determine which row(s) should be removed.
C. TRUNCATE can use a where clause to determine which row(s) should be removed. D. truncate leavers any indexes on the table in an UNUSABLE STATE.
E. the result of a truncate can be undone by issuing a ROLLBACK.
Answer:AB
Q136.
which three statements are true regarding single row subqueries?
A.
B.
C.
CONDITION.
D. they must be placed on the left side of the comparison operator or condition.
THEY CAN BE USED in the where clause.
A SQL STATEMENT MAY HAVE MULTIPLE SINGLE ROW SUBQUERY BLOCKS.
THEY MUST BE PLACED ON THE RIGHT SIDE OF THE COMPARISON OPERATOR OR
E. THEY CAN BE USED IN THE HAVING CLAUSE
F. they must return a row to prevent errors in the SQL statement. Answer:A B E
Q137. Which two statements are true about external tables?
A) Indexes can be created on them.
B) You can populate them from existing data in the database by using the CREATE TABLE AS SELECT command.
C) DML statements cannot be used on them.
D) Their data can be retrieved by using only SQL or PL/SQL.
E) Their metadata and actual data are both stored outside the database.
Answer:B C
.
Q138. Which three statements are true about views in an Oracle database?
A) The WITH CHECK clause prevents certain rows from being displayed when querying the view.
B) The WITH CHECK clause prevents certain rows from being updated or inserted.
C) Tables in the defining query of a view must always exist in order to create the view.
D) Date Manipulation Language (DML) can always be used on views
E) Deleting one or more rows using a view whose defining query contains a GROUP BY clause will cause an error.
F) Views can be updated without the need to re-grant privileges on the view.
G) Inserting one or more rows using a view whose defining query contains a GROUP BY clause will cause an error
Answer: BEF
Q139.
Which is the default column or columns for sorting output from compound queries using SET operators such as INTERSECT in a SQL statement?
A) The first column in the last SELECT of the compound query
B) The first NUMBER column in the first SELECT of the compound query
C) The first VARCHAR2 column in the first SELECT of the compound query
D) The first column in the first SELECT of the compound query
E) The first NUMBER or VARCHAR2 column in the last SELECTof the compound query Answer:D
Q140.
You issued this command: DROP TABLE hr. employees; Which three statements are true?
A) ALL constraints defined on HR, EMPLOYEES are dropped.
B) The HR. EMPLOYEES table may be moved to the recycle bin.
C) Synonyms for HR EMPLOYEES are dropped.
D) Sequences used to populate columns in the HR. EMPLOYEES table are dropped.
E) All indexes defined on HR, EMPLOYEES are dropped. F) Views referencing HR, EMPLOYEES are dropped. Answer:ABE
Q141.
You execute this query:
SELECT TO CHAR (NEXT_DAY(LAST_DAY(SYSDATE),’MON’ ),’ dd“Monday for” fmMonth rrr’) FROM DUAL;
What is the result?
A) It executes successfully but does not return any result.
B) It returns the date for the first Monday of the next month.
C) It generates an error.
D) It returns the date for the last Monday of the current month. Answer:B
Q142.
Which statement is true about the INTERSECT operator used in compound queries? A) It processes NULLS in the selected columns.
B) INTERSECT is of lower precedence than UNION or UNION ALL.
C) It ignores NULLS.
D) Multiple INTERSECT operators are not possible in the same SQL statement Answer:C
Q143.
Viev the Exhibit and examine the structure of the PRODUCT INFORMATION and INVENTORIEStables.
You have a requirement from the supplies department to give a list containing PRODUCT _ID,SUPPLIER ID,
and QUANTITY_ON HAND for all the products where in QUANTITY ON HAND is lessthan five. Which two SQL statements can accomplish the task? (Choose two)
A) SELECT product id, quantity on hand, supplier id
FROM product information
NATURAL JOIN inventories AND quantity .on hand < 5;
B) SELECT i. product id, i. quantity .on hand, pi. supplier_id FROM product_information pi JOIN inventories i
ON (pi. product. id=i. product id) AND quantity on hand < 5;
C) SELECT i. product_id, i. quantity_on hand, pi. supplier id
FROM product information pi JOIN inventories i USING (product id) AND quantity .on hand < 5;
D) SELECT i.product id, i. quantity on hand, pi. supplier id
FROM product information pi JOIN inventories i
ON (pi.product id=i. product id)WHERE quantity on hand < 5;
Answer:BD
Q144.
View the Exhibit and examine the structure of the ORDERS table.
The columns ORDER_MODE and ORDER TOTAL have the default values'direct “and respectively.
Which two INSERT statements are valid? (Choose two.)
A) INSERT INTO (SELECT order_id, order date, customer_id FROM orders)
VALUES (1, ‘09-mar-2007“,101);
B) INSERT INTO orders (order_id, order_date, order mode,customer_id, order_total) VALUES (1, TO_DATE (NULL),‘online‘,101, NULL) ;
C) INSERT INTO orders
VALUES (1, ‘09-mar-2007’, ‘online’,’ ’,1000);
D) INSERT INTO orders (order id, order_date, order mode, order_total)VALUES (1,‘10-mar- 2007’,’online’, 1000)
E) INSERT INTO orders VALUES(‘09-mar-2007’,DEFAULT,101, DEFALLT);
Answer:A E
Q145. Which statement is true regarding the SESSION_PRIVS dictionary view?
A) It contains the object privileges granted to other users by the current user session. В) It contains the system privileges granted to other users by the current User session. C) It contains the current system privileges available in the user session.
D) It contains the current object privileges available in the user session.
Answer:C
Q146.
View the Exhibit and examine the structure of the SALES, CUSTOMERS, PRODUCTS, and TIMES tables.
The PROD_ID column is the foreign key in the SALES table.Which references the PRODUCTS table.
Similarly,the CUST_ID and TIME_ID columns are Also foreign keys in the SALES table referencing the CUSTOMERS and TIMES tables, respectively.
Evaluate the following CREATE TABLE command:
CREATE TABLE new_sales(prod_id, I cust_id, order_date DEFAULT SYSDATE) AS SELECT I prod_id,cust_id,time_id FROM sales.
Which statement is true regarding the above command?
A) The NEW_SALES table would not get created because the DEFAULT value cannot be specified in the column definition.
B) The NEW_SALES table would get created and all the NOT NULL constraints defined on the specified columns would be passed to the new table.
C) The NEW_SALES table would not get created because the column names in the CREATE TABLE
command and the SELECT clause I do not match.
D) The NEW_SALES table would get created and all the FOREIGN
KEY constraints defined on the specified columns would be passed to the new table Answer:B
Q147.
Which two statements are true? (Choose two.)
A) The USER SYNONYMS view can provide information about private synonyms.
B) The user SYSTEM owns all the base tables and user-accessible views of the data dictionary.
C) All the dynamic performance views prefixed with V$ are accessible to all the database users.
D) The USER OBJECTS view can provide information about the tables and views created by the user only.
E) DICTIONARY is a view that contains the names of all the data dictionary views that the user can access.
Answer:A E
Q148.
You execute these commands:
SQL> DEFINE hiredate = ’01-APR -2011’;
SQL> SELECT employee_id, first_name, salary FROM employees WHERE hire date > &hiredate AND manager_id >&mgr_id;
For which substitution variables will you be prompted?
A) none
B) &hiredate and &mgr_id
C) only &hiredate.
D) only &mgr_id.
Answer:D
Q149.
Evaluate the following SQL statement
SQL>SELECT promo_id, prom _category FROM promotions WHERE promo_category=’Internet’ ORDER BY promo_id
UNION
SELECT promo_id, promo_category FROM Pomotions
WHERE promo_category = ‘TV’
UNION
SELECT promoid, promocategory FROM promotions WHERE promo category=’Radio’
Which statement is true regarding the outcome of the above query?
A) It executes successfully and displays rows in the descend ignore of PROMO CATEGORY B) It produces an error because positional, notation cannot be used in the ORDER BY clause with SBT operators.
C) It executes successfully but ignores the ORDER BY clause because it is not located at
the end of the
compound statement.
D It produces an error because the ORDER BY clause should appear only at the end of a compound query-that is, with the last SELECT statement.
Answer:D
Q150. Examine the command to create the BOOKS table. SQL> create table books(book id CHAR(6) PRIMARY KEY, title VARCHAR2(100) NOT NULL,
publisher_id VARCHAR2(4),
author_id VARCHAR2 (50));
The BOOK ID value 101 does not exist in the table.
Examine the SQL statement.
insert into books (book id title, author_id values
(‘101’,’LEARNING SQL’,’Tim Jones’)
A) It executes successfully and the row is inserted with a null PLBLISHER_ID.
B) It executes successfully only if NULL is explicitly
specified in the INSERT statement.
C) It executes successfully only NULL PUBLISHER_ID column name is added to the columns list in the INSERT statement.
D) It executes successfully onlyif NULL PUBLISHER ID column name is added to the columns list and NULL is explicitly specified In the INSERT statement.
Answer:A
Q151.Which two statements are true regarding a SAVEPOINT?
A) Rolling back to a SAVEPOINT can undo a CREATE INDEX statement. B) Only one SAVEPOINT may be issued in a transaction.
C) A SAVEPOINT does not issue a COMMIT
D) Rolling back to a SAVEPOINT can undo a TRUNCATE statement.
E) Rolling back to a SAVEPOINT can undo a DELETE statement Answer:: CE
Q52. Table ORDER_ITEMS contains columns ORDER_ID, UNIT_PRICE and QUANTITY, of data
type NUMBER
Statement 1:
SELECT MAX (unit pricequantity) "Maximum Order FROM order items;
Statement 2:
SELECT MAX (unit pricequantity "Maximum order" FROM order items GROUP BY order id; Which two statements are true?
A) Statement 2 returns only one row of output.
B) Both the statement given the same output.
C) Both statements will return NULL if either UNIT PRICE or QUANTITY contains NULL,
D) Statement 2 may return multiple rows of output.
E) Statement 1 returns only one row of output.
Answer:DE
Q53. The STORES table has a column START_DATE of data type DATE, containing the datethe row was inserted.
You only want to display details of rows where START_DATEis within the last 25 months.which WHERE clause can be used?
A) WHERE TO_NUMBER(start_date - SYSDATE)<=25
B) WHERE ADD_MONTHS (start__date , 25)<= SYSDATE
C) WHERE MONTHS_BETWEEN(SYSDATE, start_date)<=25
D) WHERE MONTHS_BETWEEN (start_date, SYSDATE)<=25 Answer:C
Q154.View the exhibit and the examine the description of the tables.
Which three statements are true?
A) A customer can exist in many countries.
B) The statement will fail if a row already exists in the SALES table for product 23.
C) The statement will fail because subquery may not be I contained in a values clause.
D) The SALES table has five foreign keys,
E) The statement will execute successfully and a new row will be inserted into the SALES table. F) A product can have a different unit price at different times
Answer:D E F
Q155. Examine the description of the MEMBERS table;
SELECT city,last_name LNAME FROM members ...
You want to display all cities that contain the string AN. The cities must be returned in ascending order, with the last names further sorted in descending order. Which two clauses must you add to the query?
A) ORDER BY 1,2.
B) ORDER BY last_name DESC,city ASC
C) CORADER BY 1, LNAME DESC
D) WHERE city=’%AN%;
E) WHERE city LIKE ’%AN%; F) WHERE city IN (’%AN%’) Answer:C E
Q156. An Oracle database server session has an uncommitted transaction in progress which updated 5000 rows in a table.
In which three situations does the transact ion complete thereby committing the updates? A) When the session logs out is successfully
B) When a DBA issues a successful SHUTDOWN IMMEDIATE statement and the user then issues a COMMIT
C) When a CREATE INDEX statement is executed successfully in same session
D) When a COMMIT statement is issued by the same user from another session in the same database instance
E) When a CREATE TABLE AS SELECT statement is executed unsuccessfully in the same session F) When a DBA issues a successful SHUTDOWN TRANSACTIONAL statement and the user, then issues a COMMIT:
Answer:A C F?
Q157. Which two actions can you perform with object privileges? A) Create roles.
B) Delete rows from tables in any schema except sys.
C) Set default and temporary tablespaces for a user.
D) Create FOREIGN KEY constraints that reference tables in other schemas. E) Execute a procedure or function in another schema.
Answer: BD
Q158. Which three actions can you perform by using the ALTER TABLE command? A) Drop pseudo columns from a table.
B) Restrict all DML statements on a table.
C) Drop all columns simultaneously from a table.
D) Lock a set of rows in a table CE Rename a table. E) Rename a table
F) Enable or disable constraints on a table. Answer:DEF
?
Q159. Examine the description of the PROMOTIONS TABLE:
You want to display the unique is promotion costs in each promotion category. Which two queries can be used?
A) SELECT DISTINCT promo_category, promo_cost FROM
promotions ORDER BY 1;
B) SELECT promo_cost, promo_category FROM promotions ORDER BY 1
C) SELECT promo_category, DISTINCT promo_cost FROM promotiong ORDER BY 2:
D) select DISTINCT promo_categoryIl ‘has’||promol_cost as COSTS FROM promotions ORDER BY 1:
E) SELECT DISTINCT promo_cost ||’in’IIDISTINCT promo_category promotions Answer:A D
Q160. Examine this statement:
SELECT1 AS id,‘ John’ AS first_name, NULL AS commission FROM dual INTERSECT
SELECT 1,’John’ null FROM dual ORDER BY 3;
What is returned upon execution?[
A) 2 rows
B) 0 rows
C) An error
D) 1ROW Answer:D
Q161. Examine the description of the sales table.
The sales table has 55,000 rows. Examine this statements:
ORDER BY1:
Which two statements are true?
A) SALES1 has PRIMARY KEY and UNIQUE constraints on any selected columns which had those constraints in the SALES table.
B) SALES1 created with 55, 000 rows
C) SALES1 created with no rows.
D) SALES1 created with 1 row.
E) SALES1 has NOT NULL constraints on any I selected columns which had those constraints I in the SALES table.
Answer:B E
Q162.Which three are true about subqueries?
A.A subquery can be used in a WHERE clause.
B.A subquery can be used in a HAVING clause.
C.=ANY can only evaluate the argument against a subcjuery if it returns two or more values. D.
Answer:ABF
Q163..No user-defined locks are used in your database.
Which three are true about Transaction Control Language (TCL)?
A.COMMIT erases all the transaction^ savepoints and releases its locks.
B.COMMIT ends the transaction and makes all its changes permanent.
C.ROLLBACK without the TO SAVEPOINT clause undoes all the transaction's changes but does
not
release its locks.
D.ROLLBACK to SAVEPOTNT undoes the transaction's changes made since the named savepoint and
then ends the transaction.
E.ROLLBACK without the TO SAVEPOINT clause undoes alt the transaction's changes, releases its
locks, and erases all its savepoints.
F.ROLLBACK without the TO SAVEPOINT clause undoes all ttie transaction's changes but does not
erase its savepoints.
Answer:ABE
Q164.Which two are true about creating tables in an Oracle database?
A.A create table statement can specify the maximum number of rows the table will contain. B.The same table name can be used for tables in different schemas.
C.A system privilege is required.
D.Creating an external table will automatically create a file using the specified directory and file name.
E.A primary key constraint is manadatory.
Answer:BC
Q165.Which two are true about unused columns?
A.CASCADE constraints must be specified when setting a column tx> unused if that column is
referenced In a constraint on another column.
B.If you set all the columns of a table to unused, the table is automatically dropped.
C.You can query the data dictionary to see the names of unused columns.
D.You can specify multiple column names in an ALTER TABLE...SET unused statement. E.Setting an indexed column to unused results in an error.
Answer:AD
Q166.Which two join conditions in a from clause are non-equijolns?
A.table1 JOIN table2 on (tablet.column between table2.column 1 and table2.column2) B.JOIN table2 ON(table!.column >= table2.column)
C.table1 NATURAL JOIN table2
D. table1 JOIN table2 USING(columnl, column2)
E.tablet join table2 ON (tablet.column = table2.column) where table2.column)WHERE table2.column LIKE’A%’
Answer:AB
Q167.Examine this statement,which executes successfully: In which order are the rows displayed?
A.sorted by DEPARTMENT_NAME
B.sorted by DEPARTMENT_NAME and AVGSAL
C.sorted by DEPARTMENT_NAME and MAXSAL D.sorted by AVGSAL
E.Sorted by MAXSAL
Answer:D
Q168.
Examine this statement which executes successfully: Which statement will violate the CHECK constraint? A.UPDATE emp80
SET department_id=90
WHERE department_id=80;
B.DELETE FROM emp80
WHERE department_id=90;
C.SELECT *
FROM emp80
WHERE department_id=80;
D.SELECT *
FROM emp80
WHERE department_id=90;
Answer:A
Q169.
Which statement falls to execute successfully? A.SELECT *
FROM employees e
JOIN department d
WHERE e.department_id=d.department_id AND d.department_id=90;
B.SELECT *
FROM employees e
JOIN departments d
ON e.department_id=d.department_id WHERE d.department_id=90;
C.SELECT *
FROM employees e
JOIN departments d
ON e.department_id=d.department_id AND d.department_id=90;
D.SELECT *
FROM employees e
JOIN departments d
ON d.departments_id=90
WHERE e.department_id=d.department_id; Answer: D
Q170.Examine this list of queries: Which two statements are true? A.1 and 4 give the same result. B.2 returns the value 20.
C.2 and 3 give the same result. D.3 returns an error.
E.1 and 4 give different results. Answer:AB
Q171.
Which two statements are true about outer Joins?
A.The outer join operator (+) can be used on both sides of the join condition in an outer join. B.An outer join is used to retrieve only the rows that do not meet the join condition.
C.The IN operator cannot be used in a condition that Involves an outer join.
D. A condition representing an outer join cannot be linked to another condition using the or logical operator.
E.The outer join operator (+) is used next to the column of the table without the matching rows.
Answer:CD
Q172.Which two are true about virtual columns?
A.They can be referenced In the where clause of an update or debete statement.
B.They can be referenced in the set clause of an update statement as the name of the column To be updated.
C.They can be indexed.
D.They cannot have a data type explicitly specified.
E.They can be referenced in the column expression of another virtxial column.
Answer:AC
Q173.Which three are key components of an Entity Relationship Model? A.a table
B.an attribute
C.a unique identifier D.an activity
E.a relationship
F.an entity Answer:BEF
Q174.
Examine the description of EMPLOYEES table:
Which three queries return all rows for which SALARY+COMMISSION is greate than 20000? A.SELECT * FROM employees WHERE salary+NULLF(commission,0)>=20000;
B.SELECT * FROM employees WHERE salary+NVL2(commission,commission,0)>=20000; C.SELECT * FROM employees WHERE NVL2(salary)+commission,salary+commission, D.SELECT * FROM employees WHERE salary+NVL(commission,0)>=20000;
E.SELECT * FROM employees WHERE NVL(salary+commission,0)>=20000;
F.SELECT * FROM employees WHERE NVL(salary+commission,0)>==20000;
Answer:BCD
Q175.Which three are true about scalar subquery expressions?
A.A scalar subquery expression that returns zero rows evaluates to zoro B.They cannot be used in the values clause of an insert statement*
C.They can be nested.
D.A scalar subquery expression that returns zero rows evaluates to null. E.They cannot be used in group by clauses.
F.They can be used as default values for columns in a create table statement. Answer:CDE
Q176.Examine this statement which executes successfully:
Which three are true?
A.Regardless of salary,only if the employee id is less than 125,insert EMPLOYEE_ID,NANAGER_ID,SALARY into the MGR_HISTORY table.
B.If the salary is more than 20000 and the employee is less than 125,insert EMPLOYEE_ID and SALARY into the SPECIAL_SAL table.
C.Only if the salary is 20000 or less and the employee id is less than 125,insert EMPLOYEE_ID,MANAGER_ID,and SALARY into the MGR_HISTORY table.
D.Regardless of salary and employee id,insert EMPLOYEE_ID,MANAGER_ID,and SALARY into the
MGR_HISTORY table.
E.If the salary is 20000 or less and the employee id is less than 125,insert
EMPLOYEE_ID,HIRE_DATE,and SALARY into the SAL_HISTORY table.
F.Only if the salary is 20000 or less and the employee id is 125 or higher,insert EMPLOYEE_ID,MANAGER_ID,and SALARY into the MDR_HISTORY table. Answer:ABE
Q177.Examine this incomplete query:
SELECT DATA’2019-01-01’+
FROM DUAL;
Which three clauses can replace
B.INTERVAL’0,5’DAY
C.INTERVAL’12’ HOUR
D.INTERVAL’720’MINUTE
E.INTERVAL’0 12’DAY TO HOUR
F.INTERVAL’11:60’HOUR TO MINUTE
Answer:CDE
Q178.Which three are true?
A.LAST_DAY returns the date of the last day of the current ,month onlyu.
B.CEIL requires an argument which is a numeric data type.
C.ADD_MONTHS adds a number of calendar months to a date.
D.ADD_MONTHS works with a character string that can be implicitlyt converted to a DATE data
type.
E.LAST_DAY return the date of the last day the previous month only.
F.CEIL returns the largest integer less than or equal to a specified number.
G.LAST_DAY returns the date of the last day of the month for the date argument passed to the
function.
Answer:BCG
Q179.
Which three statements are true about performing DML operations on a view with no INSTEAD
OF triggers defined?
A.Insert statements can always be done on a table through a view.
B.The WITH CHECK clause has no effect when deleting rows from the underlying table through
the view.
C.Delete statements can always be done on a table through a view.
D.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.
E.Views cannot be used to query rows from an underlying table if the table has a PRIMARY KEY
and the primary key columns are not referenced in the defining query of the view.
F.Views cannot be used to add or modify rows in an underlying table If the defining query of the view contains the DISTINCT keyword.
Answer:DEF
Q180.Examine this list of requirements for a sequence: 1.Name:EMP_SEQ
2.First value returned:1
3.Duplicates are never permitted.
4.Provide values to be inserted into the EMPLOYEES.EMPLOYEE_ID COLUMN. 5.Reduce the chances of gaps in the values.
Which two statements will satisfy these requirements?
A.CREATE SEQUENCE emp_seq START WITH 1 INCRENENT BY 1 NOCACHE; B.CREATE SEQUENCE emp_seq START WITH 1 INCREMENT BY 1 CYCLE; C.CREATE SEQUENCE emp_seq NOCACHE;
D.CREATE SEQUENCE emp_seq START WITH 1 CACHE;
E.CREATE SEQUENCE emp_seq START WITH 1 INCREMENT BY 1 CACHE;
F.CREATE SEQUENCE emp_seq;
Answer:AC
Q181.Examine the description of the CUSTOMERS table:
Which three statements will do an implicit conversion?
A.SELECT * FROM customers WHERE insert_date=DATE’2019-01-01’;
B.SELECT * FROM customers WHERE customer_id=’0001’;
C.SELECT * FROM customers WHERE TO_DATE(insert_date)=DATE’2019-01-01’;
D.SELECT * FROM customers WHERE insert_date’01-JAN-19’;
E.SELECT * FROM customers WHERE customer_id=0001;
F.SELECT * FROM customers WHERE TO_CHAR(customer_id)=’0001’;
Answer:BCD
Q182.Which two are true about scalar subquery expressions?
A.You cannot correlate them with a table in the parent statement
B.You can use them as a default value for a column.
C..You must enclose them in parentheses.
D.They can return at most one row.
E.They can return two columns.
Answer:AC
Q183.Which two statements will return the names of the three employees with the lowest salaries?
A.SELECT last_name, salary
FROM employees
WHERE ROWNUM<=3
B.SELECT last_name,salary
FROM employees
ORDER BY salary
FETCH FIRST 3 ROWS ONLY;
C.SELECT last_name,salary
FROM employees
WHERE ROWNUM<=3
ORDER BY (SELECT salary FROM employees);
D.SELECT last_name,salary
FROM (SELECT * FROM employees ORDER BY salary)
E.SELECT last_name,salary
FROM employees
FETCH FIRST 3 ROWS ONLY
ORDER BY salary;
Answer:BD
Q184.Examine this description of the PRODUCTS table:
You successfully execute this command:
CREATE TALE new_prices(prod_id NUBER(2),price NUMBER(8,2)); Which two statements execute without errors?
A.MERGE INTO new_prices n
USING(SELECTFROM products)p
WHEN MATECHED THEN
UPDATE SET n.price=p.cost.01
WHEN NOT MATCHED THEN
INSERT(n.prod_id,n.price)VALUES (p.prod_id,cost01) WHERE(p.cost<200);
B.MERGE INTO new_prices n
USING(SELECTFROM product WHERE cost>150) p
ON (n.prod_id=p.prod_id)
WHEN NATCHED THEN
DELETE WHERE(p.cost<200)
WHEN NOT MATCHED THEN
INSERT (n.prod_id,n.price)VALUES (p.prod_id,p.cost.01); C.MERGE INTO new_prices n
USING (SELECT * FROM products WHERE cost>150) p
ON (n.prod_id=p.prod_id)
WHEN NATCHED THEN
UPDATE SET n.price=p.cost.01
DELETE WHERE (p.cost<200);
D.MERGE INTO new_prices n
USING products p
WHEN NOT NATCHED THEN
INSERT (n.prod_id, n.price)VALUES (p.prod_id,cost*.01)
WHERE (p.cost <200);
Answer:CD
Q185.You must find the number of employees whose salary is lower than employee 110. Which statement fails to do this?
A) SELECT COUNT ()
FROM employees
JOIN employees a
ON e. salary< a. salary WHERE a. employee_ id= 110; B) SELECT COUNT ( )
FROM employees
WHERE salary < (SELECT salary FROM employees WHERE employee 业 id =
- ;
C) SELECT COUNT ()
FROM employees e
JOIN (SELECT salary FROM employees WHERE employee_ id= 110) a
ON e. salary< a. salary;
D) SELECT COUNT ( )
FROM employees e
WHERE e. salary < (SELECT a. salary FROM employees a WHERE e. employee_ id = 110); Answer: D
Q186.Examine the CUSTOMER Id
10
20
30
40
50
Which two SELECT statements will return these results:
CUSTOMER_ NAME -------------------- Mandy
Mary
A) SELECT customer_ name FROM customers WHERE customer_ name LIKE ' % a % ’ ;
description of the CUSTOMERS table: CUSTOMER_ NAME
MARK Mandy Mary MARVIN MARTIN
B) SELECT customer_ name FROM customers WHERE customer name LIKE 'Ma%' ;
C) SELECT customer_ name FROM customers WHERE customer_ name='Ma';
D) SELECT customer_ name FROM customers WHERE UPPER (customer_ name ) LIKE 'MA. ; E) SELECT customer_ name FROM customers WHERE customer name LIKE 'Ma';
F) SELECT customer_ name FROM customers WHERE UPPER (customer name) LIKE 'MA&'; G) SELECT customer_ name FROM customers WHERE customer_ name KIKE .Ma';
Answer: AB
Q187.Examine the data in the EMPLOYEES table:
EMPLOYEE ID 101
102
103
LAST NAME MONTHLY SATARY MONTHLY COMMISSION PCT Kochhar 24000
Ernst 17000 .5
Rajs 21000 .2
Lorentz 25000
104
105
Which statement will compute the total annual compensation for each employee?
A)
SELECT last name,
(monthly salary*12) + (monthly_commission_pct * 12) AS
annual comp
FROM employees
;
B) SELECT last_ name (monthly_ salary+ monthly_ commission _ pct) *12 AS annual_ FROM employees ;
C) SELECT last name, (monthly_ salary 12) + (monthly_ salary * 12 * NVL
(monthly commission pct,0) ) As annual _ comp
FROM employees;
D) SELECT last_ name, monthly_ salary12) + (monthly_ salary * 12 * Monthly commission Pct) AS annual comp
FROM employees; Answer: C
Q188. Which three statements are true about an ORDER BY clause? A) An ORDER BY clause always sorts NULL values last.
B) An ORDER BY clause can perform a binary sort
C) An ORDER BY clause can perform a linguistic sort
D) By default an ORDERBY clause sorts rows in ascending order
E) An ORDR BY clause will always precede a HAVI NG clause if both are used in the same top- level
Answer: BCD
Q189. Which three statements are true about performing DML operations on a view with no Instead of triggers defined?
A. WITH CHECK clause has no effect when deleting rows from the underlying table through the view.
B. Insert statements can always be done on a table through a view.
C. 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.
D. Views cannot be used to add or modify rows in an underlying table if the defining query of the view contains the DISTINCT keyword.
E Delete statements can always be done on a table tough a view.
F Views cannot be used to query rows from an underlying table if the table has a PRIMARY KEY and the PRIMARY KEY columns are not referenced in the defining query of the view.
Answer: ABE
Q190. The SYSDATE function displays the current Oracle Server date as: 21 -MAY-19
You wish to display the date as:
MONDAY, 21 MAY, 201 9
Which statement will do this?
A) SELECT TO _ CHAR (SYSDATE, ' FMDAY, DD MONTH, YYYY') FROM DUAL; B) SELECT TO _ DATE (SYSDATE, ' FMDAY, DD MONTH, YYYY') FROM DUAL;
C) SELECT TO_ CHAR (SYSDATE, ' FMDD, DAY MONTH, YYYY') FROM DUAL;
D) SELECT TO_ CHAR (SYSDATE, ' FMDAY, DDTH MONTH, YYYY') FROM DUAL; Answer: D
Q191. Which two statements are true about * _ TABLES views?
A) You must have SELECT privileges on a table to view it in ALL TABLES.
B) You must have SELECT privileges on a table to view it in DBA TABLES.
C) USER TABLES displays all tables owned by the current user.
D) ALL TABLES displays all tables owned by the current user.
E) You must have SELECT privileges on a table to view it in USER TABLES.
F) All users can query DBA TABLES successfully.
Answer: AC
Q192. Which statement will return the last sequence number generated by the EMP_ SEQ sequence?
A) SELECT NEXTVAL FROM emp_ seq; B) SELECT CURRVAL FROM emp_ seq;
C) SELECT emp_ seq. CURRVAL FROM DUAL;
D) SELECT emp_ seq . NEXTVAL FROM DUAL; Answer: D
Q193. Which two statements are true about an Oracle database? A) A table can have multiple primary keys.
B) A table can have multiple foreign keys.
C) A NUMBER column without data has a zero value.
D) A column definition can specify multiple data types.
E) A VARCHAR2 column without data has a NULL value. Answer: BE
Q194. You execute these commands successfully: CREATE GLOBAL TEMPORARY TABLE invoices _ gtt ( customer id INTEGER,
invoice_ total NUMBER (10, 2)
) ON COMMIT PRESERVE ROWS;
INSERT INTO invoices_ gtt VALUES (1, 100); COMMIT;
Which two are true?
A) You can add a foreign key to the table.
B) When you terminate your session, the row will be deleted.
C) To drop the table in this session, you must first truncate it.
D) You can add a column to the table in this session.
E) Other sessions can view the committed row. Answer: CE
Q195. You own table DEPARTMENTS, referenced by views, indexes, and synonyms.
Examine this command which executes successfully:
DROP TABLE departments PURGE;
Which three statements are true?
A) Neither can it be rolled back nor can the DEPARTMENTS table be recovered. B) It will remove all views that are based on the DEPARTMENTS table.
C) It will delete all rows from the DEPARTMENTS table, but retain the empty table. D) It will remove the DE PARTMENTS table from the database.
E) It will remove all synonyms for the DEPARTMENTS table.
F) It will drop all indexes on the DEPARTMENTS table.
Answer: ADF
Q196. Which two are true about the USING clause when joining tables?
A) All column names in a USING clause must be qualified with a table name or table alias.
B) It can never be used with onatural join.
C) It is used to specify an equijoin of columns that have the same name in both tables. D) It can never be used with a full outer join.
E) It is used to specify an explicit join condition involving operators. Answer: AD
Q197. Examine the data in the PRODUCTS table:
PROD ID 101
102
103
PROD NAME PROD LIST CATEGORY ID Plate 10 1
Cup 20 1
Saucer 20 1
104
105
Examine these queries:
Knife 30 1 Fork 30 1
1.SELECT prod name, prod list
FROM products
WHERE prod 1ist NOT IN(10,20) AND category _id=1;
- SELECT prod name, | prod _ list
FROM products
WHERE prod list < > ANY (10,20) AND category id= 1; SELECT prod name, prod _ list
FROM products
WHERE prod list <> ALL (10, 20) AND category _ id= 1; Which queries generate the same output?
A)1and3 B)1,2,and3 C)2and3 D)1and2 Answer: D
Q198. Which two are true about self joins?
A) They are always equijoins.
B) They require the NOT EXISTS operator in the join condition. C) They have no join condition.
D)They can use INNER JOIN and LEFT JOIN.
E) They require table aliases.
F) They require the EXISTS opnrator in the join condition. Answer: AD
Q199.Examine this description of the EMP table:
Name
EMPNO
ENAME
SAL
DEPTNO
You execute this query:
SELECT deptno AS "departments", SUM (sal) AS "salary" FROM emp
GROUP | BY 1
HAVING SUM (sal)> 3 000;
Null? NOT NULL
Type NUMBER (4)
VARCHAR2 (10) NUMBER (7, 2)
NUMBER (2)
What is the result?
A) only departments where the total salary is greater than 3000, returned in no particular order
B) all departments and a sum of the salaries of employees with a salary greater than 3000 C) an error
D) only departments where the total salary is greater than 3000, ordered by department Answer: C
Q200. Which two queries return the string Hello! we're ready? A) SELECT q'! Hello! We're ready! 'FROM DUAL;
B) SELECT "Hello! We're ready "FROM |DUAL;
C) SELECT q'[Hello! We're ready]'FROM DUAL;
D) SELECT 'Hello! we\ re ready' ESCAPE'N'FROMDUAL:
E) SELECT 'Hello! We're ready' FROM DUAL;
Answer: AC