Quiz
Oracle Crusher
Create a free account to finish this quiz
Save your progress and see your final score.
Already have an account? Sign in
Questions in this quiz (17)
1A view and a synonym are created as follows:
create view dept_v as select * from dept;
create synonym dept_s for dept_v;
Subsequently the table DEPT is dropped. What will happen if you query the synonym DEPT_S?- AThere will not be an error if you first recompile the view with the command ALTER VIEW DEPT_V COMPILE FORCE;
- BThere will be an error because the view will be invalid
- CThere will be an error because the view will be dropped implicitly when the table was dropped.
- DThere will not be an error because the synonym addresses the view, which still exists, but there will be no rows returned
- EThere will be an error because the synonym will be invalid
2Which two statements are true regarding the DELETE and TRUNCATE commands?
- ADELETE can be used to remove only rows from multiple tables at a time
- BDELETE can be used to remove only rows from only one table at a time
- CDELETE and TRUNCATE can be used on a table that is a parent of a referential integrity constraint having ON DELETE rule
- DDELETE can be used to remove data from specific columns as well as complete rows
- EDELETE can be used only on a table that is a parent of a referential integrity constraint
3Which actions are allowed on a table that is marked as read-only?
- ADropping a table
- BTruncating a table
- CInserting new data
- DDropping a constraint
- EDropping an index
4User JOHN updates some rows but does not commit the changes. User ROOPESH queries the row that JOHN updated.
Which of the following statements is true?- AROOPESH will see the state of the data as it was when JOHN last created a SAVEPOINT.
- BROOPESH will be able to see the new values, but only if he logs in as JOHN.
- CROOPESH will not be able to see the rows because they will be locked.
- DROOPESH will see the old versions of the rows
5The user Alice wants to grant all users query privileges on her DEPT table. Which SQL statement accomplishes this?
- AGRANT select ON dept
TO ALL_USERS - BGRANT QUERY ON dept
TO ALL_USERS - CGRANT select ON dept
TO ALL - DGRANT select ON dept
TO PUBLIC
- AGRANT select ON dept
6Which comparison operator cannot be used with multiple-row subqueries?
- AAll the above can be used
- BNOT IN
- CANY
- DALL
- EIN
7SELECT COUNT(DISTINCT SUBSTR(first_name, 1,1))
FROM employees;- AA single-row function nested inside a group function is now allowed
- BThe GROUP BY clause is required to successfully run this query
- CThe query will execute successfully without any modifications
- DRemoving the DISTINCT qualifier will fix the error in the query
8Which two statements are true regarding single row functions?
(Choose two.)- AThey accept only a single argument
- BThey can be nested only to two levels
- CThey can return a data type value different from the one that is referenced
- DArguments can only be column values or constant
- EThey always return a single result row for every row of a queried table
9View the Exhibit and examine the structure of the PRODUCTS table. You want to display only those product names with their list prices where the list price is at least double the minimum price.
The report should start with the product name having the maximum list price satisfying this condition.
Evaluate the following SQL statement:
SQL>SELECT prod_name, prod_list_price
FROM products
WHERE prod_list_price >= 2 * prod_min_price
Which ORDER BY clauses can be added to the above SQL statement to get the correct output?
(Choose all that apply.)
Table PRODUCTS
prod_id NUMBER(6) NOT NULL
prod_name VARCHAR2(50) NOT NULL
prod_list_price NUMBER(8,2) NOT NULL- AORDER BY prod_name DESC, prod_list_price DESC;
- BORDER BY prod_list_price DESC, prod_name;
- CORDER BY prod_name, (2*prod_min_price)DESC;
- DORDER BY (2*prod_min_price)DESC, prod_name;
- EORDER BY prod_list_price DESC, prod_name DESC;
10Consider the following three SQL statements. Choose the most appropriate option.
1. DELETE FROM CITY WHERE CNT_CODE = 1;
2. DELETE CITY WHERE CNT_CODE = 1;
3. DELETE (SELECT * FROM CITY WHERE CNT_CODE = 1);- AStatements 1 and 2 will produce the same result; statement 3 will produce a different result.
- BStatements 1, 2, and 3 will produce different results.
- CStatements 1 and 2 will produce the same result; statement 3 will error out.
- DStatements 1, 2, and 3 will produce the same result.
11You need to display the first names of all customers from the customers table that contain the character 'e' and have the character 'a' in the second last position.
Which query would give the required output?- ASELECT cust_first_name
FROM customers
WHERE INSTR(cust_first_name, 'e')<>0 AND
SUBSTR(cust_first_name, -2, 1) = 'a'; - BSELECT cust_first_name
FROM customers
WHERE INSTR(cust_first_name, 'e')<>'' AND
SUBSTR(cust_first_name, -2, 1) = 'a'; - CSELECT cust_first_name
FROM customers
WHERE INSTR(cust_first_name, 'e') IS NOT NULL AND
SUBSTR(cust_first_name, -2, 1) = 'a'; - DSELECT cust_first_name
FROM customers
WHERE INSTR(cust_first_name, 'e')<> 0 AND
SUBSTR(cust_first_name, LENGTH(cust_first_name), -2) = 'a';
- ASELECT cust_first_name
12Which component is configured at database startup and cannot be dynamicall
- AJava pool
- BShared pool
- CStreams pool
- DRedo log buffer
- ENone of the above
13Top N analysis requires _____ and _____.
(Choose two.)- Athe use of rowid
- Bonly an inline view
- Can ORDER BY clause
- Da GROUP BY clause
- Ean inline view and an outer query
14Study these statements:
CREATE TABLE tab1 (c1 NUMBER(1), c2 DATE);
ALTER SESSION SET nls_date_format='dd-mm-yy';
INSERT INTO tab1 VALUES (1.1,'31-01-07');
Will the insert succeed?
(Choose the best answer)- AThe insert will succeed
- BThe insert will fail for both reason A and B
- CThe insert will fail because the 1.1 is too long
- DThe insert will fail because the '31-01-07' is a string, not a date
15View the Exhibit to examine the description for the SALES table. Which views can have all DML operations performed on it?
Table SALES
prod_id NUMBER NOT NULL
cust_id NUMBER NOT NULL- ACREATE VIEW v2
AS SELECT prod_id, cust_id, time_id FROM SALES
WHERE time_id <= SYSDATE – 2*365
WITH CHECK OPTION; - BCREATE VIEW v1
AS SELECT * FROM SALES
WHERE time_id <= SYSDATE – 2*365
WITH CHECK OPTION; - CCREATE VIEW v4
AS SELECT prod_id, cust_id, SUM(quantity_sold) FROM SALES
WHERE time_id <= SYSDATE – 2*365
GROUP BY prod_id, cust_id
WITH CHECK OPTION; - DCREATE VIEW v3
AS SELECT * FROM SALES
WHERE cust_id = 2034
WITH CHECK OPTION;
- ACREATE VIEW v2
16Which two of the following conditions are equivalent to each other?
- AWHERE COMMISSION_PCT IS NULL
- BWHERE COMMISSION_PCT IN (NULL)
- CWHERE NOT(COMMISSION_PCT IS NOT NULL)
- DWHERE COMMISSION_PCT = NULL
17Which statement adds a column called salary to the employees table having 100 rows, which cannot contain null?
- AALTER TABLE EMPLOYEES
ADD SALARY NUMBER(8,2) NOT NULL; - BALTER TABLE EMPLOYEES
ADD SALARY NUMBER(8,2) DEFAULT NOT NULL; - CALTER TABLE EMPLOYEES
ADD SALARY NUMBER(8,2) DEFAULT 0 NOT NULL; - DALTER TABLE EMPLOYEES
ADD SALARY NUMBER(8,2) DEFAULT CONSTRAINT p_nn NOT NULL;
- AALTER TABLE EMPLOYEES
Information
- Description
- Quiz on Oracle Crusher, created by Brandon Gagon on 19/02/2019.
- Author
- Brandon Gagon
- Language
- English
- Views
- 3
- Rating
- No ratings yet Rate this quiz