Anda di halaman 1dari 18

Technical Aptitude Questions

RDBMS Concepts
1. What is aatabase?
A database is a logically coherent collection oI data with some inherent meaning,
representing some aspect oI real world and which is designed, built and populated with
data Ior a speciIic purpose.
2. What is DBMS?
It is a collection oI programs that enables user to create and maintain a database.
In other words it is general-purpose soItware that provides the users with the processes oI
aefining, constructing and manipulating the database Ior various applications.
3. What is a Database svstem?
The database and DBMS soItware together is called as Database system.
4. Aavantages of DBMS?
Redundancy is controlled.
Unauthorised access is restricted.
Providing multiple user interIaces.
EnIorcing integrity constraints.
Providing backup and recovery.
5. Disaavantage in File Processing Svstem?
Data redundancy & inconsistency.
DiIIicult in accessing data.
Data isolation.
Data integrity.
Concurrent access is not possible.
Security Problems.
6. Describe the three levels of aata abstraction?
The are three levels oI abstraction:
Phvsical level. The lowest level oI abstraction describes how data are stored.
Logical level. The next higher level oI abstraction, describes what data are stored in
database and what relationship among those data.
Jiew level. The highest level oI abstraction describes only part oI entire database.
7. Define the "integritv rules"
Copyright: Vyom Network (http://www.vyomworld.com) - All Rights Reserved
137
RDBMS Concepts
Technical Aptitude Questions
There are two Integrity rules.
Entitv Integritv. States that 'Primary key cannot have NULL value
Referential Integritv. States that 'Foreign Key can be either a NULL value
or should be Primary Key value oI other relation.
8. What is extension ana intension?
Extension -
It is the number oI tuples present in a table at any instance. This is time
dependent.
Intension -
It is a constant value that gives the name, structure oI table and the
constraints laid on it.
9. What is Svstem R? What are its two maior subsvstems?
System R was designed and developed over a period oI 1974-79 at IBM San Jose
Research Center. It is a prototype and its purpose was to demonstrate that it is possible to
build a Relational System that can be used in a real liIe environment to solve real liIe
problems, with perIormance at least comparable to that oI existing system.
Its two subsystems are
Research Storage
System Relational Data System.
10. How is the aata structure of Svstem R aifferent from the relational structure?
Unlike Relational systems in System R
Domains are not supported
EnIorcement oI candidate key uniqueness is optional
EnIorcement oI entity integrity is optional
ReIerential integrity is not enIorced
11. What is Data Inaepenaence?
Data independence means that 'the application is independent oI the storage
structure and access strategy oI data. In other words, The ability to modiIy the schema
deIinition in one level should not aIIect the schema deIinition in the next higher level.
Two types oI Data Independence:
Physical Data Independence: ModiIication in physical level should not
aIIect the logical level.
Logical Data Independence: ModiIication in logical level should aIIect the
view level.
NOTE. Logical Data Inaepenaence is more aifficult to achieve
12. What is a view? How it is relatea to aata inaepenaence?
A view may be thought oI as a virtual table, that is, a table that does not really
exist in its own right but is instead derived Irom one or more underlying base table. In
other words, there is no stored Iile that direct represents the view instead a deIinition oI
view is stored in data dictionary.
Copyright: Vyom Network (http://www.vyomworld.com) - All Rights Reserved
138
Technical Aptitude Questions
Growth and restructuring oI base tables is not reIlected in views. Thus the view
can insulate users Irom the eIIects oI restructuring and growth in the database. Hence
accounts Ior logical data independence.
13. What is Data Moael?
A collection oI conceptual tools Ior describing data, data relationships data
semantics and constraints.
14. What is E-R moael?
This data model is based on real world that consists oI basic obiects called entities
and oI relationship among these obiects. Entities are described in a database by a set oI
attributes.
15. What is Obiect Orientea moael?
This model is based on collection oI obiects. An obiect contains values stored in
instance variables with in the obiect. An obiect also contains bodies oI code that operate
on the obiect. These bodies oI code are called methods. Obiects that contain same types
oI values and the same methods are grouped together into classes.
16. What is an Entitv?
It is a 'thing' in the real world with an independent existence.
17. What is an Entitv tvpe?
It is a collection (set) oI entities that have same attributes.
18. What is an Entitv set?
It is a collection oI all entities oI particular entity type in the database.
19. What is an Extension of entitv tvpe?
The collections oI entities oI a particular entity type are grouped together into an
entity set.
20. What is Weak Entitv set?
An entity set may not have suIIicient attributes to Iorm a primary key, and its
primary key compromises oI its partial key and primary key oI its parent entity, then it is
said to be Weak Entity set.
21. What is an attribute?
It is a particular property, which describes the entity.
22. What is a Relation Schema ana a Relation?
A relation Schema denoted by R(A1, A2, ., An) is made up oI the relation name
R and the list oI attributes Ai that it contains. A relation is deIined as a set oI tuples. Let r
be the relation which contains set tuples (t1, t2, t3, ..., tn). Each tuple is an ordered list oI
n-values t(v1,v2, ..., vn).
Copyright: Vyom Network (http://www.vyomworld.com) - All Rights Reserved
139
Technical Aptitude Questions
23. What is aegree of a Relation?
It is the number oI attribute oI its relation schema.
24. What is Relationship?
It is an association among two or more entities.
25. What is Relationship set?
The collection (or set) oI similar relationships.
26. What is Relationship tvpe?
Relationship type deIines a set oI associations or a relationship set among a given
set oI entity types.

27. What is aegree of Relationship tvpe?
It is the number oI entity type participating.
25. What is DDL (Data Definition Language)?
A data base schema is speciIies by a set oI deIinitions expressed by a special
language called DDL.
26. What is JDL (Jiew Definition Language)?
It speciIies user views and their mappings to the conceptual schema.
27. What is SDL (Storage Definition Language)?
This language is to speciIy the internal schema. This language may speciIy the
mapping between two schemas.
28. What is Data Storage - Definition Language?
The storage structures and access methods used by database system are speciIied
by a set oI deIinition in a special type oI DDL called data storage-deIinition language.
29. What is DML (Data Manipulation Language)?
This language that enable user to access or manipulate data as organised by
appropriate data model.
Proceaural DML or Low level. DML requires a user to speciIy what data are needed
and how to get those data.
Non-Proceaural DML or High level. DML requires a user to speciIy what data are
needed without speciIying how to get those data.
31. What is DML Compiler?
It translates DML statements in a query language into low-level instruction that
the query evaluation engine can understand.
32. What is Querv evaluation engine?
It executes low-level instruction generated by compiler.
Copyright: Vyom Network (http://www.vyomworld.com) - All Rights Reserved
140
Technical Aptitude Questions
33. What is DDL Interpreter?
It interprets DDL statements and record them in tables containing metadata.
34. What is Recora-at-a-time?
The Low level or Procedural DML can speciIy and retrieve each record Irom a set
oI records. This retrieve oI a record is said to be Record-at-a-time.
35. What is Set-at-a-time or Set-orientea?
The High level or Non-procedural DML can speciIy and retrieve many records in
a single DML statement. This retrieve oI a record is said to be Set-at-a-time or Set-
oriented.
36. What is Relational Algebra?
It is procedural query language. It consists oI a set oI operations that take one or
two relations as input and produce a new relation.
37. What is Relational Calculus?
It is an applied predicate calculus speciIically tailored Ior relational databases
proposed by E.F. Codd. E.g. oI languages based on it are DSL ALPHA, QUEL.
How aoes Tuple-orientea relational calculus aiffer from aomain-orientea relational
calculus
The tuple-oriented calculus uses a tuple variables i.e., variable whose only
permitted values are tuples oI that relation. E.g. QUEL
The domain-oriented calculus has domain variables i.e., variables that range over the
underlying domains instead oI over relation. E.g. ILL, DEDUCE.
39. What is normalization?
It is a process oI analysing the given relation schemas based on their Functional
Dependencies (FDs) and primary key to achieve the properties
Minimizing redundancy
Minimizing insertion, deletion and update anomalies.
40. What is Functional Depenaencv?
A Functional dependency is denoted by X Y between two sets oI attributes X
and Y that are subsets oI R speciIies a constraint on the possible tuple that can Iorm a
relation state r oI R. The constraint is Ior any two tuples t1 and t2 in r iI t1|X| t2|X|
then they have t1|Y| t2|Y|. This means the value oI X component oI a tuple uniquely
determines the value oI component Y.
41. When is a functional aepenaencv F saia to be minimal?
Every dependency in F has a single attribute Ior its right hand side.
We cannot replace any dependency X A in F with a dependency Y A where Y is a
proper subset oI X and still have a set oI dependency that is equivalent to F.
We cannot remove any dependency Irom F and still have set oI dependency that is
equivalent to F.
Copyright: Vyom Network (http://www.vyomworld.com) - All Rights Reserved
141
Technical Aptitude Questions
42. What is Multivaluea aepenaencv?
Multivalued dependency denoted by X Y speciIied on relation schema R,
where X and Y are both subsets oI R, speciIies the Iollowing constraint on any relation r
oI R: iI two tuples t1 and t2 exist in r such that t1|X| t2|X| then t3 and t4 should also
exist in r with the Iollowing properties
t3|x| t4|X| t1|X| t2|X|
t3|Y| t1|Y| and t4|Y| t2|Y|
t3|Z| t2|Z| and t4|Z| t1|Z|
where |Z (R-(X U Y)) |

43. What is Lossless ioin propertv?
It guarantees that the spurious tuple generation does not occur with respect to
relation schemas aIter decomposition.
44. What is 1 NF (Normal Form)?
The domain oI attribute must include only atomic (simple, indivisible) values.
45. What is Fullv Functional aepenaencv?
It is based on concept oI Iull Iunctional dependency. A Iunctional dependency
X Y is Iull Iunctional dependency iI removal oI any attribute A Irom X means that the
dependency does not hold any more.
46. What is 2NF?
A relation schema R is in 2NF iI it is in 1NF and every non-prime attribute A in R
is Iully Iunctionally dependent on primary key.
47. What is 3NF?
A relation schema R is in 3NF iI it is in 2NF and Ior every FD X A either oI the
Iollowing is true
X is a Super-key oI R.
A is a prime attribute oI R.
In other words, iI every non prime attribute is non-transitively dependent on
primary key.
48. What is BCNF (Bovce-Coaa Normal Form)?
A relation schema R is in BCNF iI it is in 3NF and satisIies an additional
constraint that Ior every FD X A, X must be a candidate key.

49. What is 4NF?
A relation schema R is said to be in 4NF iI Ior every Multivalued dependency
X Y that holds over R, one oI Iollowing is true
X is subset or equal to (or) XY R.
X is a super key.
50. What is 5NF?
Copyright: Vyom Network (http://www.vyomworld.com) - All Rights Reserved
142
Technical Aptitude Questions
A Relation schema R is said to be 5NF iI Ior every ioin dependency R1, R2, ...,
Rn} that holds R, one the Iollowing is true
Ri R Ior some i.
The ioin dependency is implied by the set oI FD, over R in which the leIt side is key
oI R.
51. What is Domain-Kev Normal Form?
A relation is said to be in DKNF iI all constraints and dependencies that should
hold on the the constraint can be enIorced by simply enIorcing the domain
constraint and key constraint on the relation.

52. What are partial. alternate.. artificial. compouna ana natural kev?
Partial Kev.
It is a set oI attributes that can uniquely identiIy weak entities and that are
related to same owner entity. It is sometime called as Discriminator.
Alternate Kev.
All Candidate Keys excluding the Primary Key are known as Alternate
Keys.
Artificial Kev:
II no obvious key, either stand alone or compound is available, then the
last resort is to simply create a key, by assigning a unique number to each record or
occurrence. Then this is known as developing an artiIicial key.
Compouna Kev:
II no single data element uniquely identiIies occurrences within a
construct, then combining multiple elements to create a unique identiIier Ior the construct
is known as creating a compound key.
Natural Kev:
When one oI the data elements stored within a construct is utilized as the
primary key, then it is called the natural key.
53. What is inaexing ana what are the aifferent kinas of inaexing?
Indexing is a technique Ior determining how quickly speciIic data can be Iound.
Types:
Binary search style indexing
B-Tree indexing
Inverted list indexing
Memory resident table
Table indexing
54. What is svstem catalog or catalog relation? How is better known as?
A RDBMS maintains a description oI all the data that it contains, inIormation
about every relation and index that it contains. This inIormation is stored in a collection
oI relations maintained by the system called metadata. It is also called data dictionary.
55. What is meant bv querv optimization?
The phase that identiIies an eIIicient execution plan Ior evaluating a query that
has the least estimated cost is reIerred to as query optimization.
Copyright: Vyom Network (http://www.vyomworld.com) - All Rights Reserved
143
Technical Aptitude Questions
56. What is ioin aepenaencv ana inclusion aepenaencv?
Join Depenaencv.
A Join dependency is generalization oI Multivalued dependency.A
JD R1, R2, ..., Rn} is said to hold over a relation R iI R1, R2, R3, ..., Rn is a lossless-
ioin decomposition oI R . There is no set oI sound and complete inIerence rules Ior JD.
Inclusion Depenaencv.
An Inclusion Dependency is a statement oI the Iorm that some columns oI
a relation are contained in other columns. A Ioreign key constraint is an example oI
inclusion dependency.
57. What is aurabilitv in DBMS?
Once the DBMS inIorms the user that a transaction has successIully completed,
its eIIects should persist even iI the system crashes beIore all its changes are reIlected on
disk. This property is called durability.
58. What ao vou mean bv atomicitv ana aggregation?
Atomicitv.
Either all actions are carried out or none are. Users should not have to
worry about the eIIect oI incomplete transactions. DBMS ensures this by undoing the
actions oI incomplete transactions.
Aggregation.
A concept which is used to model a relationship between a collection oI
entities and relationships. It is used when we need to express a relationship among
relationships.
59. What is a Phantom Deaalock?
In distributed deadlock detection, the delay in propagating local inIormation
might cause the deadlock detection algorithms to identiIy deadlocks that do not really
exist. Such situations are called phantom deadlocks and they lead to unnecessary aborts.
60. What is a checkpoint ana When aoes it occur?
A Checkpoint is like a snapshot oI the DBMS state. By taking checkpoints, the
DBMS can reduce the amount oI work to be done during restart in the event oI
subsequent crashes.
61. What are the aifferent phases of transaction?
DiIIerent phases are
Analysis phase
Redo Phase
Undo phase
62. What ao vou mean bv flat file aatabase?
It is a database in which there are no programs or user access languages. It has no
cross-Iile capabilities but is user-Iriendly and provides user-interIace management.
Copyright: Vyom Network (http://www.vyomworld.com) - All Rights Reserved
144
Technical Aptitude Questions
63. What is "transparent DBMS"?
It is one, which keeps its Physical Structure hidden Irom user.
64. Brief theorv of Network. Hierarchical schemas ana their properties
Network schema uses a graph data structure to organize records example Ior such
a database management system is CTCG while a hierarchical schema uses a tree data
structure example Ior such a system is IMS.
65. What is a querv?
A query with respect to DBMS relates to user commands that are used to interact
with a data base. The query language can be classiIied into data deIinition language and
data manipulation language.
66. What ao vou mean bv Correlatea subquerv?
Subqueries, or nested queries, are used to bring back a set oI rows to be used by
the parent query. Depending on how the subquery is written, it can be executed once Ior
the parent query or it can be executed once Ior each row returned by the parent query. II
the subquery is executed Ior each row oI the parent, this is called a correlatea subquerv.
A correlated subquery can be easily identiIied iI it contains any reIerences to the
parent subquery columns in its WHERE clause. Columns Irom the subquery cannot be
reIerenced anywhere else in the parent query. The Iollowing example demonstrates a non-
correlated subquery.
E.g. Select * From CUST Where '10/03/1990' IN (Select ODATE From ORDER
Where CUST.CNUM ORDER.CNUM)
67. What are the primitive operations common to all recora management svstems?
Addition, deletion and modiIication.
68. Name the buffer in which all the commanas that are tvpea in are storea
'Edit` BuIIer
69. What are the unarv operations in Relational Algebra?
PROJECTION and SELECTION.
70. Are the resulting relations of PRODUCT ana JOIN operation the same?
No.
PRODUCT: Concatenation oI every row in one relation with every row in
another.
JOIN: Concatenation oI rows Irom one relation and related rows Irom another.
71. What is RDBMS KERNEL?
Two important pieces oI RDBMS architecture are the kernel, which is the
soItware, and the data dictionary, which consists oI the system-level data structures used
by the kernel to manage the database
You might think oI an RDBMS as an operating system (or set oI subsystems),
designed speciIically Ior controlling data access: its primary Iunctions are storing,
Copyright: Vyom Network (http://www.vyomworld.com) - All Rights Reserved
145
Technical Aptitude Questions
retrieving, and securing data. An RDBMS maintains its own list oI authorized users and
their associated privileges: manages memory caches and paging: controls locking Ior
concurrent resource usage: dispatches and schedules user requests: and manages space
usage within its table-space structures
.
72. Name the sub-svstems of a RDBMS
I/O, Security, Language Processing, Process Control, Storage Management,
Logging and Recovery, Distribution Control, Transaction Control, Memory Management,
Lock Management
73. Which part of the RDBMS takes care of the aata aictionarv? How
Data dictionary is a set oI tables and database obiects that is stored in a special
area oI the database and maintained exclusively by the kernel.
74. What is the iob of the information storea in aata-aictionarv?
The inIormation in the data dictionary validates the existence oI the obiects,
provides access to them, and maps the actual physical storage location.
75. Not onlv RDBMS takes care of locating aata it also
determines an optimal access path to store or retrieve the data
76. How ao vou communicate with an RDBMS?
You communicate with an RDBMS using Structured Query Language (SQL)
77. Define SQL ana state the aifferences between SQL ana other conventional
programming Languages
SQL is a nonprocedural language that is designed speciIically Ior data access
operations on normalized relational database structures. The primary diIIerence between
SQL and other conventional programming languages is that SQL statements speciIy what
data operations should be perIormed rather than how to perIorm them.
78. Name the three maior set of files on aisk that compose a aatabase in Oracle
There are three maior sets oI Iiles on disk that compose a database. All the Iiles
are binary. These are
Database Iiles
Control Iiles
Redo logs
The most important oI these are the database Iiles where the actual data resides.
The control Iiles and the redo logs support the Iunctioning oI the architecture itselI.
All three sets oI Iiles must be present, open, and available to Oracle Ior any data
on the database to be useable. Without these Iiles, you cannot access the database, and the
database administrator might have to recover some or all oI the database using a backup, iI
there is one.
79. What is an Oracle Instance?
Copyright: Vyom Network (http://www.vyomworld.com) - All Rights Reserved
146
Technical Aptitude Questions
The Oracle system processes, also known as Oracle background processes,
provide Iunctions Ior the user processesIunctions that would otherwise be done by the
user processes themselves
Oracle database-wide system memory is known as the SGA, the svstem global
area or sharea global area. The data and control structures in the SGA are shareable, and
all the Oracle background processes and user processes can use them.
The combination oI the SGA and the Oracle background
processes is known as an Oracle instance
80. What are the four Oracle svstem processes that must alwavs be up ana running for
the aatabase to be useable
The Iour Oracle system processes that must always be up and running Ior the
database to be useable include DBWR (Database Writer), LGWR (Log Writer), SMON
(System Monitor), and PMON (Process Monitor).
81. What are aatabase files. control files ana log files. How manv of these files shoula a
aatabase have at least? Whv?
Database Files
The database Iiles hold the actual data and are typically the largest in size.
Depending on their sizes, the tables (and other obiects) Ior all the user accounts can go in
one database Iilebut that's not an ideal situation because it does not make the database
structure very Ilexible Ior controlling access to storage Ior diIIerent users, putting the
database on diIIerent disk drives, or backing up and restoring iust part oI the database.
You must have at least one database Iile but usually, more than one Iiles
are used. In terms oI accessing and using the data in the tables and other obiects, the
number (or location) oI the Iiles is immaterial.
The database Iiles are Iixed in size and never grow bigger than the size at
which they were created
Control Files
The control Iiles and redo logs support the rest oI the architecture. Any
database must have at least one control Iile, although you typically have more than one to
guard against loss. The control Iile records the name oI the database, the date and time it
was created, the location oI the database and redo logs, and the synchronization
inIormation to ensure that all three sets oI Iiles are always in step. Every time you add a
new database or redo log Iile to the database, the inIormation is recorded in the control
Iiles.
Reao Logs
Any database must have at least two redo logs. These are the iournals Ior
the database: the redo logs record all changes to the user obiects or system obiects. II any
Copyright: Vyom Network (http://www.vyomworld.com) - All Rights Reserved
147
Technical Aptitude Questions
type oI Iailure occurs, the changes recorded in the redo logs can be used to bring the
database to a consistent state without losing any committed transactions. In the case oI
non-data loss Iailure, Oracle can apply the inIormation in the redo logs automatically
without intervention Irom the DBA.
The redo log Iiles are Iixed in size and never grow dynamically Irom the
size at which they were created.
82. What is ROWID?
The ROWID is a unique database-wide physical address Ior every row on every
table. Once assigned (when the row is Iirst inserted into the database), it never changes
until the row is deleted or the table is dropped.
The ROWID consists oI the Iollowing three components, the combination oI
which uniquely identiIies the physical storage location oI the row.
Oracle database Iile number, which contains the block with the rows
Oracle block address, which contains the row
The row within the block (because each block can hold many rows)
The ROWID is used internally in indexes as a quick means oI retrieving rows
with a particular key value. Application developers also use it in SQL statements as a
quick way to access a row once they know the ROWID
83. What is Oracle Block? Can two Oracle Blocks have the same aaaress?
Oracle "Iormats" the database Iiles into a number oI Oracle blocks when they are
Iirst createdmaking it easier Ior the RDBMS soItware to manage the Iiles and easier to
read data into the memory areas.
The block size should be a multiple oI the operating system block size. Regardless
oI the block size, the entire block is not available Ior holding data: Oracle takes up some
space to manage the contents oI the block. This block header has a minimum size, but it
can grow.
These Oracle blocks are the smallest unit oI storage. Increasing the Oracle block
size can improve perIormance, but it should be done only when the database is Iirst
created.
Each Oracle block is numbered sequentially Ior each database Iile starting at 1.
Two blocks can have the same block address iI they are in diIIerent database Iiles.
84. What is aatabase Trigger?
A database trigger is a PL/SQL block that can deIined to automatically execute Ior
insert, update, and delete statements against a table. The trigger can e deIined to execute
once Ior the entire statement or once Ior every row that is inserted, updated, or deleted.
For any one table, there are twelve events Ior which you can deIine database triggers. A
database trigger can call database procedures that are also written in PL/SQL.
85. Name two utilities that Oracle proviaes. which are use for backup ana recoverv.
Along with the RDBMS soItware, Oracle provides two utilities that you can use
to back up and restore the database. These utilities are Export and Import.
Copyright: Vyom Network (http://www.vyomworld.com) - All Rights Reserved
148
Technical Aptitude Questions
The Export utilitv dumps the deIinitions and data Ior the speciIied part oI the
database to an operating system binary Iile. The Import utilitv reads the Iile produced by
an export, recreates the deIinitions oI obiects, and inserts the data
II Export and Import are used as a means oI backing up and recovering the
database, all the changes made to the database cannot be recovered since the export was
perIormed. The best you can do is recover the database to the time when the export was
last perIormed.
86. What are storea-proceaures? Ana what are the aavantages of using them.
Stored procedures are database obiects that perIorm a user deIined operation. A
stored procedure can have a set oI compound SQL statements. A stored procedure
executes the SQL commands and returns the result to the client. Stored procedures are
used to reduce network traIIic.
87. How are exceptions hanalea in PL/SQL? Give some of the internal exceptions name
PL/SQL exception handling is a mechanism Ior dealing with run-time errors
encountered during procedure execution. Use oI this mechanism enables execution to
continue iI the error is not severe enough to cause procedure termination.
The exception handler must be deIined within a subprogram speciIication. Errors
cause the program to raise an exception with a transIer oI control to the exception-handler
block. AIter the exception handler executes, control returns to the block in which the
handler was deIined. II there are no more executable statements in the block, control
returns to the caller.
User-Definea Exceptions
PL/SQL enables the user to deIine exception handlers in the declarations
area oI subprogram speciIications. User accomplishes this by naming an exception as in
the Iollowing example:
otIailure EXCEPTION:
In this case, the exception name is otIailure. Code associated with this handler is written
in the EXCEPTION speciIication area as Iollows:
EXCEPTION
when OTFAILURE then
outstatuscode : goutstatuscode:
outmsg : goutmsg:
The Iollowing is an example oI a subprogram exception:
EXCEPTION
when NODATAFOUND then
goutstatuscode : 'FAIL':
RAISE otIailure:
Within this exception is the RAISE statement that transIers control back to the otIailure
exception handler. This technique oI raising the exception is used to invoke all user-
deIined exceptions.
Svstem-Definea Exceptions
Exceptions internal to PL/SQL are raised automatically upon error.
NODATAFOUND is a system-deIined exception. Table below gives a complete list oI
internal exceptions.
Copyright: Vyom Network (http://www.vyomworld.com) - All Rights Reserved
149
Technical Aptitude Questions
PL/SQL internal exceptions.
Exception Aame Oracle Error
CURSORALREADYOPEN ORA-06511
DUPVALONINDEX ORA-00001
INVALIDCURSOR ORA-01001
INVALIDNUMBER ORA-01722
LOGINDENIED ORA-01017
NODATAFOUND ORA-01403
NOTLOGGEDON ORA-01012
PROGRAMERROR ORA-06501
STORAGEERROR ORA-06500
TIMEOUTONRESOURCE ORA-00051
TOOMANYROWS ORA-01422
TRANSACTIONBACKEDOUT ORA-00061
VALUEERROR ORA-06502
ZERODIVIDE ORA-01476
In addition to this list oI exceptions, there is a catch-all exception named
OTHERS that traps all errors Ior which speciIic error handling has not been established.
88. Does PL/SQL support "overloaaing"? Explain
The concept oI overloaaing in PL/SQL relates to the idea that you can deIine
procedures and Iunctions with the same name. PL/SQL does not look only at the
reIerenced name, however, to resolve a procedure or Iunction call. The count and data
types oI Iormal parameters are also considered.
PL/SQL also attempts to resolve any procedure or Iunction calls in locally deIined
packages beIore looking at globally deIined packages or internal Iunctions. To Iurther
ensure calling the proper procedure, you can use the dot notation. PreIacing a procedure
or Iunction name with the package name Iully qualiIies any procedure or Iunction
reIerence.
89. Tables aerivea from the ERD
a) Are totally unnormalised
b) Are always in 1NF
c) Can be Iurther denormalised
d) May have multi-valued attributes
(b) Are always in 1NF
90. Spurious tuples mav occur aue to
i. Baa normalization
ii. Theta ioins
iii. Upaating tables from ioin
a) i & ii b) ii & iii
Copyright: Vyom Network (http://www.vyomworld.com) - All Rights Reserved
150
Technical Aptitude Questions
c) i & iii d) ii & iii
(a) i & iii because theta ioins are ioins made on keys that are not primary keys.
91. A B C is a set of attributes. The functional aepenaencv is as follows
AB -~ B
AC -~ C
C -~ B
a) is in 1NF
b) is in 2NF
c) is in 3NF
d) is in BCNF
(a) is in 1NF since (AC)

