Lovely Professional university

Page 1 of 8

PART-A Question 1: Conceptually and diagrammatically describe the logical steps while executing users request to access the database system. Answer - A user request for data is recevied by data manager which determine the physical record requird.The data manager send the request for specific physical record to the file manager .the file manager decide which physical bllock of secondary storage device contains the erquird record and send the appropriate block to disk manager .The disk manager reterive the block and send it to the file manager ,which send the requird record to the data manager. The database managem is bridge between the application programmed and the os of the computer which is responsible for placing data on the magnatic storage device. Logical Diagram To Access the Database
1. To retrieve the data from database the following operation perform. 2. The database management system instruct the o s to locate and retrieve the data from the

specific location on the magnetic disk. 3. A copy of data is given to the application programme for processing. 4. The dbms inspects in turn the external schema the external mapping the conceptual schema the concepitual mapping and storage structure definition. Question 2: Construct a E-R diagram for a hospital management system with a set of doctors and a set of patients.With each patient, a series of various tests and examinations are conducted. On the basis of preliminary report patients are admitted to a particular specialty ward. Answer -For creating tha ER model of hospital management system we should follow the basic standard steps as following-: Step 1:- Find the entity related to management List of entity

Lovely Professional university 1. Doctor 2. Patient 3. Test 4. Ward

Page 2 of 8

Step 2:- In the second step we find the relationship degree and the cardinality between entity. Where m stands for many and n for same.

Ward:-List of attribute 1. ward _no; 2. ward_level; 3. ward_name;

Step 3:- Now we find the nature of each attributea well as find the primary key and foreign key.
1. For entity Doctor we select doc_id as primary key and spatialisation is as multivalue

attribute age is an drived attribute.
2. For patient , patient_id is an primary key address is an composite key,diseases is an

multivalue attribute.
3. For test entity test_name is an primary key and ‘organ for’ is an multivalue attribute. 4. For ward entity ward_NO+ward_lavel is a primary key which is actually is a composite

key. Step 4:- Prepare final E-r modal for given entity with using given attribute and entity. Question 3: Compare and contrast the different models?

Lovely Professional university

Page 3 of 8

Answer -Hierarchical In flat files, records are deemed to exist at the same level. Hierarchical data files permits records to be grouped together. This allows a superior-subordinate or parent-child relationship (a single one-to-many relationship) to be defined between records. In simple forms, the superior or parent records are used to collect information that is common to all the subordinate/child records of the same group. This has an immediate effect of reducing redundancy with the data base. Record "key" usually includes the "key" of all superiors/parents. Keys tend to recognize the order of a particular record within a group rather than within the data file. Duplicate records are acceptable. Examples: topical outlines, organizational telephone directories, Microsoft Windows registry, automated report formats. Hierarchical data bases have a natural alignment with report formats, even if the information is being extracted for data bases implementing other models. Network While hierarchical data bases emphasize the use of a single "path" to access all records, network data bases may provide multiple paths to locate individual records and sets of records. The term "network" has little to do with communications between computers. Instead, the "network" refers to the ways in which records may reference other records. The term "CODASYL" (from the abbreviated name of the group that formalized the use of such data bases) is often used, but it does not connote the multi-relationship nature and is usually inaccurate. Records and fields tend to be fixed in size, but are storable at arbitrary locations within the data file (or files). The record "key" represents a physical location (e.g., file, block, and offset) in the data-base file structure. Network data bases allows records to participate in multiple relationships or sets. Performance tends to be extraordinarily efficient. A well-designed network data base would permit application programs and extemporaneous queries simply to follow key links between records, without having to look individual records up through a separate index or directory.

Lovely Professional university

Page 4 of 8

