Oracle Database and SQL Quiz
Test your knowledge of Oracle database, SQL queries, PL/SQL cursors, DDL commands, and database concepts
Questions
TRUNCATE IS USED TO?
- DROP TABLE
- DELETE ALL ROWS
- DELETE ALL COLUMNS
- DELETE ORACLE
SQL means
- simple questionary language
- simple query language
- structured questionary language
- structured query language
ORACLE IS?
- object oriented programming language
- programming language
- scripting language
- database
SQL statements are divided into?
- 2
- 3
- 4
- 5
ORACLE is used to store?
- operational data
- historical data
- both
- none
DDL Means data drive language?
- True
- False
oracle is a programming language?
- True
- False
The life cycle of the explicit cursor goes through __________stages:
- Declare, Open, Close
- Declare, Open, Fetch, Close
- None
- Declare, Open, Fetch, Close, Remove
Which is a Valid table name:
- emp@_tab
- emp#_tab
- $emp_tab
- Emp_delete
Select employee name whose job is 'Manager' or 'Clerk' and Salary greater than 1000 and comm >100 and deptno is either 10 or 20
- Select ename from emp where job in ('MANAGER','CLERK') AND SAL>1000 AND COMM>100 AND DEPTNO=(10,20);
- Select ename from emp where job in ('MANAGER' OR 'CLERK') AND SAL>1000 AND COMM>100 AND DEPTNO IN (10,20);
- Select ename from emp where job in ('MANAGER','CLERK') AND SAL>1000 AND COMM>100 AND DEPTNO IN (10,20);
- None
What is the Output of the Following Program: declare n number:=2000; cursor c1 is select sal into n from emp where empno=7788; begin dbms_output.put_line(n); end; Data in Emp Table empno sal 123 1000
- Null
- It Gives Error
- 1000
- 2000
What is the output of the Query: select * from emp where dept_no in (select dept_no from dept order by dept_no desc);
- It Executes Successfully
- It throws Error with message: missing right Parenthesis
- It throws Error
- None
The life cycle of the explicit cursor goes through _______ stages:
- Declare, Open, Close
- Declare, Open, Fetch, Close
- Declare, Open, Fetch, Close, Remove
- None
Which is a Valid table name:
- emp@_tab
- emp#_tab
- $emp_tab
- Emp_delete
Select employee name whose job is 'Manager' or 'Clerk', Salary greater than 1000, comm >100 and deptno is either 10 or 20
- Select ename from emp where job in ('MANAGER','CLERK') AND SAL>1000 AND COMM>100 AND DEPTNO=(10,20);
- Select ename from emp where job in ('MANAGER' OR 'CLERK') AND SAL>1000 AND COMM>100 AND DEPTNO IN (10,20);
- Select ename from emp where job in ('MANAGER','CLERK') AND SAL>1000 AND COMM>100 AND DEPTNO IN (10,20);
- None
What is the Output of the Following Program: declare n number := 2000; cursor c1 is select sal into n from emp where empno = 7788; begin dbms_output.put_line(n); end; Data in Emp Table empno sal 123 1000
- Null
- It Throws Error
- 1000
- 2000
The below query Executes Successfully without Error: select * from emp where dept_no in (select dept_no from dept order by dept_no desc);
- True
- False
What happens if we execute the below create table query at first time in a database with other than sys user and the user is having create table privileges: create table dual(a number);
- It throws error with message: table or view already exists
- Insufficient privileges
- Table will get created successfully
- None
What is the output of the below queries: if table A is having 16 rows: select count() from A where 10=10; select count() from A having 10=10;
- first gives error, 16
- 16, second gives error
- 16,16
- Both the queries will give error
what is the output of the the query: select 'Sql' from dual where null = null;
- No rows will be displayed
- Sql
- It throws Error
- None