Tag: databases

Questions Related to databases

  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


Correct Option: D

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


Correct Option: B,C
  1. Declare, Open, Close

  2. Declare, Open, Fetch, Close

  3. Declare, Open, Fetch, Close, Remove

  4. None


Correct Option: B
  1. emp@_tab

  2. emp#_tab

  3. $emp_tab

  4. Emp_delete


Correct Option: B,D

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


Correct Option: D

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


Correct Option: C