You are on page 1of 13

Third year B.C.

A Examination DATABASE MANAGEMENT SYSTEM (302)

Q1

Attempt the following:-

a) Compare logical and physical data independence. Ans->Conceptual/ internal mapping is the key to Physical data independence, a system provides physical data independence if users and uses programs are immune to changes in the Physical structure of the stored stored database. The external/mappings are the key to logical data independence, a system provides logical data independence if uses and users and use a programs are also immune to database. d) State difference users of DBMS. Ans->There are application programmers, responsible for waiting database application program in some programming language such as COBOL PL/I, C++, JAVA as some higher level fourth generation language. Such programs access the database by in suing the appropriate request typically or SQL statement to the DBMS. The program themselves can be conventional batch applications, or they can be online application, whose purpose is to allow an end user to access the database from an online workstation or terminal. Most modem applications are of the online variety. The second class of users then is end user who interact with system from online workstation as terminals. A given end users can access the database via one of the online applications maintained in the previous program he/she can use an interface provided an integral part of the database system software. Such vendor provided interfaces are also supported by means of online applications, of course, but that application can build, not user northern. Most database system includes at least one such build application normally a query language process or by which the user can issue database requests such as select and insert to the DBMS. The third class of user, is the database administrator or DBA.

c) How are the records stored in an indexed sequential file. Ans:- It contain an entry for every stored record occurrence in the index file. This means that the index file did not contain the index field. Here this

example, the supplier did not into city field. Secondary indexing on the field occurred then primary key. d) What is data modeling? State the difference data models? Ans-> A data model is an abstract, self continued, logical definition of the objects, operators and so that together constitute the abstract machine with which users interact. The objects allow us to model the structure of data. The operation allows us to model its behavior. In implementation of a given data model is a physical relation on a real machine of the components of the obstruct machine that together constitute that model. A data model in the first sense is like a programming language albeit one that is some what abs treat where constructs can be used to solve a wide variety or specific problems, but in and of themselves have no direct connection with any such specific problem. A data model in the second sense is like a specific program written in that language. In other words, a data model in the second sense takes the facilities provided by some model in the first sense and applies them to same specific problem. It can be regarded as specific application of some model in the first sense.

e)

State the disadvantages of DBMS.

f) What is conceptual schema? Ans:- The conceptual view is defined by means of the conceptual schema, which includes definitions of the various conceptual schema, which includes definitions of each of the various conceptual record type. g) What is a candidate key? Give an example. Ans-> An attribute or set of attribute which can become a primary key are identified as candidate key. E.g To represent citizen of nation the following table can be used. ID_NO, name, address1, address2, city, state, pin code, soc_security_no, pan_no, email id, phone_no, phone_R and phone_mobile. Q2(a) Define the following terms:a) Tuple:-

A set of values for each attribute in a relation to represent on instance of entity is identified as tuple

b)

Attribute:-

Characteristics of an entity are identified as attributes. For e.g:- Employees_no, Emp_name, job, salary, dept_no, are identified as attribute in a relational model, columns are used.

c)

Projection:-

The projection of a relation is defined as the projection of all its tuple over some of attributes that is vertical result of a relation. d) Cordiality:The continuality of a relation is given by number of Tuple in a relation. e) Primary key:-

Primary Key is an attribute or a set of attribute witch uniquely identify every tuple in a relationshi f) Determinants:g) Degree:The degree of a relation is given by no of attribute in a relation.

Q2(b) What is functional dependencies? Explain with example? Ans:- Functional dependencies can be defined this:-Give a relation R and attribute y to R is functionally dependent x of R if each value of x in R. this functional dependency is represented as f: x->y. To understand this we are taking one relationship S having attributes like S.no, Sname, city and status. Here attribute S.Sname, status, city or relation S are each functionally dependent an attribute S.no of S because given particular value of S.no there exist precisely one value for each of s.name, status, and city. In symbol, Have S.S# ->S.Sname S.S# ->S.city S.S# ->S.status Or S.S# ->S.name, S.city, S.status The statement S.Sno->city is read as attribute S.Scity is functionally dependence an attribute S.Sno.

