Sei sulla pagina 1di 17

Database Concepts

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.

1. What is DBMS?
2. It is a collection what is database?
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 defining, constructing and
manipulating the database Ior various applications.

2. What is a Database system?
The database and DBMS soItware together is called as Database system.

3. Advantages of DBMS?
Redundancy is controlled.
Unauthorized access is restricted.
Providing multiple user interIaces.
EnIorcing integrity constraints.
Providing backup and recovery.

4. Disadvantage in File Processing System?
Data redundancy & inconsistency.
DiIIicult in accessing data.
Data isolation.
Data integrity.
Concurrent access is not possible.
Security Problems.

5. Describe the three levels of data abstraction?
There are three levels oI abstraction:
Physical 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.
6. Define the "integrity rules"
There are two Integrity rules.
Entity Integrity. States that 'Primary key cannot have NULL value
Referential Integrity. States that 'Foreign Key can be either a NULL value or
should be Primary Key value oI other relation.

7. What is extension and 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.

8. What is System R? What are its two mafor subsystems?
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.

9. How is the data structure of System R different 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

10. What is Data Independence?
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 Independence is more difficult to achieve

11. What is a view? How it is related to data independence?
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.
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 Model?
A collection oI conceptual tools Ior describing data, data relationships data semantics
and constraints.

14. What is E-R model?
This data model is based on real world that consists oI basic objects called entities and oI
relationship among these objects. Entities are described in a database by a set oI attributes.

15. What is Obfect Oriented model?
This model is based on collection oI objects. An object contains values stored in instance
variables with in the object. An object also contains bodies oI code that operate on the object.
These bodies oI code are called methods. Objects that contain same types oI values and the same
methods are grouped together into classes.

16. What is an Entity?
It is a 'thing' in the real world with an independent existence.

17. What is an Entity type?
It is a collection (set) oI entities that have same attributes.

18. What is an Entity set?
It is a collection oI all entities oI particular entity type in the database.

19. What is an Extension of entity type?
The collections oI entities oI a particular entity type are grouped together into an entity
set.

20. What is Weak Entity 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 and 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).

23. What is degree 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 type?
Relationship type deIines a set oI associations or a relationship set among a given set oI
entity types.

27. What is degree of Relationship type?
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.
Procedural DML or Low level. DML requires a user to speciIy what data are needed and
how to get those data.
Non-Procedural 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 Query evaluation engine?
It executes low-level instruction generated by compiler.

33. What is DDL Interpreter?
It interprets DDL statements and records them in tables containing metadata.

34. What is Record-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-oriented?
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.

38. How does Tuple-oriented relational calculus differ from domain-oriented 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 normali:ation?
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 Dependency?
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 dependency F said 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.

42. What is multivalued dependency?
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 foin property?
It guarantees that the spurious tuple generation does not occur with respect to relation
schemas aIter decom

44 wbot ls 1 Nl (Notmol lotm)?
1he domaln of aLLrlbuLe musL lnclude only aLomlc (slmple lndlvlslble) values

45 wbot ls lolly looctloool JepeoJeocy?
lL ls based on concepL of full funcLlonal dependency A funcLlonal dependency x ? ls full
funcLlonal dependency lf removal of any aLLrlbuLe A from x means LhaL Lhe dependency does noL hold
any more

46 wbot ls 2Nl?
A relaLlon schema 8 ls ln 2nl lf lL ls ln 1nl and every nonprlme aLLrlbuLe A ln 8 ls fully
funcLlonally dependenL on prlmary key

47 wbot ls JNl?
A relaLlon schema 8 ls ln 3nl lf lL ls ln 2nl and for every lu x A elLher of Lhe followlng ls Lrue
x ls a Superkey of 8
A ls a prlme aLLrlbuLe of 8
ln oLher words lf every non prlme aLLrlbuLe ls nonLranslLlvely dependenL on prlmary key

48 wbot ls 8cNl (8oycecoJJ Notmol lotm)?
A relaLlon schema 8 ls ln 8Cnl lf lL ls ln 3nl and saLlsfles an addlLlonal consLralnL LhaL for every
lu x A x musL be a candldaLe key

49 wbot ls 4Nl?
A relaLlon schema 8 ls sald Lo be ln 4nl lf for every MulLlvalued dependency x ? LhaL
holds over 8 one of followlng ls Lrue
x ls subseL or equal Lo (or) x? 8
x ls a super key

