DBMS Quiz-1
DBMS Quiz-1
1--Which statement correctly describes the purpose of REFRESH COMPLETE option when
used with materialized view?
A.Truncate the materialized view and repopulates it with the data from the base tables in
the query
B.Populate the materialized view with the data from the base tables that has changed since
the last refresh
C.Populate the materialized view with the data from the base tables after each commit to
any of the base tables
D.Truncate the materialized view and populates it with the data from the base tables that
has changed since the last refresh
2--There are 3 users working on the same schema in the database.The emp table in this
schema does not have any indexes on it.All the 3 users execute UPDATE statements on the
emp table to update different rows.When the 3rd user executes an UPDATE statement,it
waits and does not update the table.
Why does the UPDATE statement of the 3rd user waits?
A.The INITRANS parameter is set to a lower value
B.The PCTFREE parameter is set to a higher value
C.All the transaction slots up to MAXTRANSE in a block are in use
D.This is because the ROW_LOCKING parameter is set to INTENT.
3--Why does performance degrade when INSERT,UPDATE,or DELETE statements are issued
on a table that has an assosiated Bitmap index?
A.Some DML's cause recreating the Bitmap Index
B.The Bitmap Index is rebuilt automatically after DML
C.The smallest amount of a Bitmap that can be locked is a bitmap segment
D.Additional time to remove the NULL values from the Bitmap index after DML operation.
4--You execute the following statement in session 1:
11--To which type must you convert the trigger to correct the error?
A. row
B. statement
C. ORACLE FORM trigger
D. before
12--The add_dept, upd_dept_stat , and upd_dept procedures are
grouped together in a package. A variable must be shared among only these procedures.
Where should
you declare this variable?
A. in the package body
B. in a database trigger
C. in the package specification
D. in each procedure's DECLARE section, using the exact same name in each
13--Examine this code:
What type of trigger is it?
create or replace Trigger secure_emp
Before Logon on emp
Begin
If (To_char(sysdate,'Dy')in('Sat','Sun'))or(to_char(sysdate,'HH24,MI') not between '08:00'
and '18:00')
Then Raise_Application_Error(-20500,'you may insert onlt during business hours.');
End if;
End;
/
A. DML trigger
B. INSTEAD OF trigger
C. application trigger
D. system event trigger
E. This is an invalid trigger.
14--All users currently have the INSERT privilege on the PLAYER table. You
only want your users to insert into this table using the ADD_PLAYER procedure. Which two
actions
must you take? (Choose two.)
A. GRANT SELECT ON ADD_PLAYER TO PUBLIC;
B. GRANT EXECUTE ON ADD_PLAYER TO PUBLIC;
C. GRANT INSERT ON PLAYER TO PUBLIC;
D. GRANT EXECUTE,INSERT ON ADD_PLAYER TO PUBLIC;
E. REVOKE INSERT ON PLAYER FROM PUBLIC;
15--Which two dictionary views track dependencies? (Choose two.)
A. USER_SOURCE
B. UTL_DEPTREE
C. USER_OBJECTS
D.IDEPTREE
E. USER_DEPENDENCIES
F. DBA_DEPENDENT_OBJECTS
16--Which two statements about the overloading feature of packages are true?
(Choose two.)
E. SAVEPOINT
20--Which two statements are true regarding views? (Choose two.)
A. A subquery that defines a view cannot include the GROUP BY clause
B. A view is created with the subquery having the DISTINCT keyword can be updated
C. A view that is created with the subquery having the pseudo column ROWNUM keyword
cannot be updated
D. A Data Manipulation Language (DML) operation can be performed on a view that is
created with the subquery having all the NOT NULL columns of a table
21--Evaluate the following INSERT SQL statement:
Insert into emp(empid,ename,deptid) values(select empid,fname||' '||lname,deptid)
from emp
where empid>111;
The INSERT statement fails when executed. What could be the reason?
A. The VALUES clause cannot be used in an INSERT with a subquery
B. Column names in the NEW_CUSTOMERS and CUSTOMERS tables do not match
C. The WHERE clause cannot be used in a subquery embedded in an INSERT statement
D. The total number of columns in the NEW_CUSTOMERS table does not match the total
number
of columns in the CUSTOMERS table
22--You issue the following SQL statement:
Select custno,NVL2(NULLIF(amt_spt,credit_limit),0,1000)"Bonus"
From cust_status;
Which statement is true regarding the execution of the above query?
A. It produces an error because the AMT_SPENT column contains a null value
B. It displays a bonus of 1000 for all customers whose AMT_SPENT is less than
CREDIT_LIMIT
C. It displays a bonus of 1000 for all customers whose AMT_SPENT equals CREDIT_LIMIT or
AMT_SPENT is null
D. It produces an error because the TO_NUMBER function must be used to convert the
result of
the NULLIF function before it can be used by the NVL2 function
23--Evaluate the following SQL statements:
create Table orders
(o_id number(2) constraint ord_pk PRIMARY KEY,
o_date date,cust_id number(4));
Create Table odr_item
(o_id number(2),item_no number(3),qty number(3) CHECK(qty Between 100 and 200),
expiry_date date CHECK(expiry_date>Sysdate),
constraint it_pk PRIMARY KEY (o_id,item_no),
constraint ord_fk FOREIGN KEY(o_id)REFERENCES orders(o_id));
The above command fails when executed. What could be the reason?
A. SYSDATE cannot be used with the CHECK constraint
B. The BETWEEN clause cannot be used for the CHECK constraint
C. The CHECK constraint cannot be placed on columns having the DATE data type
D. ORD_NO and ITEM_NO cannot be used as a composite primary key because ORD_NO is
also
the FOREIGN KEY
24--Which statements are correct regarding indexes? (Choose all that apply.)
39--Which option lists the correct hierarchy of storage structures, from the smallest to the
largest?
A. data block, segment, extent, and tablespace
B. data block, extent, segment, and tablespace
C. segment, tablespace, data block, and extent
D. tablespace, extent, data block, and segment
E. segment, extent, tablespace, and data block
F. tablespace, data block, extent, and segment
40--While updating the rows in a table you realize that one of the rows violates a constraint
on the table, thereby causing the update to fail. Which statement is true in this scenario?
A. The undo data is moved to a temporary segment.
B. The undo data is retained and reused when the update is executed again.
C. The undo data is retained and marked as obsolete.
D. The space used by undo data is freed up to be reused by another transaction.
41--You execute the following command:
SQL> DROP USER user01;
The command fails displaying the following error:
ORA-01922: CASCADE must be specified to drop 'USER01'
What could have caused the command to fail?
A. The user's password has expired.
B. The user account is locked.
C. The user's schema has objects in the database.
D. The user is currently connected to the database.
42--The data in the EMPLOYEE_NAME column of the EMPLOYEES table is stored in
mixed case. Currently, there is no index on the column. You want to create an index
on the column to support non-case-sensitive queries and faster retrieval of data by
using the index. Which type of index would you create on the column?
A. a bitmap, reverse key index
B. a function-based index
C. a B-Tree, reverse key index
D. a bitmap-partitioned index
43--Consider the following phases involved in the processing of a SQL statement:
- Parse
- Bind
- Execute
- Fetch
Arrange the phases involved in processing a data manipulation language (DML) statement in
the correct sequence.
A. Parse, Execute, Bind, and Fetch
B. Execute, Bind, Parse, and Fetch
C. Parse, Bind, and Execute
D. Execute, Bind, and Fetch
44--In your database, you observe that a large number of rows in a table are being updated
frequently, causing the rows to be migrated, thereby degrading database performance.
Which option could you consider to minimize row migration in future?
A. increasing the size of the extent for the table
B. increasing PCTUSED for the table
C. increasing PCTFREE for the table
E. user process
48--Because of poor response time on queries, you are asked to allocate more space to the
component that holds SQL execution plans. To which component would you allocate more
space?
A. Large Pool
B. Shared Pool
C. Row Cache
D. Java Pool
49--Which Oracle data type should you use to store data in a database that uses multiple
languages to store data?
A. CHAR
B. VARCHAR
C. LONG
D. NVARCHAR2
E. VARCHAR2
50--USER01 executes the following command:
SQL> GRANT select, insert, update ON employees TO USER02 WITH GRANT OPTION;
USER02 executes the following command:
SQL> GRANT select, insert ON USER01.employees TO USER03 WITH GRANT OPTION;
USER03 executes the following command:
SQL> GRANT select ON USER01.employees TO USER04;
Then, USER01 executes the following command:
SQL> REVOKE select, insert, update ON employees FROM USER02;
How does the REVOKE affect the users USER02, USER03, and USER04?
A. The privileges are revoked from USER02, and that implicitly revokes the privileges from
USER03 and USER04.
B. The privileges are revoked from USER02, but USER03 and USER04 continue to have the
privileges.
C. The privileges are revoked from USER02 and USER03, but USER04 continues to have the
privileges.
D. The command fails because the privileges cannot be revoked from USER02 until USER02
revokes the privileges from the users to whom it granted.