Professional Documents
Culture Documents
2 Rows Answer
6. Full outer join combines the result of the both left outer join and right outer join
a. true Answer
b. false
9. Which one is used to prevent the updating of records from more than one user
a. lock Answer
b. commit
c. rollback
14. An inner join (between two tables) is predicted based on the join condition
a. true Answer
b. false
16. Which constraint disallows duplicate values and null values in the column?
a. Unique constraint
b. primary key constraint Answer
c. foreign key constraint
d. Check constraint
19. Do change in order of the join condition changes the query result?
a. True
b. false Answer
DECO
----
Answer FAIL
23. If A table have 5 rows, B table have 1 row, then select * from A,B?
Answer:- 5 rows
24. If A table have 5 rows, B table have 0 rows then, Cartesian product of A and B is?
Answer:- no rows selected
26. Subquery?
Answer :- Used to retrieve the data based on unknown conditions
32. Select last name, salary, dept id from a where dept id=null. Will the above query will return
whose dept id is null?
a. it will return the expected result
b. the where condition needs to be changed Answer
c. the where condition operator needs to changed
33. In which dictionary you will see whether you are having access for a particular column in table
a. SYS_TAB_PRIVS
b. SYS_COL_PRIVS
c. SYS_ROLE_PRIVS
Answer USER_COL_PRIVS or DBA_COL_PRIVS. Don’t see the above options in sql. If only the
above options are available, then go for SYS_COL_PRIVS
34. Which one will return the common records from both the table?
Answer:- INTERSECT
39. Can more than one primary key be possible for a table?
Answer: No
41. If I need to store image & their details in database which datatype is used?
Answer Blob
42. I am giving granting all permission to person 'X'. What operations he can’t do?
a. Insert
b. Update
c. Delete
d. Truncate Answer
43. If I am giving grant permission to some 'X' for view alone which among the following is possible?
a. He can query that view
b. He can’t be able to access that view
c. He can access view alone but not source table Answer
d. None of the above
45. A natural join is the one which take the matching columns from two tables?
Answer True
false
46. A merge statement can be used in case of
a. Insert
b. Update
c. Insert and Update Answer
d. None
SQL>
50. Where we are using inline view?
Answer:- from clause
SELECT *
FROM ( SELECT deptno, count(*) emp_count
FROM emp
GROUP BY deptno ) emp,
dept
WHERE dept.deptno = emp.deptno;
59. Value which can be stored in a field with data type number (8, 2)?
Answer:- 999999.99
60. Table which has the column with values 10,20,NULL,NULL,30. Output of select count(COLUMN)
from table?
Answer:- 3
SQL> SELECT COUNT(*) FROM EMP;
COUNT(*)
----------
12
COUNT(COMM)
-----------
3
SQL>
61. Single row subquery?
Answer:- can return one row with multiple columns
64. Max number of CHECK constraints, column can have? (Checked for 264 checks on single column,
it worked)
a)250
b)255
c)254
d) none Answer
65. When does foreign key constraint enforce domain integrity ===>
Answer During INSERT & UPDATE IN FOREIGN TABLE & DELETE IN PARENT TABLE
Answer:-
select 1 from dual
*
ERROR at line 1:
ORA-01790: expression must have same datatype as corresponding expression
70. Which clause on merge statement is used to specify the source of the data to be updated or
inserted ===>
Answer USING Clause
71. A join is a query that combines rows from only one table ===>
Answer FALSE
72. Which operator is used with a multiple row sub query ===>
Answer NOT IN
75. Select e.named.deptid from emp edept d where e.dept id(+) = d.dept id ===>
Answer RIGHT OUTER JOIN
where t1.sub_item_cd = t2.sub_item_cd(+) -- means left outer join
76. Can a unique key contain more than one columns ===>
Answer YES
78. What you need to specify to drop all referral integrity constraints that refer to primary and
unique keys in the dropped table ===>
Answer Foreign Key constraint
79. Which of the following sql functions can operate on any datatype ===>
Answer LPAD
80. Which data type can be used for loop counters ===>
Answer PLS_INTEGER
83. maximum no of components in the decode function, including expr, searches, results and
default is
a. 265
b. 250
c. 255 Answer
d. 275
86. Which of the following sql operator takes results of two queries and return only rows that are
appear in both results sets?
A) INTERSECT Answer
B) UNION
C) EXCEPT
D) NONE OF THE ABOVE
88. in------join predicate arises implicitly by comparing all columns in both the tables that have same
col name in the joined tables?
A) equi join
B) inner join
C) outer join
D) natural join Answer
89. Select 1,2 from dual union all select 1,2 from dual; result
A) 1 row
B) 2 rows Answer
C) 0 rows
D) error
99. We have two tables; in which parent table will be participate in this?
A.reference key
B.foreign key
C.primary key Answer
D.check constraint
109. Select id from emp1,emp2 where emp1.id = emp2.id? Which error the statement will
get? (Something like this, not exactly same)
Ans:- Column in select statement is not preceded by table name and the id is available in both
the tables.
110. If the table has some data and you are trying to enforce the constraint which does not
satisfy the available data. Will it accept the constraint?
a. Yes
b. No Answer
SQL> alter table etemp add check (id > 10);
alter table etemp add check (id > 10)
*
ERROR at line 1:
ORA-02293: cannot validate (SCOTT.SYS_C003541) - check constraint violated