You are on page 1of 4

Solved Question Paper BCA302

Database Management System


Gujarat University TY BCA Solved Question Papper of April 2009 : Total Marks 70 Duration : 3 hrs 1 Answer the following. 14 (A) Answer the following in 'SQL' (Any five) 10 3 Explain GROUP BY clause within SELECT statement. Answer: The group by clause is generally used when you have attribute columns combined with aggregate functions in the SELECT statement. 4 Explain ADD_MONTHS, LAST_DAY function with an example. Answer: ADD_MONTHS Adds a number of months to a date; useful for adding months or years to a date. SYNTAX ADD_MONTHS (date_value, n) EXAMPLE SELECT P_CODE, P_INDATE, ADD_MONTHS (P_INDATE,24) FROM PRODUCT ORDERBY ADD_MONTHS (P_INDATE,24); LAST_DAY Returns the date of the last day of the month given in a date SYNTAX LAST_DAY (date_value) EXAMPLE SELECT EMP_LNAME, EMP_FNAME, EMP_HIRE_DATE FROM EMPLOYEE ORDERBY EMP_HIRE_DATE >= LAST_DAY (EMP_HIRE_DATE)-7; 6 Explain Primary key and Foreign key constraint with an example. Answer: Primary key: A candidate key selected to uniquely identify all other attribute value in any given row can not contain null entries. Foreign key: An attribute (or combination of attributes) in one table whose values must either match the primary key in another table or be null. 2 Answer the following (Any seven). 14 1 Define a Table and list any 3 characteristics of a Relational Table. Answer: Table: A table is perceived as a two dimensional structure composed of rows and columns. Characteristics of relational table: Each table row represents a single entity occurrence within the entity set. Each table column represents an attribute, and each column has a distinct name. Each row/column intersections represent a single data value. 2 Define Super key and Candidate key. Answer: Super key:

An attribute (or combination of attributes) that uniquely identifies each row in a table. Candidate key: A minimal super key. A super key that dose not contain a subset of attributes that is itself a super key. 3 What is referential integrity rule? Answer: If the foreign key contains either matching values or null exhibit referential integrity. In other word referential integrity means that if the foreign key contains a values, that value refers to an existing valid tuple (row) in another relation. 4 Explain SELECT relational operator Answer: SELECT can be used to list all of the row values, or it can yield only those row values that match a specified criterion. 5 Define right and left outer joins Answer: Right outer joins In a pair of a tables to be joined, a right outer join yields all of the rows in the right table, including those that have no matching values in another table. Left outer joins In a pair of a tables to be joined, a left outer join yields all of the rows in the left table, including those that have no matching values in another table. 7 Explain 1:1 and 1:M relationship within the relational database. Answer: 1:1 relationship A retail companys management structure may require that each of it stores be managed by a single employee. In turn, each store manager, who is an employee, manages only a single store. Therefore, the relationship Employee manages Store is labeled 1:1. 1:M relationship A customer may generate many invoices, but each invoice is generated by only a single customer. The Customer generates Invoice relationship would also be labeled 1: M. 8 Define Homonyms and Synonym. Answer: Homonyms In a database context, the word homonyms indicate the use of the same attribute name to label different attributes. Synonym Synonym is opposite of a Homonym and indicates the use of different names to describe the same attribute. 3 Answer the following. 14 (A) Answer any one of the following. 7 1 What is Normalization? Define BCNF and 4NF. Answer: Normalization Normalization is a process for evaluating and correcting table structure to minimize data redundancies, there by reducing the likelihood of data anomalies. BCNF: Boyce Code Normal Form A special form of third normal form (3NF) in which every determinates I s a candidate key. A table that is in BCNF must be in 3NF. When a table contains only one candidate key, the 3NF and the BCNF are equivalent. 4NF: A table is in fourth normal form (4NF) when it is in 3NF and has no multiple sets of multivalued dependencies. The 4NF has following two rules:

- All attributes must be dependent on the primary key, but they must be independent of each other. - No row may contain two or more multivalued facts about an entity. (B) Answer the following (any one) 7 Explain Distributed Database and disributed processing with appropriate 1 diagrams. Answer: Distributed Database A logically related database that is stored over two or more physically independent sites. Disributed processing The activity of sharing (dividing) the logical processing of a database over two or more sites connected by a network. 2 Discuss the components of DDBMS with a diagram. Answer: Components of DDBMS Computer workstations that from the work system. The distributed database system must be independent of the computer system hardware. Network hardware and software components that reside in each workstation. The network components allow all sites to interact and exchange data. Communication media that carry the data from one workstation to another. The DDBMS must be communications-media-independent; that is, it must be able to support several types of communications media. The transaction processor (TP), which is the software component, found in each computer that requests data. The transaction processor receives and processes the applications data requests. The TP is also known as the application processor (AP) or the transaction manager (TM). The data processor (DP), which is the software components residing on each computer that stores and retrieves data located at the site. The DP is also known as the data manger (DM), a data processor may even be a centralized DBMS. 4 Answer the following. 14 (A) Answer any one of the following. 7 2 Discuss Hierarchical and Relational Data Models. Answer: Hierarchical Data Models The hierarchical model was developed in 1960 to manage large amounts of data for complex manufacturing project such as the Apollo rocket that landed on the moon in1969. Its basic logical structure is represented by an upside down tree. The hierarchical structure contains levels or segments. A segment is the equivalent of a file systems record type. Within the hierarchy the top layer (the root) is perceived as the parent of the segment directly beneath it. Relational Data Models The relational model was introduced by E.F.Codd in 1970 in his landmark paper A relational model of data for large shared Databanks. The relational model represented a major breakthrough for both users and designers. To use an analogy, the relational model produced an automatic transmission database to replace the standard transmission database that preceded it. It conceptual simplicity set the stage for a genuine database revolution. The relational data model is implemented through a very sophisticated relational database management system (RDBMS). 5 Answer the following (Any two). 14 What is Transaction? List and discuss ACID properties of a Transaction. Define 1 Transaction Log and Whatis its function. Answer: Transaction

In a database terms, a transaction is any action that reads from and / or writes to a database. ACID properties of a Transaction Atomicity Atomicity requires that all operations of a transaction be completed; if not, the transaction is aborted. If a transaction T1 has four SQL requests, all four requests, must be successfully completed, other wise, the entire transaction is aborted. Consistency: Consistency indicates the permanence of the databases consistent state. When a transaction is completed, the database reaches a consistent state. Isolation: Isolation means that the data used during the execution of a transaction cannot be used by a second transaction until the first one is completed. This property is particularly useful in multiuser database environments because several different users can access and update the database at the same time. Durability: Durability ensures that once transaction changes are done, they cannot be undone or lost, even in the event of a system failure. Serializability: Serializabilty ensures that the concurrent execution of several transactions yields consistent results. This property is important in multiuser and distributed database, where multiple transactions are likely to be executed concurrently. Naturally, if only a single transaction is executed, serializability is not an issue. Explain types of locks in detail. Database level lock: A type of lock that restricts database access to only the owner of the lock. It allows only one user at a time to access the database. Successful for batch processes, but unsuitable for online multiuser DBMSs. Page level lock: In this type of lock, the database management system will lock an entire disk page, or section of a disk. A disk page can contain data for one or more rows and from one or more tables. Table level lock: A locking schema that allows only one transaction at a time to access a table. A table level lock locks an entire table, preventing access to any row by transaction T2 while transaction T1 is using the table. Row level lock: A comparatively less restrictive database .

You might also like