Here in the definition of functional dependency it is not required to say that a given x value appear in only one tuple of R so, the modified definition of functional dependency can be given as given a relation and attribute of R is functionally dependent on attribute x of R it and only if whenever two tuples of R agreed on their X value they also agreed as there y value. OR Q2 (b) Explain losels join and dependency preserving decomposition with an example? Ans-> LOSS-LESS JOIN:A decomposition of relation r into relations R1,R2 upto Rn is said to be lossless joint decomposition or simply lossless if for every relation R, that satisfies FDs in F , the antural joint of projective of Ri gives original relation R decomposition is lossless. DEPENDANCY PRESERVING DECOMPOSITION:Given a relation scheme R<S,F> where F is the set of functional dependencies on the attributes in S,R is decomposed into the relation scheme with the functional dependencies then this decomposition of R is dependancy preserving is the closure of F. if the closure of Fis identical to F+. Q2(c) Explain the entity integrity rule with example? Ans:- Integrity rule is concerned with primary key value is null value in an attribute is a value that is either not known at that time or does not apply to a given instance of the object it may possible that tupple for an attribute. This fact can be represented by a null value if any attribute or primary key where method to have null values there because attribute in the key must be non redundant. The key cannot be used for unique identification of tuple. This contradicts that requirement for a primary key. An attribute id is the primary key for relation key if null values where permitted there two tuples are indicting visible even though they may represent two difference instances of employees. Definition:- if attribute A of relation r is employees. Attribute of RR then A cannot accept null values. OR Q2(c) Explain referential integrity rule with example?

Ans:-> Integrity rule two is concerned with foreign key that is with attributes of a relation having domain that are those of the primary key of another relation. Relation R may contain reference to another relation S. relation R and S did not be destined. Suppose the reference in R one set of attribute that forms a primary key of a relation S. Those set of attributes in R foreign key. A valid relationship between a tuple in a two lines requires that value of attributes in the foreign key o & r are correspondence to the primary key of tuple in S. The referential attribute in r can have null values. In this case, it is not referring to any tuple in S. Given two relation R and S suppose R refers to the relation S while are set of attributes that forms primary key in R. There the forms primary key in a tuple R must either be equal to the primary key of a tuple of S as well Q3:- Write SQL statements for the following:Item (item_code, description, price, DOH) Customer(customer_code, customer_name, DOB) Order( Order_code, order_date, status, item_code, quantity, customer_code). a) b) c) d) e) f) Create the order table specifying the foreign key constraints. Display the total number of order for each day. Display the name of the gouges customer. Display the information of customer where orders are pending. Display the list of items which have not been punched at all. Display the number of address for the month of January.

Q3 (A) ANSWER THE FOLLOWING:a) Differentiate between commit and rollback. Ans-> The commit operation signals successful end of transaction. It tells the transactions manager that a logical unit of work has been successful completed the database is in a consists state again and all of the update made by that unit of work can now be committed or made permanent. By contrast, the rollback operation ; it tells the transaction manager that

something has going wrong, the database might be in an in consistent sate, and all of the updates made by the logical unit of work so far must be rollback. b) Compare where and having clause Ans:-Where:Retrieve selected rows from table with the use of where clause, which returns only those rows that meet the conditions. Having:Having imposes a condition on the group by clause, which further filters the groups created by the groups by clause. c) What is PL/SQL? Draw its block structure. Ans:-> the full form of pl/sql is procedural language/ structured query language. Advantages of pl/sql over sql:(1)in sql, we are able to execute only one command at a time while in pl/sql, whole block of statements can be executed at once. (2)in sql, we cannot use conditionaling and looping statement while in pl/sql,variety of conditional and looping statements are available. (3)in pl/sql, some additional data types like boolean, binary_integer and real are available except all the existing datatypes of sql. d) What is view? State any condition on which a view becomes read only? Ans:- Views is logical window which is used to access data contains in one or more tables. By hiding original table name if you view is created by using only one table that only insert or delete operations possible on view. If the view contents data from multiple tables, then it has take care about key pressure roll. Syntax:- CREATE[OR Replace] view <view name>(column alias1, column alias2, ) as select sql statement. With read only:If we use this clause to create a view them we cannot perform insert, update or delete operations on view that is view will be read only. Ex-> Create a view with name eview3 and include empno, empname, salary, deptname and location in that view.