50 wbot ls 5Nl?
A 8elaLlon schema 8 ls sald Lo be 3nl lf for every [oln dependency 81 82 8n LhaL holds 8
one Lhe followlng ls Lrue
8l 8 for some l
1he [oln dependency ls lmplled by Lhe seL of lu over 8 ln whlch Lhe lefL slde ls key of 8
51 wbot ls uomolokey Notmol lotm?
A relaLlon ls sald Lo be ln uknl lf all consLralnLs and dependencles LhaL should hold on Lhe Lhe
consLralnL can be enforced by slmply enforclng Lhe domaln consLralnL and key consLralnL on Lhe
relaLlon

52. What are partial, alternate,, artificial, compound and natural key?
9ottlol key
lL ls a seL of aLLrlbuLes LhaL can unlquely ldenLlfy weak enLlLles and LhaL are relaLed Lo
same owner enLlLy lL ls someLlme called as ulscrlmlnaLor
Alternate Key.
All Candidate Keys excluding the Primary Key are known as Alternate Keys.
Artificial Key:
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.
Compound Key:
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 Key:
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 indexing and what are the different kinds of indexing?
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 system 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 by query optimi:ation?
The phase that identiIies an eIIicient execution plan Ior evaluating a query that has the
least estimated cost is reIerred to as query optimization.

56. What is foin dependency and inclusion dependency?
Join Dependency.
A !oln dependency ls generallzaLlon of MulLlvalued dependencyA !u 81 82
8n ls sald Lo hold over a relaLlon 8 lf 81 82 83 8n ls a lossless[oln decomposlLlon of 8 1here ls no
seL of sound and compleLe lnference rules for !u
Inclusion Dependency.
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 durability 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 do you mean by atomicity and aggregation?
Atomicity.
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 Deadlock?
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 and When does 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 different phases of transaction?
DiIIerent phases are
Analysis phase
Redo Phase
Undo phase

62. What do you mean by flat file database?
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.

63. What is "transparent DBMS"?
It is one, which keeps its Physical Structure hidden Irom user.

64. Brief theory of Network, Hierarchical schemas and 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 query?
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 do you mean by Correlated subquery?
Subquerles or nesLed querles are used Lo brlng back a seL of rows Lo be used by Lhe parenL
query uependlng on how Lhe subquery ls wrlLLen lL can be execuLed once for Lhe parenL query or lL can
be execuLed once for each row reLurned by Lhe parenL query lf Lhe subquery ls execuLed for each row
of Lhe parenL Lhls ls called a cotteloteJ sobpoety
A correlaLed subquery can be easlly ldenLlfled lf lL conLalns any references Lo Lhe parenL
subquery columns ln lLs WPL8L clause Columns from Lhe subquery cannoL be referenced anywhere else
ln Lhe parenL query 1he followlng example demonsLraLes a noncorrelaLed 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 record management systems?
Addition, deletion and modiIication.

68. Name the buffer in which all the commands that are typed in are stored
Edit` BuIIer

69. What are the unary operations in Relational Algebra?
PROJECTION and SELECTION.

70. Are the resulting relations of PRODUCT and 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, 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-systems 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 data dictionary? How
Data dictionary is a set oI tables and database objects that is stored in a special area oI
the database and maintained exclusively by the kernel.

74. What is the fob of the information stored in data-dictionary?
The inIormation in the data dictionary validates the existence oI the objects, provides
access to them, and maps the actual physical storage location.

75. Not only RDBMS takes care of locating data it also
determines an optimal access path to store or retrieve the data

76. How do you communicate with an RDBMS?
You communicate with an RDBMS using Structured Query Language (SQL)

77. Define SQL and state the differences between SQL and 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 mafor set of files on disk that compose a database in Oracle
There are three mafor sets of files on disk that compose a database. All the files are
binary. These are
uaLabase flles
ConLrol flles
8edo logs
1he mosL lmporLanL of Lhese are Lhe daLabase flles where Lhe acLual daLa resldes 1he conLrol flles
and Lhe redo logs supporL Lhe funcLlonlng of Lhe archlLecLure lLself
All Lhree seLs of flles musL be presenL open and avallable Lo Cracle for any daLa on Lhe daLabase Lo
be useable WlLhouL Lhese flles you cannoL access Lhe daLabase and Lhe daLabase admlnlsLraLor
mlghL have Lo recover some or all of Lhe daLabase uslng a backup lf Lhere ls one

79. What is an Oracle Instance?
1he Cracle sysLem processes also known as Cracle background processes provlde funcLlons for
Lhe user processesfuncLlons LhaL would oLherwlse be done by Lhe user processes Lhemselves
Cracle daLabasewlde sysLem memory ls known as Lhe SCA Lhe system qlobol oteo or sboteJ
qlobol oteo 1he daLa and conLrol sLrucLures ln Lhe SCA are shareable and all Lhe Cracle background
processes and user processes can use Lhem
1he comblnaLlon of Lhe SCA and Lhe Cracle background processes ls known as an Otocle
lostooce

80. What are the four Oracle system processes that must always be up and running for the
database to be useable
1he four Cracle sysLem processes LhaL musL always be up and runnlng for Lhe daLabase Lo be
useable lnclude u8wk (uaLabase WrlLer) lCwk (Log WrlLer) 5MON (SysLem MonlLor
81. What are database files, control files and log files. How many of these files should a
database have at least? Why?
uotobose llles
1he daLabase flles hold Lhe acLual daLa and are Lyplcally Lhe largesL ln slze uependlng
on Lhelr slzes Lhe Lables (and oLher ob[ecLs) for all Lhe user accounLs can go ln one daLabase fllebuL
LhaLs noL an ldeal slLuaLlon because lL does noL make Lhe daLabase sLrucLure very flexlble for conLrolllng
access Lo sLorage for dlfferenL users puLLlng Lhe daLabase on dlfferenL dlsk drlves or backlng up and
resLorlng [usL parL of Lhe daLabase
?ou musL have aL leasL one daLabase flle buL usually more Lhan one flles are used ln
Lerms of accesslng and uslng Lhe daLa ln Lhe Lables and oLher ob[ecLs Lhe number (or locaLlon) of Lhe
flles ls lmmaLerlal
1he daLabase flles are flxed ln slze and never grow blgger Lhan Lhe slze aL whlch Lhey
were creaLed
coottol llles
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.
keJo loqs
Any daLabase musL have aL leasL Lwo redo logs 1hese are Lhe [ournals for Lhe daLabase
Lhe redo logs record all changes Lo Lhe user ob[ecLs or sysLem ob[ecLs lf any Lype of fallure occurs Lhe
changes recorded ln Lhe redo logs can be used Lo brlng Lhe daLabase Lo a conslsLenL sLaLe wlLhouL loslng
any commlLLed LransacLlons ln Lhe case of nondaLa loss fallure Cracle can apply Lhe lnformaLlon ln Lhe
redo logs auLomaLlcally wlLhouL lnLervenLlon from Lhe u8A
1he redo log flles are flxed ln slze and never grow dynamlcally from Lhe slze aL whlch
Lhey were creaLed
82 wbot ls kOwlu?
1he 8CWlu ls a unlque daLabasewlde physlcal address for every row on every Lable Cnce
asslgned (when Lhe row ls flrsL lnserLed lnLo Lhe daLabase) lL never changes unLll Lhe row ls deleLed or
Lhe Lable ls dropped
1he 8CWlu conslsLs of Lhe followlng Lhree componenLs Lhe comblnaLlon of whlch unlquely
ldenLlfles Lhe physlcal sLorage locaLlon of Lhe row
Cracle daLabase flle number whlch conLalns Lhe block wlLh Lhe rows
Cracle block address whlch conLalns Lhe row
1he row wlLhln Lhe block (because each block can hold many rows)
1he 8CWlu ls used lnLernally ln lndexes as a qulck means of reLrlevlng rows wlLh a parLlcular key
value AppllcaLlon developers also use lL ln SCL sLaLemenLs as a qulck way Lo access a row once Lhey
know Lhe 8CWlu
83. What is Oracle Block? Can two Oracle Blocks have the same address?
Cracle formaLs Lhe daLabase flles lnLo a number of Cracle blocks when Lhey are flrsL
creaLedmaklng lL easler for Lhe 8u8MS sofLware Lo manage Lhe flles and easler Lo read daLa lnLo Lhe
memory areas
1he block slze should be a mulLlple of Lhe operaLlng sysLem block slze 8egardless of Lhe
block slze Lhe enLlre block ls noL avallable for holdlng daLa Cracle Lakes up some space Lo manage
Lhe conLenLs of Lhe block 1hls block header has a mlnlmum slze buL lL can grow
1hese Cracle blocks are Lhe smallesL unlL of sLorage lncreaslng Lhe Cracle block slze can
lmprove performance buL lL should be done only when Lhe daLabase ls flrsL creaLed
Lach Cracle block ls numbered sequenLlally for each daLabase flle sLarLlng aL 1 1wo blocks can
have Lhe same block address lf Lhey are ln dlfferenL daLabase flles
84. What is database Trigger?
A daLabase Lrlgger ls a L/SCL block LhaL can deflned Lo auLomaLlcally execuLe for lnserL
updaLe and deleLe sLaLemenLs agalnsL a Lable 1he Lrlgger can e deflned Lo execuLe once for Lhe enLlre
sLaLemenL or once for every row LhaL ls lnserLed updaLed or deleLed lor any one Lable Lhere are
Lwelve evenLs for whlch you can deflne daLabase Lrlggers A daLabase Lrlgger can call daLabase
procedures LhaL are also wrlLLen ln L/SCL
85. Name two utilities that Oracle provides, which are use for backup and recovery.
Along wlLh Lhe 8u8MS sofLware Cracle provldes Lwo uLlllLles LhaL you can use Lo back up and
resLore Lhe daLabase 1hese uLlllLles are pott and lmpott
1he pott otlllty dumps Lhe deflnlLlons and daLa for Lhe speclfled parL of Lhe daLabase Lo an
operaLlng sysLem blnary flle 1he lmpott otlllty reads Lhe flle produced by an exporL recreaLes Lhe
deflnlLlons of ob[ecLs and lnserLs Lhe daLa
lf LxporL and lmporL are used as a means of backlng up and recoverlng Lhe daLabase all Lhe
changes made Lo Lhe daLabase cannoL be recovered slnce Lhe exporL was performed 1he besL you can
do ls recover Lhe daLabase Lo Lhe Llme when Lhe exporL was lasL performed
86. What are stored-procedures? And what are the advantages of using them.
Stored procedures are database objects 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 handled in PL/SQL? Give some of the internal exceptions name
L/SCL excepLlon handllng ls a mechanlsm for deallng wlLh runLlme errors encounLered durlng
procedure execuLlon use of Lhls mechanlsm enables execuLlon Lo conLlnue lf Lhe error ls noL severe
enough Lo cause procedure LermlnaLlon
1he excepLlon handler musL be deflned wlLhln a subprogram speclflcaLlon Lrrors cause Lhe
program Lo ralse an excepLlon wlLh a Lransfer of conLrol Lo Lhe excepLlonhandler block AfLer Lhe
excepLlon handler execuLes conLrol reLurns Lo Lhe block ln whlch Lhe handler was deflned lf Lhere are
no more execuLable sLaLemenLs ln Lhe block conLrol reLurns Lo Lhe caller
DsetuefloeJ ceptloos
L/SCL enables Lhe user Lo deflne excepLlon handlers ln Lhe declaraLlons area of
subprogram speclflcaLlons user accompllshes Lhls by namlng an excepLlon as ln Lhe followlng example
otIailure EXCEPTION;
ln Lhls case Lhe excepLlon name ls oL_fallure Code assoclaLed wlLh Lhls handler ls wrlLLen ln Lhe
LxCL1lCn speclflcaLlon area as follows
EXCEPTION
when OTFAILURE then
outstatuscode : goutstatuscode;
outmsg : goutmsg;
1he followlng ls an example of a subprogram excepLlon
EXCEPTION
when NODATAFOUND then
goutstatuscode : 'FAIL';
RAISE otIailure;
WlLhln Lhls excepLlon ls Lhe 8AlSL sLaLemenL LhaL Lransfers conLrol back Lo Lhe oL_fallure excepLlon
handler 1hls Lechnlque of ralslng Lhe excepLlon ls used Lo lnvoke all userdeflned excepLlons
5ystemuefloeJ ceptloos
LxcepLlons lnLernal Lo L/SCL are ralsed auLomaLlcally upon error nC_uA1A_lCunu ls a
sysLemdeflned excepLlon 1able below glves a compleLe llsL of lnLernal excepLlons
9l/5Ol lotetool eceptloos
Exception Aame Oracle Error
Cu8SC8_AL8LAu?_CLn C8A06311
uu_vAL_Cn_lnuLx C8A00001
lnvALlu_Cu8SC8 C8A01001
lnvALlu_nuM8L8 C8A01722
LCCln_uLnlLu C8A01017
nC_uA1A_lCunu C8A01403
nC1_LCCCLu_Cn C8A01012
8CC8AM_L88C8 C8A06301
S1C8ACL_L88C8 C8A06300
1lMLCu1_Cn_8LSCu8CL C8A00031
1CC_MAn?_8CWS C8A01422
18AnSAC1lCn_8ACkLu_Cu1 C8A00061
vALuL_L88C8 C8A06302
ZL8C_ulvluL C8A01476
ln addlLlon Lo Lhls llsL of excepLlons Lhere ls a caLchall excepLlon named O1nk5 LhaL Lraps all errors
for whlch speclflc error handllng has noL been esLabllshed
88. Does PL/SQL support "overloading"? Explain
1he concepL of ovetlooJloq ln L/SCL relaLes Lo Lhe ldea LhaL you can deflne procedures and
funcLlons wlLh Lhe same name L/SCL does noL look only aL Lhe referenced name however Lo resolve a
procedure or funcLlon call 1he counL and daLa Lypes of formal parameLers are also consldered
L/SCL also aLLempLs Lo resolve any procedure or funcLlon calls ln locally deflned packages before
looklng aL globally deflned packages or lnLernal funcLlons 1o furLher ensure calllng Lhe proper
procedure you can use Lhe doL noLaLlon refaclng a procedure or funcLlon name wlLh Lhe package
name fully quallfles any procedure or funcLlon reference
89. Tables derived 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 may occur due to
i. Bad normali:ation
ii. Theta foins
iii. Updating tables from foin
a) i & ii b) ii & iii
c) i & iii d) ii & iii
(a) i & iii because theta joins are joins made on keys that are not primary keys.
91. A B C is a set of attributes. The functional dependency 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 dominant entity is the entity
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 Order By
CUSTOMER Union Select EAST, CUSTOMER From CUSTDTLS Where REGION E
Order By 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
95 wbot ls 5totoqe Moooqet?
lL ls a program module LhaL provldes Lhe lnLerface beLween Lhe lowlevel daLa sLored ln
daLabase appllcaLlon programs and querles submlLLed Lo Lhe sysLem
96 wbot ls 8offet Moooqet?
lL ls a program module whlch ls responslble for feLchlng daLa from dlsk sLorage lnLo maln
memory and decldlng whaL daLa Lo be cache ln memory
97 wbot ls 1toosoctloo Moooqet?
lL ls a program module whlch ensures LhaL daLabase remalns ln a conslsLenL sLaLe desplLe
sysLem fallures and concurrenL LransacLlon execuLlon proceeds wlLhouL confllcLlng
98 wbot ls llle Moooqet?
lL ls a program module whlch manages Lhe allocaLlon of space on dlsk sLorage and daLa
sLrucLure used Lo represenL lnformaLlon sLored on a dlsk
99 wbot ls Aotbotlzotloo ooJ loteqtlty moooqet?
lL ls Lhe program module whlch LesLs for Lhe saLlsfacLlon of lnLegrlLy consLralnL and checks Lhe
auLhorlLy of user Lo access daLa
100 wbot ote stooJolooe ptoceJotes?
rocedures LhaL are noL parL of a package are known as sLandalone because Lhey
lndependenLly deflned A good example of a sLandalone procedure ls one wrlLLen ln a SCL*lorms
appllcaLlon 1hese Lypes of procedures are noL avallable for reference from oLher Cracle Lools AnoLher
llmlLaLlon of sLandalone procedures ls LhaL Lhey are complled aL run Llme whlch slows execuLlon
101. What are cursors give different types of cursors.
L/SCL uses cursors for all daLabase lnformaLlon accesses sLaLemenLs 1he language
supporLs Lhe use Lwo Lypes of cursors
lmpllclt
pllclt
102. What is cold backup and hot backup (in case of Oracle)?
colJ 8ockop
lL ls copylng Lhe Lhree seLs of flles (daLabase flles redo logs and conLrol flle) when
Lhe lnsLance ls shuL down 1hls ls a sLralghL flle copy usually from Lhe dlsk dlrecLly Lo Lape ?ou musL
shuL down Lhe lnsLance Lo guaranLee a conslsLenL copy
lf a cold backup ls performed Lhe only opLlon avallable ln Lhe evenL of daLa flle loss
ls resLorlng all Lhe flles from Lhe laLesL backup All work performed on Lhe daLabase slnce Lhe lasL backup
ls losL
not 8ockop
Some slLes (such as worldwlde alrllne reservaLlons sysLems) cannoL shuL down Lhe
daLabase whlle maklng a backup copy of Lhe flles 1he cold backup ls noL an avallable opLlon
So dlfferenL means of backlng up daLabase musL be used Lhe hoL backup lssue a
SCL command Lo ln

Potrebbero piacerti anche