A, B, C} hence AC is the primary key. Since C


B is a FD given, where neither C is a Key nor B is a prime attribute, this it is not in 3NF.
Further B is not Iunctionally dependent on key AC thus it is not in 2NF. Thus the given
FDs is in 1NF.
92. In mapping of ERD to DFD
a) entities in ERD should correspond to an existing entity/store in DFD
b) entity in DFD is converted to attributes oI an entity in ERD
c) relations in ERD has 1 to 1 correspondence to processes in DFD
d) relationships in ERD has 1 to 1 correspondence to Ilows in DFD
(a) entities in ERD should correspond to an existing entity/store in DFD
93. A aominant entitv is the entitv
a) on the N side in a 1 : N relationship
b) on the 1 side in a 1 : N relationship
c) on either side in a 1 : 1 relationship
d) nothing to do with 1 : 1 or 1 : N relationship
(b) on the 1 side in a 1 : N relationship
94. Select NORTH. CUSTOMER From CUSTDTLS Where REGION N Oraer Bv
CUSTOMER Union Select EAST. CUSTOMER From CUSTDTLS Where REGION
E Oraer Bv CUSTOMER
The above is
a) Not an error
b) Error - the string in single quotes 'NORTH' and 'SOUTH'
c) Error - the string should be in double quotes
d) Error - ORDER BY clause
(d) Error - the ORDER BY clause. Since ORDER BY clause cannot be used in
UNIONS
Copyright: Vyom Network (http://www.vyomworld.com) - All Rights Reserved
151
Technical Aptitude Questions
95. What is Storage Manager?
It is a program module that provides the interIace between the low-level data
stored in database, application programs and queries submitted to the system.

96. What is Buffer Manager?
It is a program module, which is responsible Ior Ietching data Irom disk storage
into main memory and deciding what data to be cache in memory.
97. What is Transaction Manager?
It is a program module, which ensures that database, remains in a consistent state
despite system Iailures and concurrent transaction execution proceeds without
conIlicting.
98. What is File Manager?
It is a program module, which manages the allocation oI space on disk storage
and data structure used to represent inIormation stored on a disk.
99. What is Authorization ana Integritv manager?
It is the program module, which tests Ior the satisIaction oI integrity constraint
and checks the authority oI user to access data.

100.What are stana-alone proceaures?
Procedures that are not part oI a package are known as stand-alone because they
independently deIined. A good example oI a stand-alone procedure is one written in a
SQL*Forms application. These types oI procedures are not available Ior reIerence Irom
other Oracle tools. Another limitation oI stand-alone procedures is that they are compiled
at run time, which slows execution.
101.What are cursors give aifferent tvpes of cursors.
PL/SQL uses cursors Ior all database inIormation accesses statements. The
language supports the use two types oI cursors
Implicit
Explicit
102.What is cola backup ana hot backup (in case of Oracle)?
Cola Backup.
It is copying the three sets oI Iiles (database Iiles, redo logs, and
control Iile) when the instance is shut down. This is a straight Iile copy, usually Irom the
disk directly to tape. You must shut down the instance to guarantee a consistent copy.
II a cold backup is perIormed, the only option available in the event oI
data Iile loss is restoring all the Iiles Irom the latest backup. All work perIormed on the
database since the last backup is lost.
Hot Backup.
Some sites (such as worldwide airline reservations systems) cannot
shut down the database while making a backup copy oI the Iiles. The cold backup is not
an available option.
Copyright: Vyom Network (http://www.vyomworld.com) - All Rights Reserved
152
Technical Aptitude Questions
So diIIerent means oI backing up database must be used the hot
backup. Issue a SQL command to indicate to Oracle, on a tablespace-by-tablespace basis,
that the Iiles oI the tablespace are to backed up. The users can continue to make Iull use
oI the Iiles, including making changes to the data. Once the user has indicated that he/she
wants to back up the tablespace Iiles, he/she can use the operating system to copy those
Iiles to the desired backup destination.
The database must be running in ARCHIVELOG mode Ior the hot
backup option.
II a data loss Iailure does occur, the lost database Iiles can be restored
using the hot backup and the online and oIIline redo logs created since the backup was
done. The database is restored to the most consistent state without any loss oI committed
transactions.
103.What are Armstrong rules? How ao we sav that thev are complete ana/or souna
The well-known inIerence rules Ior FDs
ReIlexive rule :
II Y is subset or equal to X then X Y.
Augmentation rule:
II X Y then XZ YZ.
Transitive rule:
II X Y, Y Z} then X Z.
Decomposition rule :
II X YZ then X Y.
Union or Additive rule:
II X Y, X Z} then X YZ.
Pseudo Transitive rule :
II X Y, WY Z} then WX Z.
OI these the Iirst three are known as Amstrong Rules. They are sound because it is
enough iI a set oI FDs satisIy these three. They are called complete because using these
three rules we can generate the rest all inIerence rules.
104.How can vou fina the minimal kev of relational schema?
Minimal key is one which can identiIy each tuple oI the given relation schema
uniquely. For Iinding the minimal key it is required to Iind the closure that is the set oI all
attributes that are dependent on any given set oI attributes under the given set oI
Iunctional dependency.
Algo. I Determining X

