Dbms. 1

You might also like

Download as pdf
Download as pdf
You are on page 1of 48
U N IT DATABASE SYSTEM aS APPLICATIONS, INTRODUCTION TO DATABASE DESIGN ae PART-A SHORT QUESTIONS WITH SOLUTIONS Q1. What is DBMS? What are the goals and advantages of DBMS? . OR What is DBMS? What are the goals of DBMS? May-17(R19), aa) (Refer Only Topics: DBMS, Goals of DBMS) OR What is DBMS? What are the advantages of DBMS? Refer Only Topics: DBMS; Advantages of DBMS) Answer : DBMS Moy-19(R16), 08) Database Management System (DBMS) is a software that performs the follow % Defining a database ‘© Supporting query language 4 Producing reports f Creating data éntry screens. Goals of DBMS . (To support system activities. To perform monitoring and turning so as to ensure satisfactory performance level To perform backup and recovery activities inorder to recover from disaster. To camry out security auditing and monitoring that deals with the assignment of access rights and use of access privileges Gi Gi) wy) Advantages of DBMS (i) Program data independence (ii) Reduced data redundancy (ii) Improved data consistency (iv) Improved data sharing (¥) Enforcement of standards (vi) Improved quality: SPECTROM ALLAN-ONE JOURNAL FOR ENGINEERING STUDENTS Sia GROUP 23 yer v ‘ 1.2 DATABASE MANAGEMENT SYSTEMS [JNTU-HYDERABAD] Q2. List the disadvantages of DBMS. Answer Model Papers, ata) The disadvantages of DBMS are as follows, 1. High conversion cost 2. High management and installation cost 3. Need af new specialized personnel 4. Need for explicit backup and recovery S.__ Security breaches. Q3. Write down the applications of DBMS. Answer : Nov/Dec.-18(R16), Q1(b) Applications Database management systems are used by many individuals either directly or indirectly. Some of the applications of DBMS are listed below. (Transactions in Bank The user accesses the bank database for crediting or debiting the account. The bank database stores the details of individual customers, their account, loans ete, (i) Reserved Ticket Reservation Database of airlines is used to schedule information and to reserve the ticket. ‘Suppose, if two travelling agents compete for a last seat at the same time, the database should accept only one request and inform the other that his request cannot be accepted, (ii) Students at Universities Universities have database of various courses they offer and a database for the faculty and students. Each student record contains the name of the student, marks scored etc. Each faculty record contains the name of faculty, his employee id, salary, subjects dealing with ete. Q4. Write disadvantages of file system. Answer: ‘The disadvantage of file system are as follows, 1. If the computer system has main memory of $00 GB then also the data cannot be accessed more than 4 GB. This is due to the presence of many directories. 2, The data is prone to security attacks if them. 3. When the changes are made to the system, at that time of hard disk erash then the data canngt be restored (or) backup 4. The operating system provides the usemame and passwotd for security purpose to signin. Ths also becomes insufficient, because different users have permission to access various data subsets. is accessed concurrently by different users and frequent changes are made by S. It does not restrict the unauthorized access. 6. The programmers develop large amount of code. These codes are nothing but special programs which server themselves as response to each question raised by users operating concurrently. This increases the complexity. 5. What is a data model? ‘ Model Papers, at(a) Data Model is a mean of modeling data i. to give a shape to the data (or) o give a figure tothe stored data, A data model ‘makes easier to understand the meaning of the data by ts figure and ensures that users understand, The nature of the data without requiring any physical implementation details % The view of data of every user @ These of data across application areas. Look for the SIA GROUP Loco n the TITLE COVER betare you buy 1.3 UNIT.: INIT-1_Database System Applications, Inoducton to Database Design 28. ferentiate between schema and data model. 7 : May-15(R13), Q1(a) _ Schema 2 ‘Data Model ] 1. ] Data model represents a model whieh i wsed for 1] A schema represents the overall design of the database, ‘modeling the data of a database. Data models are categorized as, (i) High level data mode! Gi) Low level data model Database schemas are categorized as, (Internal schema i) Conceptual schema (ii) External schema Ina schema, data can be understood by analogy to a In data model, data can be clearly understood by program written in programming language. its figure. Physical implementation is required. Q7. Explain the advantages of using a query language instead of custom programs to process data. Aprvay-12, Set, (a) Physical implementation is not required, Answer : The advantages of using the query language (of relational model) to process the data instead of custom programs are as follows, ‘The query language allows to post the questions in the form of queries which are easily understandable whereas the custom programming does not includes the idea of posting the questions. ‘A query language such as relational calculus allows to perform mathematical logic without the need of any custom pro- ‘gramming code. 3.” Aquery language such as relational algebra is similar to calculus and includes the predefined operations to manipulate the relations whereas in custom programming the user requires to create the code explicitly in order to perform any sort of ‘manipulations. 4. The relational language is not bothered about planning, optimizing and performing of the physical operations instead it leaves this responsibility on the Database Management System (DBMS) whereas in the custom programming all such tasks are needed to be performed explicitly, 8. What is a descriptive attribute? Explain. Answer Descriptive Attribute ‘These attributes record the information regarding. Descriptive attributes are the attributes associated with a relationship. the respective relationship on which it is defined but not about any of the participating entities. These enti a relationship without | using. descriptive attributes. Example Joie Colkges | _Geouse) uniquely identify. The “date” attribute associated with “Joins” relationship is a descriptive atribute, which maintains the information regarding the joining date of a student. 'U-HYDERABAD] 14 : DATABASE MANAGEMENT SYSTEMS [JNT! Q9. Differentiate between weak entity set and strong entity set. Answer: Strong Entity Set It has ‘Weak Entity Set Teh no primary key until he ateibutes of the srong entity set on which it depends ae included The relationship of tuples in weak entity set with the tuples in strong entity set Partitions the tuples. Then a set of attributes called discriminator distinguishes primary key The primary hey distinguishes all tuples. the partitioned Q10. Define the terms: Relational Databases, Tables Re), 410) Answer : Nov/Dec. Relational Database Relational database is considered as one of the conventional database that consist of abundant information. Data is stored inthe form of table. Each table contains information about a particular object which is represented in rows and columns. The ‘column specifies the different attributes ofan object and row (alsocalled tuple) specifies actual instance of the object. The relation in relational database refers to different tables in the database. It is necessary that, every row in a table should consist of wr value i. individual tuple contain atomic value. : Relational Tables A table or relation can be defined as the organized set of rows and columns. The rows are called tuples and the columns are called fields or atribites. It helps the programmer in presenting data to the end user in an easy and efficient way and also simplifies the task of database design. Iti also called a relation since it represents a logical relation. A table contains collection of entity occurrences and hence itis also referred to as an entity set ‘The characteristics of the relational table are as follows, It is a two dimensional structure consisting of rows and columns. 1 2. Each row of the ible represents a single occurence ofthe entity set. 3.__Each column ofthe table represents an atibute with a unique name. Gif. How to represent the strong Entity set and Weak entity set in ER-Model? Answer : Anrtt8(nt6), (a) s 97 Peres gs ‘arrval time -| FLIGHTS | Strong entity Destination Source ‘FLIGHT _Deptr UNIT-1 Database System Applications, Introduction to Database Design Tn the above figure, FLIGHT is strong entity act and Departure sa weak ety st. Since, Departure depens on FLIGH? imorder to uniquely identity its entities. Flight entity has its own primary Key which can identify its entities wmanely ‘Weak entity is represented by a double line rectangle where a strong entity is represented by a single ne rectangle. ‘The discriminator of weak entity is de ined with a dashed line. A double line diamond shape symbol is used for the Caan ship set that links weak entity act with strong entity set. Moreover the double lines from weak entity to relationship st 1 10 indicate tht every weak en (Le, Departures) is associated to some strong entity (FLIGHTS) through the relationshiP = FLIGHT Dept Q12. Explain generalization, specialization and aggregation in E-R Model. ee (Model Papers, a1(o | May 1816}, O40) Generalization Generalization isa special case of specialization. “The design approach may be top-down ot bottom-up. In top-down, the entitis ae identified and are subdivided. In consrash ‘a bottom-up approach, all the low-level entities are grouped to form a high level entity. For example, designer may fist identity attributes of student, teacher and then group common attributes into a higher - ‘entity. This is known as generalization. The high-level entity is called super clas and low-level entity is called a subclass Employee ISA, Ld Software Engg : {ceo Manager Figure: Generalization In the example, employee entity isa super class of software engincer, CEO, manager subcla” ntities. It can also be said that attributes of employee entity have been inherited by software engineer, CEO, manager entities and that software enginoct ISA employee. Specialization ‘An entity person can be defined with attributes name, street and city which can further be subdivided into student and teacher. This subgrouping is known as specialization. . Iisa process of identifying the subsets ofan entity set each of which have different characteristic features, In this process, the superclass is defined followed by the subclasses definition. After defining the superclass of subclasses, the attribures relationship associated these subclasses are defined. Cot PERSON ISA, Sia GROUP <2 Le DATABASE MANAGEMENT SYSTEMS [JNTU-HYDERABAD, Aggreratios It is the concept which specifies the participation of one relationship set into another relationship set. Consider the ER diagram given below showing relation between STUDENT. cond) Eas) Figure: ER Diagram Involving Aggrogation Here, Maintains relationship is said to participate in Joins relationship as it maintains the joining details of the STUDENT. ‘The dashed box around the Joins relation indicates aggregation. Now, the Joins relation can be treated as an entity set which define the Mainiains relationship set. Q13. Construct an E-R diagram for a car-insurance company that has a set of customers, each of whom owns. ‘one oF more cars. Each car has associated with it zeto to any number of record accidents. Answer + May 13800), 2 Figure: ER Diagram Q14. What is a super key? Give an example. Answer : Model Papers, ct(0) Super Key ‘A super key is a combination of a candidate key and a composite key i.., super key isa set of attributes or a single attribute that uniquely identifies a tuple in a relation. . Example {Cid, Aceno, Cname} ete, all the three attributes taken together can identify a particular record or a combination of any two attributes can. identify a particular record or any one ofthe attribute can identify a particular record. Q15, Give an example for total participation and partial participation. Answer: May-15(R13), Q1(b) Consider an example of school students. All the students will study in the school but only few of them participate in extra curricular activities. Look for the SIA GROUP Loco 2)S"on the TITLE COVER bilBle'You buy MINIT-1 Database Sy Student =} 'ystem Applications, Introduction to Database Design ‘School ‘Tota participation liesteas Extracurricular activities Partial paticipation 1.7 Q16. Discuss the role of database security. Answer Views has the capability of provi ‘Agtiay-12, Se, 02a) ‘only the necessaty information to the users and hiding the remaining data i.e., the details about the data in the underlying relations. This will eventually simplifies the usage of the system and enhances the level of security. Thus, when unauthorized users attempt to access the data, they are restricted in doing so. For example, when a user attempts to access all the information about the student; the DBA permits to view only the selected student information or fields ‘without permitting access to the entire student table. DATABASE MANAGEMENT SYSTEMS [JNTU-HYDERABAD} ul w A Historical Perspective, File Systems Versus a DBMS C Q17. Write a note on DBMS. Explain database system applications. Aori-t, $et2, ana) OR ¢ Define DBMS. List database system applications. Anower + Mode Papert 2) Database Management System (DBMS) Dastse mange! nen ise sofa eos thea fans, © Define a database Oe * Support query language Dace agede WES $° Generate reports aoe Database management systems are used by many individuals ether directly or indirectly. Some of the applications of DBMS are listed below. @o @ ‘Transactions in Bank ‘The user accesses the bank database for crediting or debiting the account. The bank database stores the details of individual customers, their account, loans etc. Reserved Ticket Reservation Database of airlines is used to schedule information and to reserve the ticket. ‘Suppose if two travelling agents compet for alas set atthe sae time, the database should accept only one request and ‘inform the other that hs request cannot be accepted. =| ————-— Universities have database of various courses they offer anda database forthe faculty and students. Each student record contains the name ofthe student, marks seored etc, Each faculty record contains the name of faculty, his employee id, salary, subjects dealing with etc, ” wi Online shopping is another example, fr this, the user select an item from the database and then send toning is ao x ates - sends his credit card Computer Horoscope ‘Thi type of application require the user to enter name, date of birth likes and dislikes in form, All ty Ey to search for a perfect match andThis future prediction an Database in a Library UNIT-1 Database System Applications, Introduction to Database Design (oll) Shopping at Supermarket ‘The cashier places the bar code ofa product aginst a barcode reader. The application program uses the bar code to identify the price and reduces the number of items on the database. ‘The user can also cal the supermarket o know the availability ofthe product. The telecaller accesses the database to know if the product is available or not (wii) Telecommunications Database is used to store the details of number of calls made to generate the bill. For prepaid customers, it stores the credit available. Q18. Explain advantages of database approach. OR Explain the advantages of DBMS over file oriented system. Answer: ‘Advantages of Database Approaches ‘The following are the advantages of DBMS, 1, Program data independence 2. Reduced data redundancy 3. Improved data consistency 4, Improved data sharing 5. Enforcement of standards : Improved quality 1. Program Data Independence ‘The program data independence can be defined as a separation of metadata (i.e. data description) from application programs using the data. The database approach strongly provides access to data description by storing it at a central location called repository. As database programs in database are independent ofthe storage details the modification of organization's data ‘becomes easy and can be enhanced without performing any change to the application programs, 2. Reduced Data Redundancy Redundancy can be defined as duplication of data, Reduced redundancy specifies the avoiding of duplicate data and reducing the total amount of storage space required. In an ideal database design, all previously separated data files are integrated into a single logical sructue. This implies that the data gets stored only at one location within the database. This minimizes the extra processing time to search the required data in a large mass of data. Moreover, it also helps in eliminating the inconsistencies in searching the exact datafile required. However, the database approach does not completely removes the redundancy but it entitles the programmers to control the redundancy. 3. Improved Data Consistency Data consistency can be defined as validity, accuracy, usability and integrity of data between applications and other IT enterprises. Thereby, providing a consistent data to the user. However, in case of inconsistent data, changes that are made to redundant data are not reflected to other data. Such databases provides incorrect and contradictory information to the users. But if the redundancy is controlled or minimized, the likelihood of inconsistent data is also minimized. 4. Improved Data Sharing . Data sharing summarizes database access to both authorized internal and external users. Hage gach user requires its one ‘or more user views into the database. A user view can be defined as a logical representation of some part of database which is usually used by user to perform the task. The creation of user view is done by recognizing a form 6r'a feport required by user on daily basis, In addition to this, existing application programs are entitled to share the data in the database. * 5S. Enforcement of Standards . 7 ‘Atte time ofthe implementation of database approach, the role ofthe database administration should establish and enforce all database standards. The development of these standards is done through data repository that provides a powerful set of tools to the DBA. These standards involves naming conventions, data quality standards, uniform procedures for accessing, updating and protecting data. = 5 ee ae SPECTROM ALL-IN-ONE FOR ENGINEERING STUDENTS = _[singrouw 2 -HYDERAI DATABASE MANAGEMENT SYSTEMS [JNTU-H BA 1.10 ea .fdata majorly affects the, strategic plann 5 ‘The poor quality of dat f : saute tw pe bey of | i —.. applicd by DBMS, These constraints behaves as a rule and cannot be viol With such constraints the users maintain the improved quality of data, , Such cleani tuse environment role is to clean the operational data before it stored in data warehouse, Suc! ' >The data ware maintain the quality of data in data warehouse. meyer 219. Compare the database system with file system. OR system. Make a comparison between database system and file syst apius1, 904,01 Answer : _ ae File Processing System | Database Management System 1 | File isa memory block ofa secondary storage 1. [Database isa collection of related files that are device lke disk, magnetic tpe that logically arranged into different groups. stores related records permanently, 2 | Data in accessed via single or multiple files, 2. | Datais accessed using relations i, table 3. | File manager is used to stor tionsh 3. | Database administrator is used to store the ret form of structural abTe- 4 | Data in file system is insecure since it fails to 4. | Data in database are highly secure since it restrict restricts unauthorized access — ‘unauthorized access, 5. | Data recovery and bitckup cannot be performed 5. | Data recovery and backup can be performed. 6 | Data redundancy issue exists in file system, 6. | Data redundancy issue is removed in DBMS, 7. | Itisnot possible to represent complex 1. | Itis possible to represent cmpiex relationships relationships among data, among data, S. | Itdoes not provide any sort of storage “8. | Itprovides storage structure for efficient query structure for efficient queiy processing. Processing, 9% | Itdoes not provide efficient utilization of | 9. | It provides efficient utilization of resources, resources. a © —— 10.} File manager fails to resource the conflicts 10.) DBA resources the conflict among multiple users among various user while accessing the while accessing same data. same data, __ — / Write’a brief note on history of database systems. ne . ee ‘Answer : pak Ok Model Paper, a2(a) A brief history of database management systems is as follows, 19505 { volution of database management system began in late 1950s with the invent ‘of magnetic tapes. All the data was stored on lapes. Processing of data requires reading data ‘from oné or more tapes and praaee oaneH ape afer processing Input devices ‘Nerenol yet invented and punched cArds were used for entering the data. The fOCESS COI fet understood with an example, Suppose certain grac& marks were to be added to the students depending on varied factors, The grace marks ‘were punched ‘on cards in an sequential order. ‘The data from tapes is read, ‘Simultaneously and it is added to grace marks in Punched card. The result of the processing is again stored back into a new tape. Disadvantages : (i) Data must be read sequentially (Gi) Main mergory is not sufficient to load data. i) No operating system was available and hence the setup time is high, (iv) Implicit scheduling was required 1960s-1970s . Database management system could enhance its features with invent of hard disk, Unlike files, hard disk suppor'y andom access of files. This feature Were used to develop network and hierarchical database, ‘ook for ths at GROUP Loco {5 on the TITLE COVER before you buy UNIT-1_ Database System Applications, Introduction to Database Design 111 Disadvantages (Rett datas required to he soe in consequent blocks of memory For example, stent marks record were reauined to be stored very next tothe sft details record, This provide efficient original query responses but fails to Pro solutions for new complex queries. (ii) Data reorganization is time consuming Gi) Every query has to be programmed. 19805 Relational data were not in practice until 19608 and 1970s. With the development of system R, the implementation of relational database improved drasticaly. System R, i an IBM research product based on SEQUEL, [provides a mechanism 0 ‘validate feasibility of relational model, SQLIDS, IBM DB2, Oracle, Ingres, DEC Rab are some earlier relational database system, Advantages (Easy implementations. (Gi) Programmer relieved from low level implementation details, (Gi) Queries need not be coded in procedural fashion. iv) Programmers work only at logical level, 19908, ‘SQL language was developed in early 1990s. Tis is designed for query intensive applications. In 1980s the focus was on updaté intensive application however the focus was shifted on decision support systems in 1990s. Obj the inital stage. _ a Furthermore, due tothe development of Enterprise Resource Planning (ERP) and Management Resource Planning (MRP) packages, an additional layer of application-oremted features is designed on top of DBMS. These application-oriented featured packages are nothing but systems from SAP, Oracle, People sof, Bean aiid Siebel. These packages typically determine common functionalities lie Human Resource Management, Financial Management and Inventory Management which are generally used by most ofthe organizations. Subsequently, it becomes cost effective for the organizations and the data gets stored in DBMS. Here, the layer can be modified according to the organizational requirements which reduces the burden and cost of developing the layer from beginning. In irst generation computers, the data on websites was stored in the operating system files then, later the data was stored in « the DBMS and accessed by users through web browser. The user-requests ae fetched and their respective responses are generated using HTML then they are displayed on the screen In this generation, DBMS functions are getting advanced and it includes visual effects multimedia, streaming data, live Videos, digital libraries, scientific projects, google maps and ISRO’s earth observation system project. E _ 14-2 The Data Model, Levels of Abstraction in a DBMS Q21. What is view of data? Explain briefly about data abstraction, instances and schemas. OR Explain the following, : : (i) View of data (il) "Data abstraction (ii) Instances and schemas, Answer : (a) View of Data Database is a collection of large volumes of data. A user will not always the database system io provide only the dat thats required to the user. ‘d°102, may not be provided with all student details. Similarly, a programmer who wishes to enhance the features of database system isnot concerned about te dat, but need to know how i data stored, Hence at sditteen ten ifferent users need different view of data. SPECTROM ALLINONE JOURNAL pom cna ee . SPECTROM ALL-IN-ONE JOURNAL POR ENGINEERING STUDENTS SIA GROUP a May-17(R15), a2(0) Tequire complete data, so the responsibility of ‘user who wishes to see the record of a student with . ITU-HYDERABAD) eae * DATABASE MANAGEMENT SYSTEMS [JN (>) Data Abstraction levels of abstraction in DBMS, In DBMS. the data can be abstracted in three levels (or in other words there are thee levels of ee shan atthe three level abstraction in a DBMS isto separate the user's request and the physica ans a plan that explains the means end nalata abstracted at cach ofthese levels is deserbed Ry a word scheme, A scheme means a pl stematic plan for achievin 2 re aa between them. at each level. Basically the word scheme, means a systematic pl “ ome objective, is used in the database literature with the word “chore” @ i) ‘The three levels of abstraction are, (i) Externalview level (i) Concepruadtogicat levet (ii) Intemal/physical level, a Ee) Ee] - a =o a S| oo ‘Lesesee_| Logical Level oe, [Pr I (OR) tim |= on roca vw | RCE fe) ; Figure: The Three Lavels of Abstraction/Architecture of DBMS External/View Level aay highest level of abstraction isthe external level or view level or extemal schema, where only those portions of the database are displayed, which are requested by the user, but not the eatie database. Any given database has exactly one Stacehina! schema and one physical schema, but it can have more than one exienet schemas, each connected with a group Spud and relationships, that can be stored in the database. It can ’ng the records in the external schema from ually guides the user: requirements. For example, the students are allowed to find out the names This can be done by defining the following view; Course (cid: String, fame : String, enrolment: integer). Therefore, A user can {teat a view just like a relation and ask ‘questions (queries) about the records in the view, Conceptual/Logical Level ‘The next higher level of abstraction isthe conceptual level or logical evel Cr conceptual schema where the entire information OF the database is displayed. Ths level is used by Database Administrators (DBA), who decide what information is to be Stored in the database. Any given database has exactly one conceptual schema conniccted with both extemal schema, to display the information ofthe user's request and intemal schema, to store the information in the database, ‘The conceptual schema is used by DBA anly to write the information in the database using Data Defrition Language @DL). If physical ‘e+ (hide ftom physical details, how data is stored) isto be achieved, then those DDL definitions must not involve any considerations of physical ebresentation or access technique at all then, they must be definition of information content only. Thus, there must bé no reference in the conceptual schema to store field UNIT-1_ Database System Applications, introduction to Database Design ae | (i) TnternavPhysteat Level yh lowest ve of atraton the ira level or physical level ops hema or intra schema which exis how the dat is actualy stored. The Internal Schema is writen using yet another Data Definition Language, the intemal DDL. The internal ‘explains the various types of stored records, what indexes exist, how stored fields are represented, I Sequence the stored records are in, and s0 on. Thus, at the Internal schema/physical level, very complex a structures ae used, (©) Instances and Schemas ‘Whenever some information is inserted or deleted, thee willbe some change in the database. An instance ofthe database the collection of information whichis stored in the daiabase aia particular moment, whereas database schema isthe overall design ofthe database. ‘The database schemas and instances can be better understood by analogy toa program written in a programming language. Here a database schema corresponds tothe variable declarations inthe program. Every variable has a certain value ata given instant. Ata particular time, the values ofa variable in a program corresponds 1 an instance ofa database schema. ‘According to ANSUSPARC architecture there is schema foreach level of abstraction. The external schema provides a definition for external view of data written in exterrial DDL. The conceptual schema provides a definition for conceptual view of data. This definition should be independent of physical storage and access methods 10 provide for data independency. As the extemal view is derived from conceptual view, the data independence at conceptual view will reflect in the external view. The conceptual view is written in conceptual DDL. The internal view is designed by internal schema written in internal DDL. It defines how data i stored, its indexes, the sequence of data et 22. Explain the difference between Logical and Physical data independence. Answer : Logical Data Independence Physical Data Independence | 1. | Ibis high-level of data independence. 1, | Itis low-level of data independence. | 2. | Itis related to conceptual schema where in 2. | Hisretated to external schema where in actual | different logical views of data are provided to data storage activities are performed. | different users, | 3. | The changes are made tothe conceptual 3. | The changes are made to extemal schema without schema without affecting the external schema. affecting the conceptual schema. 4. | Modification are done on data structures such Modification’s are done on storage structure such as entities, attributes, relationships. as storage devices, indexes, switching. 5. | Itprovides data integrity and data effectiveness. | 5. | It provides data optimization and data reorganization. 6. | Itdefines relationships among data by using 6. | _Itdefines relationships using complex low-level simple structures, data structure. 7. | Application programmer must maintain the 7. | Application programmer need not maintain the information about logical organization. information about physical organization. 8. | The implementation details are not visibie to 8. | The implementation details are transparent to the the users. users. Itis difficult to maintain, 5._| this easy to mainain. 23, What Is a data model? Explain ER data model. Answer + : : (Model Papers, a2(b) | Apri-11, Set2, 03(b)) Data Model : Data Model is a mean of modelling data i, to give a shape tothe data (or) to give a figure to the stored data. A ita makes easier to understand the meaning ofthe data by its figure and ensure tha the users understand, + Adata mode! % The nature of the data without requiring any physical implementation details % The view of data from other user’s perspective ‘© — The use of data across application areas, SPECTRUM ALLAN-ONE JOURNAL FOR ENGINEERING STUDENTS SIA GROUP 2D E MANAGEMENT SYSTEMS [JNTU-HYDERABAD) 1,14 DAT eee ‘Types of Data Model ‘The data models ate divided into three different groups, which are as follows, (a) Object-based logical models . (b) Record-based logical models (©) Physical data models, (a) Object-based Logical Models Object-based logical modes are used in deeribing date at logical-level and view-level. Logical level is used by DBA. so as to make a decision regarding what data are to be stored in the database and what relationships must exist among those data. On the other hand, view level describes only part of the entire database that isto be viewed by the database user i.e. it hides the details of the information stored, The different types of object-based logical models include, (i) The emtity-relationship model ii). The object-oriented model (iii) The semantic data model (Gv) The functional data model, (The Entity-Relationship Model An entity is a real-world object that can be uniquely identified. The Entity-Relationship Model (E-R Model) is based on a collection of basic objects called entities and the relationship among these objects. Basically, F-R diagram is the gruphical representation of the entire logical structure of database. ‘Symbols Used in E-R Model ~+ Rectangle represents enti —__~+ Diamond represents relationship among entice >_> Ellipse represents attributes (characteristics of entities) — — Lines represent link of attributes to entities to relationships. Consider the following E-R diagram, ‘Customer-cit Qecou ‘Customer Depositor Figur: 8 Mol The above E-R diagram consists of two entities (customer and account) and one relationship (depositor). The depositor relationship specifies the association between customer and account. When customer opetis account, the customer should specify the attributes Customer_name, Customer_number, Customer_city and Account should specify the attributes, Account-number and Balance. (ii) The Object-oriented Model a 7 the E-R model, the object-oriented model is based on a collection of objects. An object contains values stored in instance variables, methods (bodies of code) that operates on the object. Objects containing similar types of values and similar methods are combined to form classes. A class defines objects ‘The only way in which one object can access the data of another object is by invoking a method of that other object. This action i called sending a message othe object. Thus, the call interface ofthe methods ofan object defines hat objects are externally visible. The internal part of the object, the instance variables and method code are not visible externally. The result is two levels of abstraction, Look for the SIA GROUP LoGo {ff on thie! TITLE COVER before yelPUNy UNIT-1_Databesi Systom Applications, introduction to Database Design AAS o® (il) The Semantic Data Model A semantic i ‘A vemantic data rode! is more high-level dat model that mies it emer for a wert give starting desctnon nina rein Thao res comin wide wsiety of elon at ape ode ibe a real application semetio. ADEMS cana apport hese reli decison wih ew relations known as relational ‘model S. A widely used semantic data mode! is the Entity- Relationship (ER) data model which allows us to graphically denote entities and relationship between them. “oe , (iv) The Functional Data Model ‘The functional data model makes it casicr to define functions and call them during data processing. Record-based Logical Model Record-based logical model describes data at logical and view levels. It stores the data inthe form of records (documents) of several types. Each record has fixed number of (fields or attributes and cach field contains fixed tenth In comparison to object-based data model, the record-based logical model describes the overall logical structure of the database with higher-level implementation ‘The record-based models are of three types, (i _ Relational model (ii) Network mode! (iii) Hierarchical model @ Relational Mode! “The relational model represents both data (entities) and relationships among data in the form of tables __-has multiple columns with a unique name. Consider the following relational model Example Each table ‘Customer Relation City | Ace. No. Hyderabad | 7888 Hyderabad | 1500 2523_| tustomer and Account relations, itcan called relations. From the above Ci ; snd their deposit details are maintained description of data in terms of tables Hi xed in Customer relation database be inferred that Customer details are maintain in Account relation database. ) Network Model ° Network model represent data inthe form of eoletion of esas wid relationships among data are represented by Tinks, The links can be viewed as pointers. Example at ses | 700 | Hameed | Musheerated | Hyderabad }——| : Fahmat | Khairatsbad | Hyderabad Fazal | Abids Hyderabad : 116 DATABASE MANAGEMENT SYSTEMS [JNTU-HYDERABAD} (i) Hierarchieat Modet Hierarchical mode! is same as the network model ic. data in the hierarchical model is represented as a collection of records and relationship among data and are connected by links. The links can be viewed as pointers. But, the difference between these two models is that in network model the records in the database are represented in the form of graphs, whereas in hierarchal model, they are represented in the form of trees. | Musheerated yeaa | Differences between the Models Tee Tational mode! differs from the network and hierarchical models. .c. rom the fact that it does not use pointers or links. Instead, it associates records by the values it holds, (©) Physical Data Models Enysical data models give the description of data at the lowest level. It describes about the storage of data in low-level data structures, ‘Two types of physical data models are, © Unifying model $ _Frame-memory model. Q24. Give an overview of ER model. Answer : ER Model For answer refer Unit-, Q23, Topic: The Entity-Relationship Model Entities ‘An entity isa real-world object that can be uniquely identified. There are two types of entities. (i) Strong entity (Gi) Weak entity. @ Strong Entity ‘Strong entity is the one that does not depend on other entities. For example, a chairman of a company does not depend on anyone for final decisions. Hence, Gi) Weak Entity Weak entity is the one that depends on other entities for existence, For example, if an employee is retired then we do not need to store the di (Children) entity is weak entity. chairman is strong entity fetal of his dependents. Hence, the dependents Relationships Relationship is an association among various entities. The entities that tke part in a relationship are called “participants” and the number of participants of a given relationship are called “degrec” of relationship. {fevery instance ofan entity participates in at last one instanceof a relationship, then the participation is said to betta else, it is said to be partial participation. A rrelationship can be one-to-one, one-to-many or many-to-many. Attribute Each entity and relationship has a property called attributes. These attributes can be, @ ‘Simple Attributes ‘These attributes are also called as atomic attributes which cannot be subdivided further. For example, the attributes like roll number and class of ‘student’ entity cannot be further subdivided. Look for the SUA GROUP Loco { on.the TLE Gover before youbuy UNIT-1 ‘Database Systom Applications, Introduction to Database Design aii) ponite Attributes Am attribute which can be further divided into smaller ‘components are called composite attributes, For example, the attribute name can further be divided ‘nto ist name, middle name and last name. Similarly, the attribute address ean further be divided into house ‘number, city, stret, country (lil) Single-valued Attributes ‘Certain attributes take only a single value in all instances. For example, the age of a person is a single-valued attribute as man cannot have two age. (iv) Multi-valued Attributes Attributes that can have more than one value at a time for an instance are called multi-valued attributes. For ‘example, the color of the product. A product might be multicolored in this case it takes more than one value at atime, (v) Stored and Derived Attributes Some attributes need not be stored, but can be derived from available other attributes. For example, the total numberof students ina clas can be calculated by counting the numberof student records. Similarly, the age of a student can be calculated, by subtracting the date-of-brth field from present date. The age field is called derived attribute and date-of- called stored attibu 25. Write a note on speciality databas: OR What are speciality databases? Explain. Answer ‘Apts0(R48), 310) ‘A speciality database can be defined as an electronic repository which is located in a computer's RAM for storing specialty related data and met adata. This type of databases are used to perform operations data search, data retrieval, data manipulation and data calculation. Inorder to overcome the restrictions possessed by relational data model, database developers have developed multiple data models. Object based data model and semi-structured data model are the two data ‘models based on specialty database. (Object Based Data Model |, 023, Topic: The Object-oriented For answer refer Unit Model, (ii) Semi-structured Data Model Semi-structured data models allow data specification ‘only where each data item of similar type contain different set *\ of attributes. An Extensible Markup Language (XML) is widely used to represent semi-structured data. 1.17 Q26. What are application programs? Explain data- base accoss for application programs. Answer . Database Access for Application Programs Application programs are the software codes that enable ‘user to interact with the database, The application programs ‘access the database in two ways, (i) By using application programming interface (i) By extending the host language syntax. Several application development environments, provide 4 platform for developing applications and include facilities that enable GUI designing and other features that enhance the quality of the software. Some of the application development environments are Sybase, JBuilder. (@) Application Programming Interface (API) Application Programming Interface is set of procedures that sends the DML and DDL to database statements and retrieves the results after processing from the database. ‘The commonly used API include ODBC (Open DataBase Connectivity), and JDBC (Java Database Connectivity). The APIs provides an interface for application programs written in C and Java respectively. main( ) Datatase Appliction Programming Interface Figure: Application Programs Accessing the Database Through Application Programming Interface (ii) Extending Host Language Syntax Database can also be accessed by extending host language syntax so as to embed DML statements within the host programming language. SQL (Structured Query Language), which isa database sub-Language is embedded ina programming language, For example, COBOL stat EXEC SQL SELECT * SPECTRUM A@LIIM-ONE JOURNAL POR ENGINEERING STUDENTS SIA GROUP 7, 1.18 FROM emp. WHERE emp_name = “Vivek_Verma* END-EXEC The execution of these SQL embedded statements is different from the normal execution. A special compiler called SQL precompiler is used to compile the source code. 1.1.3 Data independence, Structure of a DBMS: : Q27. identify the main components in a DBMS and briefly explain what they do. ‘Apriuitay-12, Set, Q1(0) OR What are the main components in a DBMS and briefly explain what they do? Answer + May-17R(15),a2(0) Generally the user interacts with the database ‘management system through an interface. The DBMS does the processing and retrieves the data from the database. Database system is divided into two modules, 1. Storage management 2. _Query processing. Database Figure: Database System Structure Data stored in database may costs more than trillion bytes of data. Main memory cannot accommodate for such large amount of data, hence the data is stored in disk. But for processing data needs to be transferred from disk to the main ‘memory. But this transfer consumes processor time, hence the data needs to be arranged such thatthe data transfer rate is not too high. This is taken care by storage manager. DATABASE MANAGEMENT SYSTEMS [JNTU-HYDERABAD| 1e main task of database system is to provide the user with simplified view of data, This is achieved by hiding the physical level implementation details from the user, the user is provided with only high-level view. But, fr faster procesing the ‘operations need to be done at physical level. The queries at logical level into optimal sequence of operations at physical level 1. Storage Management thatis Storage management is handled by storage manager ‘basicaly a program module. This module acts as an interface Betver low-level data stored in database and the application programs, ‘Application Programs Storage managehient | Figura: Storage Management Data is stored in disk using file system provided by operating system. The storage manager provides interaction With file manager and converts the complex DML statements into low-level file system commands. In addition to this, storage ‘manager is responsible for storing, retrieving and modifying data ‘within the database, Storage manager consists of the following key components, 7 (Transaction manager Gi) File manager ii). Buffer manager. (iv) Integrity manager (v) Authorization manager. ‘Transaction Manager ‘It manages the transactions so as to ensure that data remain in consistent state even after the system failures. It also enables the execution of concurrent transactions without any conflicts. File Manager It manages the process of allocating disk and data structures that are used for representing the information sayed on disk._ Buffer Manager Ithandles the transfer of data from disk onto the main memory and decides what-data must be kept in mairt @ w TeMory. (iv) Integrity Manager It verifies whether the integrity constraints defined 0” the data are Satisfied, = w tion Manager It checks the authority of users 1d allows only authorized users to access the data, Look for the SUA GROUP LOGO {5 on'the TITLE COVER before youbuy UNIT-1|_Database System Applications, introduction to Database Design The following are the different data structures used by storage manager, (a) Data Files ‘These are the files that contain the database (©) Data Dictionary Ue maintins metadata regarding the different data structures sein database ©) Indices "provides fast access to the required data items 2 Query Processor yh (@ Interpreter of Data Definition Language Statements DDL statements written by DBA to define the schema are interpreted and stored in the data dictionary. (i) Compiler of Data Manipulation Language Statements. (- As any other compiler, DML compiler converts the DML statements in low-level instruction. It also optimizes the query. i.e., perform “query optimization” Gi) Query Evaluation DML compiler converts DML. ther Moco | #Bemner | Sess" | pon t t i Application | Programs | Toots | Tooke Data Storage Structure Figure 28. What is data independence? Explain the two levels of data independence. ‘Answer : Model Papert, Q2(0) Data Independence . ltering a schema definition in the next higher level known as data Modifying a schema definition in one level without kno independence. The concept of data independence is similar in many aspects to the concept of abstract data types in “gramming languages. Both implementation details from the users, allows them to concentrate on the general structure, rather than sia Group i on low-level implementation details. SPECTRUM ALL-}N-ONE JOURNAL FOR ENGINEERING STUDENTS { DATABASE MANAGEMENT SYSTEMS [JNTU-HYDERABAD) There ate two levels of data independence. They are, (Physical Dy Independence _ sical data independence ‘Changing the physical schema without causing a change in application program: bshdaliied aed ag? RCUVItes [ibs low-level of data indeperidence and is related to external schema wherein act Tt SHEE Ris are performed. Msification are done on storage sructure such as slorage deviees, indexes, switching Perform modification at physical level so as to enhance the performance level, Physical data 0 Mlepenadence defines the relationships using complex low-level data structure. Apart from this, also provides Imization and data reorganization, (ii) Logical Data Independence Changing the conceptual schema without causing a change in application programs is known as logical data independence. This is done so as to provide a means to go back from the external schema to the internal schema in order to retrieve the {anous Portions of the database separately based on the user's requirement. The modifications at the logical level are to ‘x performed whenever the logical structure of the database is altered, For example, the banking database system is to be ‘wadified when changes are made to market accounts, When compared to physical data independence, level of logical data indepe ‘mors difficult data independence, because the centralized control of the database is heavily dependent on the logical structure of the database so as to store (o) retrieve the information, : Q29. Write short notes on transaction management. janagement lon refers oa series of actions suchas read, write, abort and commit, which are performed by DBMS. Transaction hanagement refers to managing the transactions such thatthe data remain in consistent state even after the execution of the ‘transactions, It also provides optimal concurrent execution of the transactions, Log During the execution of transactions, if some changes are made tothe database then a failure may occur, which is referred {os “sostem crash’. Inorder to avoid this failure, the changes made to the database must be stored in the form of records by using a database structure called Log. These records contain the information about all the update activities, Now, to ensure thax the stored formation is available a the time of recovery fiom a system crash, a principle called wrte-ahead logging need to be ensured Fe te this principle the information regarding any sort of changes made tothe database object must initially be seconded in the log record. These log records are maintained asa sequential file and the write operations performed on these ‘eeords are sequential writes. But, prior to storing the information about the changes into the dis, its necessary to force each and every log record including the record whose LSN is ‘equal to the page LSN must be stored in the stable storage. ‘When the database is recovered from a system crash huge amount of time is consumed. Thus, to reduce the time on Gheraion caled') Modeling and normalizing E-R model (©) Verifying data model. (@)_ Designing distributed database. Look for the SIA GROUP Loco on the TITLE CovER before you buy’ UNIT-1. Database System Applications, Introduction to Database Design 1.27 oo }.__ Selecting a DBMS Software ‘The designer selects a DBMS software that support the database application prior to performing logical design. This selection process is very critical to the information system and therefore must be performed such that the selected software carries cut all it functions efficiently. Following are the steps considered while selecting a DBMS, (a) Defining the terms of reference. (b) Selecting two or three DBMS products. (©) Evaluating the selected products. (@) Selecting an efficient product. 3. Creating a Logical Database Design ‘The conceptual database design is refined and mapped onto logical database. This is independent of physical level implementation and is derived based on data model. The logical data design is normalized to avoid fedundancy. However. in relational DBMS, the task of logical database designer isto convert ER schema into relational database schema. The design requires that every object must be mapped with specific constraints that are used while selecting the software. The logical design basically converts the software independent conceptual model into software dependent model by defining the required tables domains. 4, Creating Physical Database Design (Creating physical database design is a process wherein the characteristic features of data storage and data access are selected. ‘These characteristics specifies the type of device, data access supported by the hardware and system respectively. The design of database can influence both the data location as wel as the system’s performance. This process becomes difficult when 4 distributed across multiple locations. This is because the performance of the system is affected by the efficiency of communication media. Logical and physical database design can be performed parallely in hierarchy and network models. Step III: Implementation and Loading Phase ‘Afier the completion of all the design activities the database and application process can be implemented, The datahase is implemented using Data Definition Language (DDL) of a GUI. DDL statements are used for creating database structure and ‘empty database file. The application program is implemented using 3GL or 4GL languages. The parts of application program corresponds to the database transaction that are implemented using DML of target DBMS. In this step, the security and integrity controls associated with the applications are also implemented using DDL. During implementation and loading phase, the user must consider certain criteria regarding performance, security, backup ‘and recovery. DBMS have a utility program that is responsible for loading the existing files into the new database. This utility generally requires the specification of both source and destination databases. Once the specifications are known, the utility petforms data Conversion wherein, data is converted into the required format of database files. Before performing the loading process, a proper planning is to be made so as to ensure a smooth transition between the entire conversion operation, Step IV: Testing and Evaluation Phase Database administrator performs the testing phase so as to verify the performance integrity, security constraints and to ‘detect errors in the application. Itis necessary to thoroughly test the newly developed database application by employing different test strategies and realistic data. If testing is performed successfully, then the errors present in the application program and in the database stricture are uncovered. In addition to this, testing also verifies whether the database and application program are developed in accordance to the specification and whether all the essential performance requirements are satisfied. ‘The testing and evaluation phases are performed parallely with application programming. The program basically use database tools (screen painters, menu generator, report generator) to develop a prototype of the application, while program coding is performed. Prototype is a working model used by the users in order to identify the inadequate or correct functioning features. ‘The advantage of developing prototype is that, it helps in understanding the requirements of users and system developers and in evaluating the feasibility of particular system design. If any of the evaluation criteria are not fulfilled while implementing the sates then the system must be enhanced either by modifying the physical, logical design or by upgrading the DBMS software or hardware. SPECTRUM ALLIN-ONE JOURNAL FOR ENGINEERING STUDENTS SIA GROUP NBA s . — ay ee ; : DATABASE MANAGEMENT “er itithas successfully unders Database application is said to be operational, if it has nd ma initiates i pahening ae rei process. In this phase both minor testing phase are detected, i sent mene Jar basis within the databaye Database administrators reaponibe for performing the mainenance activites on eR of thee activities include, (©) Performing preventive, corrective and adaptive maintenance. (i) Preparing system usage summaries and security audits periodically. © aaron tn on is because of new infomation requirements, new query formats and demand for eee es ane nly ifthe design of database is flexible and if the documentation available is sae sh Q35. Name the main steps'in the database design. What Is the goal of each step? In which steps R model mainly used? Amewer : ‘There are two approaches for database design, 1. Top-down approach 2 Bottom-up approach, 1. Top-down Approach Top-down approsch begins with design of data models, The high level entities and their relationships are explained in these data model. The low level entities are understood ‘long with the design process using top-down approach Entity relational ‘model uses top-down approach and is suitable for complex databases, 2 Bottom-up Approach Bottom-up approach begin with the collection of entities, ‘nd their relationships. Itis suitable for designing simple databases ‘with few attributes, “Tnside-out' and ‘mixed strategy’ are the two thet approaches for database design, Fa oe naa] arly Flours: Approsch for Database Design ‘Top-down approach is used for ER models. It invoh © Requirements Colicetion and Analysis rene eine ‘collect the information ofthe. Organization and analyses, thei ves six steps in database design Process, inforntation to identity the users UNIT-1 Database System Applications, Introduction to Database Design > iX User view 1 ‘User-1 —__ ve User-2 BA Allusers view User Userview-3 ER model Figure: Requirement Analysis ‘After requirement analysis, the designers design based on what data is required, what are the applications used on that data and frequent operation performed. (ii) Conceptual Database Design Once all the requirements are available, a conceptual database design is developed. This design includes all the entities and their relationships. It does not include physical level implementation details and hence is easily understood even by non-technical users. Ths is used only to satisfy the users tht the specified requirements are met and are not contradicting. (iil) Logical Database Design “The conceptual database design is refined and mapped onto logical database design. physical level implementation, but is derived based on data model. is also independent of ‘Thé logical database design is normalized to avoid redundancy. However, specific to relational DBMS, the task in logical database design is to convert ER schema into relational database schema. Beyond ER Design ‘The first three steps are more relevant tothe ER model. Once the logical schema is defined, designer oonsiders the physical level implementation and finally provides certain security measures. (iv) Schema Refinement ‘The entities and relationships are analysed to identify the potential problem and solve the problem, which is called as schema refinement. (©) Physical Database Design ‘The physical implementation details are focused in this step. The storage structure, indexes and clustering tables are ‘designed in this phase. The expected load is estimated and the database schema is further refined, if required. (i) Security Design : ‘The last step of database design is to include security features. This is required to avoid unauthorized access to database. SPECTRUM ALLIN-ONE JOURNAL FOR ENGINEERING STODENTS Sia Group

You might also like