Because of the efficiency, this model tends to be followed in DBMS implementations (in constrast with DB implementations) for disk storage. However, the network-like structure usually is hidden, quite deliberately, from DBMS users. Relational Before the relational data model, existing data models had no particular good way to separate the conceptual designs from implementations. Pre-relational models depended upon being able to determine explicitly where and how individual records were stored. The relational data model looks at information as an unordered collection of "relations." Each relation is populated with unordered "tuples" of the same unordered "field" structure. Fields may only contain values of a well-defined ("atomic") domain or the null value. The unordered aspect needs to be emphasized. For expository purposes, relations are often viewed as "tables". The tuples constitute the "rows" of the table; values for a specific field constitute "columns". However, the "table data model" tends to impose a very non-relational ordering on both tuples and fields. Relations are an abstraction of how data is stored; tables are just one of many possible implementations. Consequently, duplicate tuples are not permitted within a single relation. Even more strongly, distinct tuples must have a unique "key" (some combination of a relation's named fields). The set of minimal keys includes one "primary key"; the rest are "candidate keys". Within a tuple, references to other tuples are expressed as a "foreign key," which should contain the values of the referenced tuple's primary key. Relational theory provides a firm mathematical foundation for data management. Set theory could be applied to relations using relational algebraic operations (union, intersection, join, projection, etc.). Assertions about the existence or non-existence of some condition with a data base could be proven with a rigor unachievable with earlier models.

Entity-Relationship (E-R) The abstractness of the relational data model was an essential part toward eliminating the reliance of data models upon machine implementations. However, the abstractness also obscured how tuples in one relation were associated with tuples in other relations. In some ways, the entity-relationship model (or ERM, as long as you don't confuse it with enterprise resource management) can be viewed as an extension of the relational model where the associations between relations is made explicit. Relational purists have suggested that ERM is

Lovely Professional university

Page 5 of 8

totally unnecessary. Just the same, the entity-relationship model exists independently of the relational model and should be judged on its own merits. The ERM approach presumes that all information can be stored in entities and relationships between entities. A "entity" is similar to a relation (of the relational data model), except that any references to other entities is removed. This would include all foreign keys definitely and may include other association information as well. What constitutes a tuple in the relational model is called an "entity instance" by ER purists. In practice, both schematic entities and entity instances are considered "entities." PART-B Question 4: If WE want to change the schema of at one level of database system without having change the schema of next higher level , is it possible , if yes representing using abstraction levels. Answer-:-.A database is a collection of related data that have implicit meaning. Database represents some aspect of the real world, they contain logically coherent data, and they are designed, built, populated for a specific purpose. The DBMS architecture is a three-schema architecture, which was proposed to achieve program data independence, support for multiple views, and use of catalog to store the database description schema. ____________________________________________________________________________ __ The three-schema architecture is a convenient tool for the user to visualize the schema levels in a database system. A displayed schema is called a schema diagram and each object in the schema is called schema construct. In this DBMS architecture, schemas can defined in three levels: 1:-INTERNAL 2:-CONCEPTUAL 3:-EXTERNAL The internal level has an internal schema, which describes the physical storage structure of the database. The internal schema uses physical data model, which describes the complete details

Lovely Professional university

Page 6 of 8

of data storage, access paths for the database, and how the data’s are retrieved or inserted in the database. A data model is a collection of conceptual tools for describing the data, data relationship, data semantics and consistency constraints. The conceptual level has a conceptual schema that describes the whole database for different users who access the database. The conceptual schema hides the details of the physical storage structures and concentrates basically on entities, relationships, and constraints. The external or view level includes a number of user views. Each external schema describes the part of the database that a particular user group is interested in and hides the rest of the database from other user groups. Implementation data model is used at this level. Each user group will refer to its own external schema. Hence the DBMS should be capable of transforming the request specified in the external schema into request against the conceptual schema. The process of transforming requests and results between levels are called mappings. Data independence is accomplished because, when the schema is changed at one level the schema at the next higher-level remains unchanged only the mapping between the two levels is changed. View is also called as “Virtual table” because view does not contain physically stored records and will not occupy any space. A multi-user database whose users have variety of applications must provide facilities for defining multiple views. This three-schema helps us to provide data security of data’s among different users accessing the database, ensures data integrity and avoid duplication of data’s in the database. It helps us to establish and maintain relationship among the data’s in the database

Question 5: Can we treat a relationship as a high level entity? Justify your answer with example? Answer -If we talk about level of entity, relationship is also can be a entity which have different attribute and relationship decide that how entity involved in we can consider relationship as higher level entity. Relationship is an something which involves to no of table. it may be one two or three. So the relationship may be an simple relationship or it may be an entity which have some attribute. now if relationship entity involves two entity then the attribute of relationship may copy in any involves entity or in both entity . an relationship can be consider as higher level entity because the attribute defined in higher level entity copy in in all inherited entity according to

Lovely Professional university

Page 7 of 8

specialization . Question 6: A university has many academic unit named schools. Each school is administered by a Head of School. The school has administrative and teaching staff. A school offers many courses. A course consists of many subjects A subject is taught to students who have registered for a subject in a class room by a teacher. Draw the necessary E-R diagram for the university specifying aggregation, generalization or specialization hierarchy. Answer -For preparing the E-R model on university and related acadmic unites than again we follow the sequential procedure as following:-

Step 1:-Identify the entity set collecting in the database Entity list 1. School 2. Courses 3. Subject 4. Hod 5. Teacher 6. Head Of schools

Step2:- Now identify the attribute and the type of attribute of different entity Entity for school 1. school name 2. location 3. code-- primary key

Entity for hod 1. hod_id primary key 2. name 3. dept_id

Lovely Professional university

Page 8 of 8

Step 4:- Finalise the design of ER model Question 7: How deletion, insertion is possible using relational Algebra? Answer -Deletion We express a delete request in much the same way as a quary. Instead of displaying the tuples to user we remove the selected toples from the database . we can delete only two toples. We can delete the only whole value , we cannot delete the values on particular attribute in relation algebra deletion is represented by R=R= --- E Where r is called the relation and E is the relational algebra query let us take example Delete all the account records of particular employee smith Depositordepositor −− sigma(customer name) =”smith” (depositor)

Sign up to vote on this title
UsefulNot useful

Master Your Semester with Scribd & The New York Times

Special offer for students: Only $4.99/month.

Master Your Semester with a Special Offer from Scribd & The New York Times

Cancel anytime.