, closure Ior X, given set oI FDs F


Set X

X
Set Old X

X

For each FD Y Z in F and iI Y belongs to X

then add Z
to X

Repeat steps 2 and 3 until Old X



X

Algo.II Determining minimal K Ior relation schema R, given set oI FDs F


1. Set K to R that is make K a set oI all attributes in R
2. For each attribute A in K
Copyright: Vyom Network (http://www.vyomworld.com) - All Rights Reserved
153
Technical Aptitude Questions
Compute (K A)

with respect to F
II (K A)

R then set K (K A)

105.What ao vou unaerstana bv aepenaencv preservation?


Given a relation R and a set oI FDs F, dependency preservation states that
the closure oI the union oI the proiection oI F on each decomposed relation Ri is equal to
the closure oI F. i.e.,
((
R1
(F)) U . U (
Rn
(F)))


iI decomposition is not dependency preserving, then some dependency is lost in the
decomposition.

106.What is meant bv Proactive. Retroactive ana Simultaneous Upaate.
Proactive Upaate.
The updates that are applied to database beIore it becomes
eIIective in real world .
Retroactive Upaate.
The updates that are applied to database aIter it becomes eIIective
in real world .
Simulatneous Upaate.
The updates that are applied to database at the same time when it
becomes eIIective in real world .
107.What are the aifferent tvpes of JOIN operations?
Equi Join. This is the most common type oI ioin which involves only
equality comparisions. The disadvantage in this type oI ioin is that there
Copyright: Vyom Network (http://www.vyomworld.com) - All Rights Reserved
154

Anda mungkin juga menyukai