Oracle Database and SQL Quiz

Test your knowledge of Oracle database, SQL queries, PL/SQL cursors, DDL commands, and database concepts

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

TRUNCATE IS USED TO?

  1. DROP TABLE
  2. DELETE ALL ROWS
  3. DELETE ALL COLUMNS
  4. DELETE ORACLE
Question 2 Multiple Choice (Single Answer)

SQL means

  1. simple questionary language
  2. simple query language
  3. structured questionary language
  4. structured query language
Question 3 Multiple Choice (Single Answer)

ORACLE IS?

  1. object oriented programming language
  2. programming language
  3. scripting language
  4. database
Question 4 Multiple Choice (Single Answer)

SQL statements are divided into?

  1. 2
  2. 3
  3. 4
  4. 5
Question 5 Multiple Choice (Single Answer)

ORACLE is used to store?

  1. operational data
  2. historical data
  3. both
  4. none
Question 6 True/False

DDL Means data drive language?

  1. True
  2. False
Question 7 True/False

oracle is a programming language?

  1. True
  2. False
Question 8 Multiple Choice (Multiple Answers)

The life cycle of the explicit cursor goes through __________stages:

  1. Declare, Open, Close
  2. Declare, Open, Fetch, Close
  3. None
  4. Declare, Open, Fetch, Close, Remove
Question 9 Multiple Choice (Multiple Answers)

Which is a Valid table name:

  1. emp@_tab
  2. emp#_tab
  3. $emp_tab
  4. Emp_delete
Question 10 Multiple Choice (Multiple Answers)

Select employee name whose job is 'Manager' or 'Clerk' and Salary greater than 1000 and comm >100 and deptno is either 10 or 20

  1. Select ename from emp where job in ('MANAGER','CLERK') AND SAL>1000 AND COMM>100 AND DEPTNO=(10,20);
  2. Select ename from emp where job in ('MANAGER' OR 'CLERK') AND SAL>1000 AND COMM>100 AND DEPTNO IN (10,20);
  3. Select ename from emp where job in ('MANAGER','CLERK') AND SAL>1000 AND COMM>100 AND DEPTNO IN (10,20);
  4. None
Question 11 Multiple Choice (Multiple Answers)

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

  1. Null
  2. It Gives Error
  3. 1000
  4. 2000
Question 12 Multiple Choice (Multiple Answers)

What is the output of the Query: select * from emp where dept_no in (select dept_no from dept order by dept_no desc);

  1. It Executes Successfully
  2. It throws Error with message: missing right Parenthesis
  3. It throws Error
  4. None
Question 13 Multiple Choice (Single Answer)

The life cycle of the explicit cursor goes through _______ stages:

  1. Declare, Open, Close
  2. Declare, Open, Fetch, Close
  3. Declare, Open, Fetch, Close, Remove
  4. None
Question 14 Multiple Choice (Multiple Answers)

Which is a Valid table name:

  1. emp@_tab
  2. emp#_tab
  3. $emp_tab
  4. Emp_delete
Question 15 Multiple Choice (Single Answer)

Select employee name whose job is 'Manager' or 'Clerk', Salary greater than 1000, comm >100 and deptno is either 10 or 20

  1. Select ename from emp where job in ('MANAGER','CLERK') AND SAL>1000 AND COMM>100 AND DEPTNO=(10,20);
  2. Select ename from emp where job in ('MANAGER' OR 'CLERK') AND SAL>1000 AND COMM>100 AND DEPTNO IN (10,20);
  3. Select ename from emp where job in ('MANAGER','CLERK') AND SAL>1000 AND COMM>100 AND DEPTNO IN (10,20);
  4. None
Question 16 Multiple Choice (Single Answer)

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

  1. Null
  2. It Throws Error
  3. 1000
  4. 2000
Question 17 True/False

The below query Executes Successfully without Error: select * from emp where dept_no in (select dept_no from dept order by dept_no desc);

  1. True
  2. False
Question 18 Multiple Choice (Single Answer)

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);

  1. It throws error with message: table or view already exists
  2. Insufficient privileges
  3. Table will get created successfully
  4. None
Question 19 Multiple Choice (Single Answer)

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;

  1. first gives error, 16
  2. 16, second gives error
  3. 16,16
  4. Both the queries will give error
Question 20 Multiple Choice (Single Answer)

what is the output of the the query: select 'Sql' from dual where null = null;

  1. No rows will be displayed
  2. Sql
  3. It throws Error
  4. None