
DATABASE MANAGEMENT SYSTEM For COMPUTER SCIENCE DATABASE MANAGEMENT . SYSTEM SYLLABUS ER model. Relational model: relational algebra, tuple calculus, SQL. Integrity constraints, normal forms. File organization, indexing (e.g., B and B+ trees). Transactions and concurrency control. ANALYSIS OF GATE PAPERS Exam Year 1 Mark Ques. 2 Mark Ques. Total 2003 2 3 8 2004 2 5 12 2005 3 4 11 2006 1 4 9 2007 - 6 12 2008 1 5 11 2009 - 5 10 2010 2 2 6 2011 - 2 4 2012 2 5 12 2013 - 3 6 2014 Set-1 2 3 8 2014 Set-2 2 3 8 2014 Set-3 2 3 8 2015 Set-1 2 2 6 2015 Set-2 2 2 6 2015 Set-3 2 2 6 2016 Set-1 4 1 6 2016 Set-2 2 2 6 2017 Set-1 2 3 8 2017 Set-2 2 4 10 201 8 3 2 7 © Copyright Reserved by Gateflix.in No part of this material should be copied or reproduced without permission CONTENTS Topics Page No 1. THE ENTITY – RELATIONSHIP MODEL 1.1 Introduction 1.2 The E – R Model 1.3 Database Administrator (DBA) 01 1.4 The Entity Relationship Diagram 01 01 2. RELATIONAL MODEL 01 2.1 Levels of a Database System 2.2 The Attributes and tuples of a Relation Student 2.3 Keys 04 2.4 Relational Database Design 05 2.5 Network Data Modelling Concepts 06 06 3. TRANSACTIONS 08 3.1 Transactions 3.2 Serializable Schedule 3.3 Recoverability 11 3.4 Recoverable Schedules 12 3.5 Cascade less Schedules 13 3.6 Implementation of Isolation 13 3.7 Transaction Definition in SQL 13 3.8 Testing for Serializability 14 3.9 Tests for View Serializability 14 14 4. QUEL 14 4.1 Quel 4.2 Sequel 4.3 Assign to 15 4.4 SQL 15 4.5 Select Statement 15 4.6 Defining a null Value 15 4.7 Duplicate Rows 16 4.8 Character Strings and Dates 16 4.9 Comparison Operators 16 4.10 Logical Operators 16 4.11 Character Functions 16 17 18 © Copyright Reserved by Gateflix.in No part of this material should be copied or reproduced without permission 4.12 Working with Dates 4.13 Types of Joins 4.14 Group Functions 20 4.15 Sub Queries 21 4.16 Data Definition Language (DDL) 21 4.17 Views 22 4.18 Data Manipulation Language (DML) 23 4.19 Queries 26 4.20 One Possible Database State Corresponding to the 26 Company Scheme 30 4.21 Terminology Used in a Relational Database 4.22 Table Sal Grade 30 33 5. FILE STRUCTURE 33 5.1 Records and Record Types 5.2 B-Trees and other Data Structures 5.3 DBMS 36 5.4 Existence Dependencies 40 43 6. GATE QUESTIONS 46 7. ASSIGNMENT QUESTIONS 51 © Copyright Reserved by Gateflix.in No part of this material should be copied or reproduced without permission 1 THE ENTITY – RELATIONSHIP MODEL 1.1 INTRODUCTION 4) Performance monitoring. 5) Strategy design for backup and An entity is any object, place or activity recovery. about which an enterprise keeps data. It is 6) Authorization checks and validation an object which can have instances or procedures. occurrences. An entity type is a set of 7) Decides the information content. objects which share common properties. The Database Design consists of three 1.4 THE ENTITY RELATIONSHIP DIAGRAM components: Conceptual Design on the basis of user requirements, Data Modeling 1.4.1 RELATIONSHIPS AND RELATIONSHIP (Entity – Relationship Diagrams and SETS Normalization), and Physical Design, and Implementation. The major step in A relationship expresses an association conceptual design is to identify entities and between entities. A relationship set is a set relationships, which reflect the data in a of relationships of the same type. A natural way. The aim of this step is to relationship may also have descriptive specify the conceptual structure of the data. attributes. For example, data (last data of This is known as data modeling. The Entity account access) could be an attribute of the – Relationship (E – R) model is used as an relationship set. information model to develop conceptual structure. 1.4.1.1 MAPPING CARDINALITIES 1.2 THE E – R MODEL It indicates the number of entities with which another entity can be associated via The E – R data model considers the real a relationship. The degree of relationship is world consisting of a set of basic objects called cardinality. and relationships among these objects. A a) One-to-one: An entity in A is associated number of attributes are associated with an with at most one entity in B, and an entity and the attributes describing it. The entity in B is associated with at most set of all entities or relationships of the one entity in A. same type is called the entity set or b) One-to-many: An entity in A is relationship set. associated with any number in B. An entity in B is associated with at least 1.3 DATABASE ADMINISTRATOR (DBA) one entity in A. c) Many-to-one (N:1): An entity in A is All controlling of a database system is done associated with at most one entity in B. by database administrator. An entity in B is associated with any number in A. 1.3.1 FUNCTIONS OF DBA 1.4.2 KEYS 1) Decides the storage structure and Differences between entities must be access strategy. expressed in terms of attributes known as 2) Creation of data dictionary for keys. These facilitate us to uniquely identify statistical analysis. each entity in a set. 3) Responding to changes in requirements. © Copyright Reserved by Gateflix.in No part of this material should be copied or reproduced without permission 1.4.3 SUPER KEY 1.4.7 AGGREGATION It is a set of one or more attributes which The E – R model cannot express put together enable us to identify uniquely relationships among relationships. When an entity in the entity set. would we need such a thing? Consider a database with information 1.4.4 CANDIDATE KEY about employees who work on a particular A super key may contain extraneous project and using a number of machines for attributes, and we are often interested in doing that work. the smallest super key. A super key for We get the E-R diagram shown in Figure. which no subset is a super key is called a candidate key. 1.4.5 PRIMARY KEY It is a candidate key (there may be more than one) chosen by the database designer to identify entities in an entity set. The idea of strong and weak entity sets is related to the existence dependencies such as the member of a strong entity set is a dominant entity, and the member of a weak entity set is a subordinate entity. A weak entity set does not have a primary key, but we need a means of distinguishing among the entities. Relationship sets Working and Uses could be combined into a single set. However, 1.4.6 GENERALIZATION they shouldn’t be, as this would obscure the logical structure of this scheme. The Generalization hides differences and solution is to use aggregation. It is an emphasizes similarities. Distinction is made abstraction through which relationships through attribute inheritance. are treated as higher – level entities. For Attributes of higher – level entity are our example, we can treat the relationship inherited by lower - level entities. set Working and the entity sets Employee and Project as a higher –level entity set called Working. Following figure shows the E-R diagram with aggregation. © Copyright Reserved by Gateflix.in No part of this material should be copied or reproduced without permission Transforming an E-R diagram with aggregation into tabular form is easy. We can create a table for each entity and relationship set as before. The table for relationship set Uses contains a column for each attribute in the primary key of Software Tool and Working. © Copyright Reserved by Gateflix.in No part of this material should be copied or reproduced without permission 2 RELATIONAL MODEL 2.1 LEVELS OF A DATABASE SYSTEM 2.1.1 DOMAINS, ATTRIBUTES, TUPLE & RELATIONS The relational model represents the database as a collection of relations. A domain D is a set of atomic values. By Informally, each relation resembles at automatic we mean that each value in the stable of values or, to some extent, a “flat” domain is indivisible as far as the relational file of records model is concerned. A common method of specifying a domain is to specify a data type from which the data values forming the domain are drawn. It is also useful to specify a for the domain, to help in interpreting its values. Some examples of domains USA – phone – numbers: The set of 10- digit phone numbers valid in the United States. Social –security – numbers: The set of valid 9 – digit social security numbers. Employee – ages: Possible ages of employees of a company; each must be a value between 15 and 80 years old. Academic – department – names: The set of academic department names, such as computer Science, Economics, and Physics, in a university. Academic –department – codes: The set When a relation is thought of as a table of of academic department codes, such as CS, values, each row in the table represents a ECON and PHYS, in a university. collection of related data values. In the The preceding is called logical definition of relational model, each row in the table domains. A data type or format is also represents a fact that typically corresponds specified for each domain.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages143 Page
-
File Size-