7
St.Francis Institute of Technology BASIS ORACLE MCQ 1. In the following query, which expression is evaluated first? SELECT id_number, (quantity – 100 / 0.15 – 35 * 20) FROM inventory 100 / 0.15 quantity – 100 35*20 0.15-35 2. Which of the following queries are legal? SELECT deptno, count(deptno) FROM emp GROUP BY ename; SELECT deptno, count(deptno), job FROM emp GROUP BY deptno; SELECT deptno, avg(sal) FROM emp; SELECT deptno, avg(sal) FROM emp GROUP BY deptno; 3. Which of the following queries displays the sum of all employee salaries for those employees not making commission, for each job, including only those sums greater than 2500? select job, sum(sal) from emp where sum(sal) > 2500 and comm is null; select job, sum(sal) from emp where comm is null group by job having sum(sal) > 2500; select job, sum(sal) from emp where sum(sal) > 2500 and comm is null group by job; select job, sum(sal) from emp group by job having sum(sal) > 2500 and comm is not null; 4. All of the following can ONLY be used with numeric data types except: AVG COUNT SUM STDDEV

St.Francis Institute of Technology - anuradhasrinivas Web viewBASIS ORACLE MCQ. 1. In the following query, which expression is evaluated first?SELECT id_number, (quantity – 100

  • Upload
    haxuyen

  • View
    215

  • Download
    1

Embed Size (px)

Citation preview

Page 1: St.Francis Institute of Technology - anuradhasrinivas Web viewBASIS ORACLE MCQ. 1. In the following query, which expression is evaluated first?SELECT id_number, (quantity – 100

St.Francis Institute of Technology

BASIS ORACLE MCQ

1. In the following query, which expression is evaluated first?

SELECT id_number, (quantity – 100 / 0.15 – 35 * 20) FROM inventory

100 / 0.15

quantity – 100

35*20

0.15-35

2. Which of the following queries are legal?

SELECT deptno, count(deptno) FROM emp GROUP BY ename;

SELECT deptno, count(deptno), job FROM emp GROUP BY deptno;

SELECT deptno, avg(sal) FROM emp;

SELECT deptno, avg(sal) FROM emp GROUP BY deptno;

3. Which of the following queries displays the sum of all employee salaries for those employees not making commission, for each job, including only those sums greater than 2500?

select job, sum(sal) from emp where sum(sal) > 2500 and comm is null;

select job, sum(sal) from emp where comm is null group by job having sum(sal) > 2500;

select job, sum(sal) from emp where sum(sal) > 2500 and comm is null group by job;

select job, sum(sal) from emp group by job having sum(sal) > 2500 and comm is not null;

4. All of the following can ONLY be used with numeric data types except:

AVG

COUNT

SUM

STDDEV

5. What operator is used to prevent the error: ‘ORA-01427:single row sub query returns more than one row’ ?

Use the IN operator

Use the >= operator

Use the CAN EXIST operator

Use the = operator

Page 2: St.Francis Institute of Technology - anuradhasrinivas Web viewBASIS ORACLE MCQ. 1. In the following query, which expression is evaluated first?SELECT id_number, (quantity – 100

St.Francis Institute of Technology

6. Which of the following SQL operations demands the use of wild cards comparisons?

IN

BETWEEN

EXISTS

LIKE

7. Indicate whether this statement is true or false. A foreign key column must contain unique values.

True

False

8. A stored procedure is only executed

implicitly

when asked explicitly

when the trigger associated with it is also invoked

none of the above

9. A database trigger is an alternative for

Stored procedure

Primary key for implementing referential integrity

Foreign key for implementing referential integrity

All of he above

10. Which of the following statements regarding primary key is false?

Primary key can not have null values

Primary key may contain duplicate values

Primary key can not be applied for multiple columns

All of the above

11. A hot backup is

taking up the backup of the database while it is still up and running

taking up the backup of the database after the user logs off

taking up the backup followed by taking cold backup

Page 3: St.Francis Institute of Technology - anuradhasrinivas Web viewBASIS ORACLE MCQ. 1. In the following query, which expression is evaluated first?SELECT id_number, (quantity – 100

St.Francis Institute of Technology

None of the above

12. A data block is

the place where all deleted records are persisted

the largest logical storage unit ever available for any database block

the smallest logical storage unit for a database object

all of the above

13. What are the two ways to determine the structure of a table in database?

Using DESCRIBE command and dbms_metadata_get_commit package

Using METADATA command STRUCTURE commands

Using DATA_ON_DATA and STRUCTURE commands

Using DESCRIBE command and dbms_metadata_get_ddl package

14. Where would you look for errors from the database engine?

In the error log

In the alter log

In the alert log

In the recovery log

15.  What TRUNCATE and DELETE commands does

To retrieve rows in a table

To remove some part of a table

To get rid of all rows in a table

To recover all the rows deleted in a table.

16. Which of the following is the root directory for oracle?

ORACLE_HOME

ORACLE_ROOT

ORACLE_BASE

ORACLE_SERVER

17. To determine the time zone under which a database was operating

Page 4: St.Francis Institute of Technology - anuradhasrinivas Web viewBASIS ORACLE MCQ. 1. In the following query, which expression is evaluated first?SELECT id_number, (quantity – 100

St.Francis Institute of Technology

select DBTIMEZONE from root

select TIMEZONE_DB from dual

select DB_TIME_ZONE from dual

select DBTIMEZONE from dual

18. How should a many-to-many relationship be handled?

By adding an join entity table

By adding intersection entity table

By adding union entity table

By adding Cartesian entity table

19.  How many triggers can be applied to a single table in Oracle?

10

12

15

16

20. Which of the following statements is true?

Implicit cursors are not named

Implicit cursors must be developed by the database developers

Explicit cursors can handle tables with only 16 rows

Explicit cursors does not occupy Oracle’s memory space

21.  For referential integrity to hold, any field in a table that is declared a super key can contain only values from a parent table's primary key or a candidate key.

False

True

22. Which of the following statements hold true for a cursor?

Specify positioning at specific rows in the result set

Retrieve multiple columns based on the current result set position

Modify data in the rows at the current position in the result set

Both a and c above

Page 5: St.Francis Institute of Technology - anuradhasrinivas Web viewBASIS ORACLE MCQ. 1. In the following query, which expression is evaluated first?SELECT id_number, (quantity – 100

St.Francis Institute of Technology

23.  ____________ involves putting different rows into different tables

Horizontal partitioning

Vertical partitioning

Range partitioning

Hash partitioning24. ______________ are padded with space characters to match the specified length.

VARCHAR

VARCHAR2

CHAR

CHAR225. Using synonyms is a good way to implement location transparency.

True

False26. A cluster is a schema object that contains data from _____________ , all of which have one or more columns in common.

one table

one or more tables

two or more tables

atleast two tables

27. ____________ is an area on disk which comprises of one or more disk files

A package

A table space

A partition

Heap

28. What is the the use of Rollback Segment?

Used to roll back a transaction

Both c and d

They can be used to recover the selected tables to a consistent state in case of failures

They ensure that transactions leave the uncommitted changes unnoticed.