SQL> Create view eview3 (empno, empname, e salary, deptname, location) as select e.empno, e.empname, e.salery, d.dname, d.location from emp e dept d where e.deptno = d.deptno;

Q3 (B) DEFINE THE FOLLOWING:a) Group by clause:Whenever we use group by clause in the select SQL statement, only aggregate function a group by expansion can come in the select SQL column list. b) Sub query:Whenever it is not possible to save any query by waiting down only one select SQL statements, then sub query which is used. In sub query users is allowed to write query within a query whenever query will be executed it will first execute innerquery and it will proceeds its execution towards other side. c) Cartesian product:The extended Cartesian or simply Cartesian product of two relation is the quantity nation of tuple belonging to the two adetion with all possible combinations. e) DML:The full form of DML is data manipulation language is used to manipulate the data within the database object. SELECT, INSERT, UPDATE and DELETE are commands in DML.

Q4 (A) What is normalization? Explain 2NF with insertion, deletion and updation anomalies with an appropriate example? Ans-> When ever we store data in a piece of paper, we could not care about redundancy, when we maintained data manually. If same value is repeated in one attribute for two types then we represents the fate following way. In this above relation we maintained information for which supplier is supplying which parts. The way data is represented in the above format will not be suitable for the database system because of redundancy. So, the data requires normalizations. Second {s#, city, status} p.k. s#

Sp {s#, p#, QTY} p.k{s#, p#} S# -> city S# -> city ->status. Now the relation first be recomposed into relation second s.p. Second {s#, STATUS, CITY} p.k s# Sp{s#, p#, QTY} p.k s#, p# Now all animalize in first, formal form are solved. Definition:All relation scheme in 2NF if and only if it is 1NF and every man key attribute it fully functionally dependent on primary key. The primary key for second is s.no and s.key if s#, p#. Here the second sp structure still was problems. The relation sp is only, but in the relation second, there is transitative dependency. S# -> city -> status. Each s# value determine city value and that city value is term determines status value. This transitative can create problem. Anomalies in second normal form:INSERT:We cannot insert the feet that a particular status, that is cannot set that only suppler in Mehsana, must have a status of 20 until some supplier actually located in that city. DELETE:It will delete one tuple from second, w delete not only the information for the supplier concerned but also information that the city has that particular status. For ex. It will delete the second tuple of 5010 will loose the information that status for Mehsana in 20. UDATE:The status for a given city appears in 2NF many times, in general, it still contain some redundancy. Thus, if we used to change the status for Bombay from 40 to 50, then again the same problem will arise. We have to found out each tuple containing Bombay.

OR Q4(A)Write the algorithm to compute a disuse of attribute X under the FDs in F. Ans-> Input:-> A set of functional dependences is F and let of attribute is x. Output:-> The desure x+ of x under the FDs in F. X+; =x; Change ;= true; While change do Begin Change:= false For each FD w->z in F do Begin X+:=x+ uz; Change:= true; End End End. Q4 (B) a) Attempt the following:Define BCNF. The 3NF definition did not deal us the case of a relations key that (1) head:- Two or more candidate keys. (2) The candidate key where composite (3) They overlapped so, the original data of 3NF was replaced by a stronger definition identified as Boyce code normal form. Definition:A relation scheme is in BCNF if and only if every non tribe left producible every as candidate key as it determinants. b) What is conical cover?

Ans-> A set of functional dependencies is a conical cover if every FD in Fc satisfies the following:-> Each FD in Fc is simple. -> For FD X-> A with zcx is {FC-(x-> A)} & {Fc Uz->A} Fc. -> no FD X->A is redundant. d) Define 3NF.

