Tag: databases

Questions Related to databases

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


Correct Option: D

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


Correct Option: D
  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

Which is a Valid table name:

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

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


Correct Option: C