SQL and PLSQL Questions Sample 2020 - Complete List
SQL and PLSQL Questions Sample 2020 - Complete List
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
QUESTION
Dual table is what type of object type in apps schema
Which data manipulation command is used to combines the records from one or more tables?
Which statement in SQL allows us to change the definition of a table is?
Which of the following is not a valid SQL type?
Which operator is used to compare a value to a specified list of values?
The SQL used by front-end application programs to request data from the DBMS is called _______
The command used to delete a particular column in a relation is ____________
Which of the following operations requires the relations to be union compatible?
Which of the following is a legal expression in SQL?
What is the full form of DDL ?
Select sysdate + sysdate from dual; what will be the result ?
What type of join is needed when you wish to include rows that do not have matching values?
Which of the following is true concerning a procedure?
A CASE SQL statement is which of the following?
Which of the following is one of the basic approaches for joining tables?
How many tables may be included with a join?
SQL views can be used to hide:
Which of the following is NOT a type of SQL constraint?
Which of the following are the five built-in functions provided by SQL?
To define what columns should be displayed in an SQL SELECT statement:
Which operator performs pattern matching?
What operator test column for the absence of data?
In SQL which command(s) is (are) used to change a table's storage characteristics?
In SQL which of the following is not a data definition language command?
A command that lets you change one or more field in a record is
Which of the SQL statements is correct
What is a view?
Which of the following is a SQL aggregate function
The SQL statement select SUBSTR('123456789',INSTR('abcabcabc','b'),4) from dual;
Which of the following group functions ignore NULL values?
Which of the following is a correlated subquery?
The HAVING clause does which of the following?
The following SQL is which type of join: SELECT CUSTOMER_T. CUSTOMER_ID, ORDER_T. CUSTOMER_ID, NAME, ORDER_ID F
SELECT SUBSTR(‘123456789’,
Table Employee INSTR(‘abcabcabc’,
has 10 records. It has a non-NULL‘b’), 4) FROM
SALARY DUAL;
column which is also UNIQUE.
The SQL statement SELECT COUNT(*) FROM Employee WHERE SALARY > ANY (SELECT SALARY FROM EMPLOYEE);
Which of the following is illegal?
TRUNCATE statement in SQL is a –
A type of query that is placed within a WHERE or HAVING clause of another query is called
Which of the below point(s) are true with respect to joins:
Second normal form should meet all the rules for
Which of the following must be enclosed in double quotes ?
What is the meaning of like '%0%0%'
Select 'Hi' from dual where null= null; Output will be
If a query involves NOT, AND, OR with no parenthesis
Which of the following join is also called an 'inner Join'
A subquery in an SQL select statement is enclosed in
Which of th following do you need to consider when you make a table in SQL
Name the tool for tuning SQL statements.
All of the following can only be used with numeric data types except:
Which of the following are the pseudo-columns?
Which of the following is the fastest query method for a table?
_______________ are padded with space characters to match the specified length.
How many different types of triggers can exist in a table in Oracle?
Which of the following statements is true?
To determine the time zone under which a database was operating?
Which type of index should be used on a fact table?
A database trigger is an alternative for
A stored procedure is only executed
What operator is used to prevent the error: ‘ORA-01427:single row sub query returns more than one row’ ?
Which of the following are types of background processes in Oracle?
Which of the following is true concerning systems information in an RDBMS?
A RDBMS consists a collection of
The term attribute refers to a ___________ of a table.
Address field of a person should not be part of primary key, since it is likely to ?
Database __________ , which is the logical design of the database, and the database _______,which is a snapshot of the data
Full form of RDBMS is
Primary Key should be chosen such that its attribute values are never
Query Language is a language in which a user ____
Student(ID, name, dept name, tot_cred) In this query which attribute form the primary key?
A snapshot of the data in the database at a given instant in time is known as
A relation, say r1, may include among its attribute the primary key of another relation, say r2. the r1 is known as
______ produces the relation that has attributes of R1 and R2
The master list of an indexed file
In a relational database a referential integrity constraint can be specified with the help of
A primary key
In a relation
What is the degree of a table with 1000 rows and 10 column
A super key is a set of one or more attribute that, taken collectively , asslow us
Normalization of database is used to
Functional dependencies are a generalization of
Manager’s salary details are hidden from the employee. This is
Define compound key
A schema describes
Information can be transferred between the DBMS and a
What is the full form of ACID?
A DBMS that runs on many different operating systems is said to be
The most open source DBMS.
An enterprise solution with data storage, a client interface and a security system is
A data dictionary includes?
_________ collection of data files?
Data about data is normally termed as?
This is an authorization command of SQL?
Rollback of transition is normally used to?
Which two statements are true about the primary key constraint in a table?
How should a many-to-many relationship be handled?
A data block is
Which of the following relational algebra operations do not require the participating tables to be union-compatible?
Which of the following is not a property of transactions?
Tree structures are used to store data in
The rule that a value of a foreign key must appear as a value of some specific table is called a
What is a disjoint less constraint?
It is an abstraction through which relationships are treated as higher level entities
A relation is in ____________ if an attribute of a composite key is dependent on an attribute of other composite key
What is data integrity?
Fifth Normal form is concerned with
If a transaction T has obtained an exclusive lock on item Q, then T can
If two relations R and S are joined, then the non matching tuples of both R and S are ignored in
In 2NF
R (A,B,C,D) is a relation. Which of the following does not have a lossless join dependency preserving BCNF decomposition
The normal form that is not necessarily dependency preserving is
A functional dependency of the form yx → is trivial if
The normalization was first proposed by ______________.
Assume transaction A holds a shared lock R. If transaction B also requests for a shared lock on R.
What is the full form of SQL?
Which is the subset of SQL commands used to manipulate Oracle Database structures, including tables?
Which of the following is buffered by SQL*Plus?
Script files can be executed by the
Which operator performs pattern matching?
Which command should be used to turn on the output of PL/SQL commands in SQL*Plus?
In an SQL statement, which of the following parts states the conditions for row selection?
In SQL, which of the following is not a data definition language commands?
Which of the following is not a subtype of PLS_INTEGER datatype?
A command that lets you change one or more fields in a record is
Which of the following is not a valid SQL type?
A SQL query automatically eliminates duplicates (True / False) ?
Which data type can store unstructured data in a column?
Which function is used to divides one numeric expression by another and get the remainder
What are the different types of identifiers?
Which of the following activities arc you allowed to do after executing the DISCONNECT command
In SQL, which command is used to issue multiple CREATE TABLE, CREATE VIEW and GRANT statements in a single transaction?
Which character function can be used to return a specified portion of a character string?
What are the different events in Triggers
Which of the following correctly describes the use of a %TYPE attribute?
When SQL statements are embedded inside 3GL, we call such a program as ..........
. ................ provides option for entering SQL queries as execution time, rather than at the development stage.
What is a data block?
What operator performs pattern matching?
Which processes is an instance made of Oracle?
Which prefixes are available to Oracle triggers?
What is the type of Oracle backup in which all uncommitted changes have been removed from the datafiles?
To change the format of the date returned by SYSDATE. use the command
The DUAL table has
What is the use of extent in Oracle?
20. which is the extension of an Oracle SQL*Plus file ?
Which of the following can be used as an argument for a procedure parameter?
If two groups are not linked in the data model editor, what is the hierarchy between them?
The only required sections of a PL/SQL block are the ____ sections.
In an SQL SELECT statement querying a single table, according to the SQL-92 standard the asterisk (*) means that:
Assume employee tables as Emp1(empname) (Ravi,Gopi) and Emp2(empname) (John,Ravi). what is the output of
below sql statement:
Select empname from emp1
union
Select empname from emp2
The ________ clause is used to list the attributes desired in the result of a query.
IMAGE_PATH OPTION1 (A) OPTION2 (B) OPTION3 ©
View Table Global temporary table
SELECT PROJECT JOIN
ALTER UPDATE CREATE
DECIMAL NUMERIC FLOAT
BETWEEN ANY IN
DML DDL VDL
UPDATE TABLE TRUNCATE COLUMN ALTER , DROP
UNION INTERSECTION DIFFERENCE
SELECT NULL FROM SALESSELECT NAME FROM SALSELECT * FROM SALES WHEN
Dynamic Data Language Detailed Data LanguageData Definition Language
sysdate Invalid Identifier date + date not allowed
Equi-join Natural join Outer join
You do not create them wiThey do not need to ha They include procedural an
way to establish an IF-TH way to establish a loop way to establish a data defi
Subqueries Union Join Natural join
One Two Three
columns and rows only. complicated SQL syntaxboth of the above can be h
PRIMARY KEY FOREIGN KEY ALTERNATE KEY
COUNT, SUM, AVG, MAX,SUM, AVG, MIN, MAX, SUM, AVG, MULT, DIV, MIN
use FROM to name the souruse USING to name theuse SELECT to name the sour
Between operator Like Operator Exists Operator
Exists Operator Not Operator Is Null operator
Alter table Modify Table Change Table
Rename Revoke Grant
insert Modify Look-up
select username and pass select username,passwoselect username,password
A view is a special store A view is a virtual tabl A view is a database diagra
LEFT AVG JOIN
6789 2345 1234
MAX COUNT SUM
Uses the result of an inne Uses the result of an ouUses the result of an inner
Acts like a WHERE clause b Acts like a WHERE clau Acts like a WHERE clause
, NAME, ORDER_ID F Equi-join Natural join Outer join
6789 2345 1234
10 9 5
SELECT SYSDATE – SYSDA SELECT SYSDATE – (SYS SELECT SYSDATE – (SYSDAT
DML statement DDL statement DCL statement
Master query Sub query Super query
Null values never join. Columns used in the joi Join column is usually a pri
1 NF 2 NF 3 NF
Dates Column Alias Strings
Feature begins with two 0Feature ends with two 0Feature has more than two
Hi FLASE 1
NOT will be evaluated firs NOT will be evaluated fiAND will be evaluated first;
Non-Equijoin Self-Join Equijoin
parenthesis -- (...). brackets -- [...]. CAPITAL LETTERS.
Data types Primary keys Default values
TUNEUP SYS EXPLAIN SYS DB_TUNEUP
AVG COUNT SUM
DUAL,USER_ID,CUR_VAL USER_ID,DUAL,ROW_IDSYSDATE,USER,CURVAL,NE
Fetch by columnid Fetch by tableid Fetch by rowid
VARCHAR VARCHAR2 CHAR
10 12 15
Implicit cursors are not Implicit cursors must b Explicit cursors can handle
select DBTIMEZONE from select TIMEZONE_DB fr select DB_TIME_ZONE from
A binary index A bitmap index A metadata index
Stored procedure Primary key for implemen Foreign key for implementing
implicitly when asked explicitly when the trigger associated
Use the IN operator Use the >= operator Use the CAN EXIST operato
SMON PMON CKPT
RDBMS store database defiThis information can bThis information often cann
Tables Fields Records
Record Field Column
Dependent Changed Not Changed
snapshot of the data in theInstance, Schema Relation, Schema Relation, Domain
Right Database ManagemeRelational Database M Rapid Database Manageme
Updated Changed Dependent
Requests Stores Response
Name Dept Tot_cred
Database entity Database relation Database instance
Parent relation Referenced relation Referencing relation
Cartesian product Difference Intersection
is sorted in ascending ordeContains only a list of Has a number assigned to e
Primary Key Foreign key Secondary key
is also referred to as a co Is a unique identifier in uniquely identifies the data
ordering of rows is immateNo two rows are identicBoth A and B are true
10 100 1000
to identify uniquely an entito make the key most pow to increase effectiveness o
Eliminate redundancy. Improve security. Improve efficiency.
Key dependencies. Relation dependencies. Database dependencies.
Conceptual level data hidiPhysical level data hidinExternal level data hiding.
Is made up of a several pi Uniquely identifies an iteIs a combination of each un
Data elements. Records & files Record relationships.
Spread sheet program. Word processor progra Graphics program.
Atomicity, Constant, IsolatAtomicity, Consistency, Atomicity, Consistency, Isola
Scalable. Robust. Platform independent.
Microsoft SQL Server Microsoft Access. MySQL.
2-tier system. 3-tier system. 4-tier system.
Information about systemProcedure logic Project requirements
File Database Fields
Dictionary Data bank Meta data
Access Allow Grant
Recover from the transactiUpdate the transaction Retrieve old records
It is not possible to disab It is possible to have m The primary key constraint
By adding an join entity taBy adding intersection eBy adding union entity tabl
the place where all deletethe largest logical stor the smallest logical storage
compatible? Union Difference Intersection
Atomicity Concurrency Isolation
Network model Relational model Hierarchical model
Referential constraint Index Integrity constraint
It requires that an entity The same entity may belThe database must contain
Generalization Specialization Aggregation
mposite key 2NF 3NF BCNF
It is the data contained i It is the data contained It is the data contained in
Fifth Normal form is conc Multivalued dependencJoin dependency
Read Q Write Q Both read and write Q
left outer join right outer join full outer join
No functional dependencieNo multivalued dependeNo partial FDs exist.
NF decomposition A->B, B-> CD A-> B, B->C, C->D AB->C,C->AD
2NF 3NF BCNF
y ⊆x y⊂x x⊆y
Code Codd Boyce Codd
It will result in a deadlock It
situation.
will immediately be rejected.
It will immediately be granted.
Structured Query LanguagStructured Query List Simple Query Language
Data Definition Language(Data Manipulation Lan Both of above
SQL statements SQL:Plus commands PUSQL block
START command STA command command
BETWEEN operator LIKE operator EXISTS operator
Set serveroutput on Showserveroutput on Set output on
Where From Order By
RENAME REVOKE GRANT
POSITIVEN NATURALN SIGN_TYPE
Insert Modify Look-up
DECIMAL NUMERIC FLOAT
1 0 Both
RAW CHAR NUMERIC
POWER MOD ROUND
Pre-defined and system def Pre-defined, user defin User defined and system def
Reconnect Exit the SQL*Plus sessioExecute certain SQL*Plus
n a single transaction? CREATE PACKAGE CREATE SCHEMA CREATE CLUSTER
INSTR SUBSTRING SUBSTR
Define, Create Drop, Comment Insert, Update, Delete
Lets the user declare a da Lets the user declare a Lets the user declare a dat
nested query nested programming distinct query
PL/SQL SQL*Plus SQL
Set of Extents Set of Segments Smallest Database storage unit
IS NULL operator ASSIGNMENT operator LIKE operator
Memory processes Oracle background procData processes
:new :old Both :new and :old
Inconsistent backup Consistent backup Full backup
ALTER SESSION RESET DA ALTER SESSION CHANGE ALTER
DATESESSION SET SYSDAT
One row with many columOne column with many One row and one column
Stores rollback informati Minimize the amount ofStores user data within the
.sql. .txt. .pls.
The name of a variable. A literal value. An expression.
You do not create them wiThey do not need to ha They include procedural an
Both consist of proceduralBoth have to be called Both run automatically
Involves the use of an inn Cannot return the sameDoes
r not start with the wo
REMOVE FUNCTION DELETE FUNCTION DROP FUNCTION
This section starts with It is a mandatory sectio It contains exception(s) tha
One column One super key One foreign key
5 4 1
delete table dept; delete table dept wher delete from dept;
delete from dept; delete from dept wheredelete from dept where de
Both
Ravi,70 Ravi,50 None of the above
John,115 John,115
Ravi,50 Ravi,70 Ravi,20
John,115 John,115 Ravi,50
John,65
John,55
1 0 Both
5 5 1
4 2
3 3
2 4
1 5
1 0 Both
1 0 Both
Alter table Employee add Alter table Employee moAlter Employee modify (em
Alter table Employee add Alter table Employee moAlter Employee modify (sal
DML,DDL,DCL DML,DDL,DCL,TCL DML,DDL,DkL,TCS
Create or Replace table Create or Replace tabl Create table Employee (em
After Executing Delete After Executing TruncatBoth A, B
Data Update on table will Data Update on table wilData Update will not be visi
Like Operator Between Operator Exists Operator
Count Date Sum
Asc Desc No Default Value or Order
From clause of Query Where clause of Query Select clause of query
DELETE and UPDATE cUPDATE clause only SELECT clause only
Union Clause Union All Clause Both
Delete Creates SavepointsDelete is Not Slower th Both are False
Equi-join Inner Join Outer Join
Table SQL Query Both
Table SQL Query Both
Single column of a table Multiple Columns of a t Can't be defined on a table
Index Can be used to Imp Index can be created onBoth
Varchar2 type variable canDate type of variable c Number type of Variable ca
Create can be used only foCreate can be used for CBoth
Unique Key Not Null Key Both
1 0 Both
Count will get the total coCount will return only t We can't inclue Where and
1 0 Both
Select employee from Select name Select name from
name employee
Where Select From
OPTION4 (D) OPTION5 (E) CORRECT_OPTION SECTION COMPLEX
None of the above B SQL Simple
PRODUCT C SQL Simple
SELECT A SQL Simple
CHARACTER A SQL Simple
ALL C SQL Simple
SDL A SQL Simple
DELETE COLUMN C SQL Simple
ALL OF THESE D SQL Simple
SELECT # FROM SALES; B SQL Simple
Data Derivation Language C SQL Simple
None of the above C SQL Medium
All of the above. C SQL Medium
They are the same thing as a functioC SQL Medium
All of the above. A SQL Medium
All of the above D SQL Medium
All of the above D SQL Medium
None of the above is correct. C SQL Medium
UNIQUE C SQL Medium
SUM, AVG, MIN, MAX, NAME A SQL Medium
use USING to name the source table(A SQL Medium
None of the above B SQL Medium
None of the above C SQL Medium
All of the Above A SQL Medium
Update D SQL Medium
All of the above B SQL Medium
None of the above B SQL Medium
None of these B SQL Medium
LEN B SQL Medium
456789 B SQL Medium
All of the above D SQL Medium
Uses the result of an outer query to B SQL High
Acts EXACTLY like a WHERE clause. A SQL High
Cartesian join A SQL High
456789 B SQL High
0 B SQL High
None of the Mentioned D SQL High
TCL statement B SQL High
Multi-query B SQL High
All of above D SQL High
4 NF A SQL High
All of the above B SQL High
Feature has two 0's in it, at any positD SQL High
Null D SQL High
The order of occurrence determines A t SQL High
None of these C SQL High
braces -- {...}. A SQL High
All of the above. D SQL High
EXPLAIN PLAN D SQL High
STDDEV B SQL High
ROW_NUM,ROW_ID C SQL High
Fetch by indexid C SQL High
CHAR2 C SQL High
16 B SQL High
Explicit cursors does not occupy Ora A SQL High
select DBTIMEZONE from dual D SQL High
A database schema index B SQL High
All of the above C SQL High
None of the above B SQL High
Use the = operator A SQL High
All of above D SQL High
All of the above. D RDBMS Simple
Keys A RDBMS Simple
Key A RDBMS Simple
Too Long B RDBMS Simple
Schema, Instance D RDBMS Medium
Route Database Management Syste B RDBMS Simple
None of these B RDBMS Simple
Represents A RDBMS Simple
ID D RDBMS Medium
Database schema C RDBMS Medium
Node relation C RDBMS Medium
Product A RDBMS Medium
Both [B] and [C] D RDBMS Medium
None of the above B RDBMS Simple
must be accompanied by a corresponB RDBMS Simple
none of the above C RDBMS High
none of the above A RDBMS High
none of the above A RDBMS Medium
Minimize Errors. A RDBMS Simple
All of these. A RDBMS High
All of these. C RDBMS Medium
Both (a) and (b). D RDBMS Medium
All of the above D RDBMS Medium
All of the above D RDBMS Medium
Atomicity, Consistency, Indexing, Dura
C RDBMS Medium
Distributed. C RDBMS Simple
Oracle. C RDBMS Simple
N-tier system. B RDBMS Medium
All of above D RDBMS Medium
None of these B RDBMS Medium
None of these C RDBMS Medium
None of these C RDBMS Medium
Repeat a transition A RDBMS High
The non-deferrable primary key constrC,D RDBMS High
By adding Cartesian entity table B RDBMS High
all of the above C RDBMS Medium
Join D RDBMS High
Durability B RDBMS High
File based system C RDBMS Medium
Functional dependency A RDBMS High
An entity can be joined with another Ae RDBMS High
Inheritance C RDBMS High
1NF B RDBMS High
It is the data contained in database tB RDBMS High
Domain-key C RDBMS High
Write Q but not read Q C RDBMS High
inner join D RDBMS High
No partial MVDs exist C RDBMS High
A->BCD D RDBMS High
4NF A RDBMS High
x ⊂y A RDBMS High
Boyce B RDBMS Medium
It will be granted as soon as it is released
C by A . RDBMS High
All of the above. A SQL*PLUS Simple
None A SQL*PLUS Medium
None of these A SQL*PLUS Medium
EXECUTE command A SQL*PLUS Simple
None of these B SQL*PLUS Medium
Set PL/SQL on A SQL*PLUS Simple
Group By A SQL*PLUS Medium
UPDATE C SQL*PLUS Medium
SIMPLE_N_INTEGER D SQL*PLUS Simple
All of the Mentioned B SQL*PLUS Medium
CHARACTER A SQL*PLUS Simple
None of the above B SQL*PLUS Simple
VARCHAR A SQL*PLUS High
REMAINDER B SQL*PLUS Medium
Pre defined and Post defined identifi B SQL*PLUS Medium
None of these B SQL*PLUS Simple
All of the above B SQL*PLUS Simple
POS C SQL*PLUS Medium
Select, Commit C SQL*PLUS Medium
User declares a data item of differen A SQL*PLUS Simple
embedded SQL D SQL*PLUS Medium
Dynamic SQL D SQL*PLUS Simple
Set of blocks C SQL*PLUS High
NOT operator C SQL*PLUS High
All of the Mentioned B SQL*PLUS Medium
Neither :new nor :old C SQL*PLUS High
Differential backup B SQL*PLUS Medium
ALTER SESSION SET NLS_DATE_FOR C SQL*PLUS
Many rows and many columns C SQL*PLUS Simple
None of the Mentioned B SQL*PLUS High
.ora. A SQL*PLUS Simple
All of the above. D SQL*PLUS Medium
C SQL*PLUS Medium
They are the same thing as a functio
Both are stored in the database A SQL*PLUS Medium
All of the above. A SQL*PLUS Medium
None of the above C SQL*PLUS Medium
None of the above. B SQL*PLUS Simple
Two or more columns D SQL*PLUS Medium
SQL*PLUS
The group that is left
ranks higher than the
group that is to the
right C High
SQL*PLUS
3 B SQL Medium