The relation second discussed in 2NF leaving transitative dependency. So, now we break this relation into two or more relation. Third and s. city. THIRD { S#, CITY} . P.K s#, FD: s# -> city s.city { city, status} p.k: city FD: city-> status. By examining the functional dependency of relation third and s.city we found that there are no transiative dependency. So now all the animalize which was in 2NF is solved by defining this new structure. This relations are now said to be in 3NF. Definition:-> A relation scheme is in 3NF if and only if it is in 2NF and all non key attribute are not transitatively dependent on primary key. Q5 (A) Answer the following:a) Explain in brief the properties of transaction? Ans-> A transaction is logical unit of work. The transactions have four properties are:* Atomically:transactions are atomic. * consistency:transactions presser database consistency. That is transaction transform constancy. State of the database into another consistent states without necessarily presenting consistency at all intermediate points. * Isolation:- Transactions are isolated form on null be many transactions during concurrently any given any transactions updates canceled from all the set. Until that transaction community. Another way of saying the same thing is that for any two distinct transaction T1 and t. T1 might be see T2 might see T is updates. But certainly not both. DURABILITY:Once a transaction commits its updates survive in the database even if there is a subsequent system crash.

b) cash?

What is system recovery? Also compare soft cash and hand

OR a) What is cheek point? Also state the write ahead log rule?

b) Explain with diagram different stages of transaction? Ans-> a transaction that complete its execution successfully is said to be committed. A committed transaction that has performed updates transform the database into a new consistent state which must present even if there is a system failure. Active the initial state the transaction stays in this state while it is adjusting. Partially,committed after the final statement has been execution. Failed after the discovery that normal execution can no longer proceed. Aborted after the transaction has been rollback and the database has been restored to its state prior to the start of the transaction. Committed after successfully completion. A can restart the transaction but only if the trasnsaction was not aborted as a result of some hardware or software error that was not created through the internal logic of the transaction. Arestarted transaction is considered to be a new transaction.

Q5 (B) What is DBMS? Explain disadvantages of DDBMS? Ans-> It consists of a collection of site connected together while are same kind of communication network in which. a) Each sit is full database system site in own right. b) The site are agreed to work together so that a user at any sight can access data any where in the network exactly as if thee data user all stored of the user own sites. So the DDB is really a kind of virtual database whose components parts are physically stored in a no of real database at no of distinct sites, which are maintained by a verity of DBMS running over a verity of different communicating network. Consider a banking system in which the customer accounts database is distributed across the bank branch. In other word the data is stored at the location at which it is most frequently used but is still available which the communicating networks are to the users at other location.

DISADVANTAGES OF DDBMS:1) COST AND COMPLEXITY:-

The important disadvantage of this DDBMS is cost and complexity. A distributed system which hides the nature from and users is more complex then the centralize DBMS. Increased complexity means that the maintains cast of the system is higher those for a centralize DBMS. 2) PARALLEL- EVALUTION:-

The parallel nature of the system means that errors are hander to avoid and those in the applications are difficult to pin point. 3) LARGE COMMUNICAION OVERHEAD:-

In a distributed system a large communication overhead in coordinating massage between sites. This massage not only beloved the network but the problem of the system will also be down out of the require deliberating or none delivering of massage create problems.

OR B) State and explain the advantages of DDBMS? Ans-> It consists of a collection of site, connected together while are same kind of communication network in which. a) Each site is full database system site in its own right. b) The sit are agreed to work. Together so that a user at any sight can access data any where in the network exactly as if the data were all stored at the users own right. So, the DDB is really a kind of virtual database whose components arts are physically stored in a no of real database of a no of distinct sites, which are maintain by a verity of different DBMS, running over a verity of machines, supported by a verity of different OS and connected together, by a verity of deferent communicating network. Consider a banking system in which the customer account database is distributed across the bank branch office use that customers local branch. In other words, the data is stored at the location at which it is most frequently

used but is still available while are the communicating network to the user at other location. ADVANTAGS OF DDBMS:1) SHARING:Users at a given site are able to access the data stored at other sites and at the same time begin control over the data at their own site. 2) AVAILABILITY & RELIBILITY:-

Given when a portion of the system is down the system remaining available with related data failure of on sit allow access to the replicated copy of the data from author sites. The remaining sites continue to function. The grater accessibility increase in availability of the system. 3) INCREASED GROWTH:-

As the organization growth necessaries can be added with little no improved. Compare this to the situation a centralized system whose growth results is upgraded and software that affect the system.

You might also like