0% found this document useful (0 votes)
35 views49 pages

LSM (Unit 2)

Notes onInformation system management unit 2

Uploaded by

John Joseph
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
35 views49 pages

LSM (Unit 2)

Notes onInformation system management unit 2

Uploaded by

John Joseph
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 49
Introduction to Database Systems (Unit 2) - <7 A , Introduction.to UNIT 2 ye Ne tal ry 3 DATABASE SYSTEMS 2.1.1. Introduction Data is one of the most important business assets. It is only useful when it is suitably managed. When data is properly managed, it transforms into information which can be utilised in making business decisions. Organisations can only survive when it takes optimised decisions in the highly competitive market. The optimal business decisions can be made only if organisation is able to efficiently collect, organise, analyse and interpret data and get proper information. Now we can understand the importance of data management in all business operations. The data is efficiently managed in a database by using a database management system. The database management system is a software package which efficiently manages a database. The database is created and maintained by an integrated set of programs termed as the Database Management System (DBMS). Conveniently and effectively defining, storing, retrieving and manipulating the data contained in the database, is the major aim of the DBMS. ‘A Database Management System (DBMS) is a software tool used to perform Various types of operations on Data in a database and creates a convenient and efficient environment which helps the user to access data easily. “DBMS (Database Management System) is software that helps in efficient and convenient use of database by utilizing and maintaining huge collections of data”. Some commercial databases are ORACLE, INGRESS, MySQL and SYBASE etc. Figure 2.1 illustrates the overview of DBMS. Operating System Database Management System Application Programs Dictionary Database Development ¢ Interroga “e Maintenance Application Develoment Figure 2.1: DBMS BBA Fifth Semester (Information System Manzgemeny , 38 2.1.2. Database i s ta Database is as an organized collection of data, so that a computer Pro, a tipl ar easily and quickly access the needed data, so, multiple users can shag various purposes. ‘ ‘ ; and stored in st “A collection of information that is grouped ructureg wy called database”. i The gathered information which is helpful in retrieving the necessary nj, : is termed as a database. Various categories of information such as els Printed, graphic, audio, statistical, combinations can be part of the ith information. Two types of databases are physical and electronic database, The database can either be very complex or simple. Simple database ¢,, ‘ includes, in an address book alphabetical arrangement of _ hames Wher complex example isa database providing information in a combination of fq Non-computerised database examples are: a dictionary, a phone book, ; collection of recipes and a TV guide, whereas the computerised databa, examples are, customer files, books catalogue, employee rosters, sale transactions and equipment inventories. Other than storing and retrieving data, the database supports various otte: Operations such as, addition, updation and deletion of the data. A databae management system (DBMS) is used to perform such operations. A database is described as a suitably managed collection of related data elemeth, It must fulfil information needs of the organisation. A database is normal designed to be shared among multiple users, as described in figure 2.2 Ordered Collection Related Data ‘Meet Information Needs Shared Data terminologies in a database system are: 1) Data: Data can be defined as a serie been collected, stored, and procesced 2) Database: Database j 5; wait? ) Database: Dat nat aad ection of related files or tables that i stored” Standardised format and can be shi les employee file with the names 4 PY Several users, For exalt information about employees is adatahacee "departments, and Introduction to Database Systems (Unit 2) 39 3) 4) 6) 7 8 9) Entity: Entity is any real-world object, observati a ition, : o data is stored in a database. net eee re oie Field: A field is a column of the database file ld: A fi : or tab vies bute of the table. le that defines a single Record: For any particular entity, the related fields are referred to as record, For example, the values forall elds ofa student table ike the ae vies cection roll number etc. for one student would form a record. File: A collection of records is called a file. Attribute: It is the characteristic of the values of every field. Relation: The basic collection of data in a relational database is called a relation. It is represented using a two-dimensional array of rows and columns containing single value entries and no duplicate rows. Table: A table is also called a relation. It is a collection of data organised in the form of records and fields. 10) Key: In a table, a key is a field or a group of fields that uniquely identifies a 11) Data Dictionary: 12) Data Model: The record. jata about ‘The data dictionary is the area where the metad: data is stored. The data dictionary describes tables, fields, indexes, constraints etc. in a table. data model is the logical data structures including the operations and constraints to effectively process data and provided by DBMS. For example, relational data model. 2.1.4. Characteristics of a DBMS 1) 2 3) 4) fa Database System: A database system not only Self-Describing Nature o} data structure and Metadata (data contains the data but also description of the about data). This information is needed to DBMS software or users of database. This feature makes it different from the traditional file based system where data definition is a part of application programs. n Program and lication programs file structure then all hanged. Conversely, he system catalogue and not in the Data: The structure of data files is in the file based system. In case, a user programs which access that file in the database approach, data programs and as Isolation betwee! defined in the app! wants to change the also needs to be cl structure is stored in such, one change suffices. Support Multiple Views of database which gets defined by specific users containing data which is of interest to specific user or g! means that there can be multiple views of the system. Sharing of Data and Multi-User System: A multi-user database system .s, In order to achieve this, multi-user DBMS should allows multi-user acces: ler tc have concurrency control strategies implemented. Data: A view can be said to be a subset of & ‘ers of the system with each view roup of users. This > ™ ch data item should be Redundancy: Ideally each data stored ; vera der the Database approach, Never for keeping it at a Minimye hy 5) Control one location in the database un redundancy 0 which is controlled improved system performance. ' [As data is integrated in an organisation, it leads 4, for producing more information from a specific amount of gy, ror defining and enforcing the limitaign, 18 must provide the capability. . ‘Allusers of the system do not have the BMS providing & Security subsyen ‘ 6) Data Sha capability 7) Enforcing Integrity Constrain data type, data uniqueness, ctc., DBM 8) Restricting Unauthorised Acces access rights. This is achieved by D) creating and controlling user accounts. 9) Transaction Processing: The DBM subsystems to ensure that simultaneous UP controlled manner. Consistency and validity iS should have concurrency con, pdation by several users ae done i! must be maintained in the updaty 2.1.5. Objective of DBMS The table below shows the objectives of the database approach. It serves as , guide to database requirements process and data modeling: [ Database Description Objective ‘Availability [Data must be available for applications & queries. IShare-abili Data items prepared by one application must be available to all ote: Hi |applications or queries. No data items are exclusive to an application. The database must evolve as application usage and query needs evolve. ‘The users of the database ascertain their view of the data and its structure wt ‘considering the actual physical storage of the data. Data Integrity | dtabsse sets a consistent high level of accuracy. Validation rks = imposed by the database management system to insure the integrity. | [Evolv-abilit [Data Independence 2.1.6. | Organisation of DBMS Depending on the fields, records, and files traditional databases are organised follows: — base |A collection of integrated and related} Ss File A collection of related records Record A collection of related fields Field A group of characters, (Character Basic building block of information, represented by a byte ‘| Figure 2.3: Hierarchy of Database Introduction to Database Systems (Unit 2) a 1) Character: The most basic data clement which can be observed and manipulated is the character. It may comprise a single alphabetic, numeric or other symbol. 2) Field: This is the smallest unit in a database as it contains single piece of information. For example, student information is stored in the database below and the table below contains a sample of 5 students. There are six types of information of cach student which are: i) Roll No., ii) Name, iii) Date of birth, iv) Sex, vy) Address, and vi) Subjects. Each type of information is called a field where each filed represents one feature of an item or event, In this database, there are six fields. RollNo. | Name | Dateof [Sex ‘Address Subjects Birth 9721001 |Subrat Das [21.05.1980 | M |C36, Sector —-2.|Pol Sc, Eco, History, [Bhubaneswar Orissa__|Eng, Hindi [9721002 Aditya [12.06.1981 | M |AvPo. Burla, Sambal[Phy, Chem, Biology,| |Bhoi Pur Eng, Hindi 19732012 [Madhu Jain {03.01.1979 | F [A31, Pilani, Rajasthan [Pol Sc, Eco, History, Eng, Hindi 19724004 |Ahmad Ali [23.11.1979 | M [I2A, Sheikh Sarai-I|Phy, Chem, Biology, |New Delhi |Eng, Hindi [9715023 |C. Suresh [07.09.1980 | M |96, Hind Nagar, Bhopal [Pol Sc, Eco, History, Eng, Hindi Each field is different from other, for example, Date of birth is date type while Name is character type. 3) Record: Related fields for a specific event are referred to as a record which means it is a collection of logically related fields (as illustrated in Figure 2.4). For example, while considering the details of a student, all six fields taken together comprise a record for that particular student. Field name Fields in Field content eae First Name\| Last Name | Age | Address | Telt Tez ]*(first row) 9543567342 9503452176 [*—~—__] Value list v T— Value list Erie bl 34 | abed | 9336567843 | 25345689 |\, Mary ‘Smith 25 | wxyz | 9336789453 | 28076789 So (Bohn Doe 27_| pars 9795674837 | 23145675 }~pyy t £ i Value” Nominal data Nominal Continuous or Continuous data nominal coded data Descriptive (uncaded) data Figure 2.4: Student Table BBA Fifth Semester (Information System Managem, 42 S04, “a sually, all 4) File: The collection of related records Se ne lepones op ies an be exceptions too. This = same size al type but there canbe except containing trons oe of records in a file, Telephone directory sampleot a nin’ Of Yat telephone holders can be considered to be an € ' ; Types of Files In the database system: i) Master File: Thi the entities. This acts as ‘i where information is collected on the basis of trans the following three types of files are useq; s the file which contains permanent information a reference point for transaction Procesg, M tion data, " ii) Transaction File: These contain records of description of ACtiVities by an organisation. This gets created at the time of transaction Processin, and preparation of transaction documents. It is also used for Petmangy updation of master file. ili) Report File: This gets created by data extraction form Various req Ord for report creation. Example, report file about weekly sales of particular item. 5) Databases: This is a collection which comprises description of Activities of One or more related organisations. Thus, all such data is made available to users where redundant data is temoved or minimised. A database handle, business inventory and accounting information in its files to prepare Summaries, estimates and other reports. There might also be a database which will store newspaper articles and magazines. 2.1.7. Structure /Architecture of DBMS System Figure 2.5 illustrates the architecture of DBMS, The common components of DBMS are mentioned below: 1D DML Pre-Compiler: DML pre-compiler is used to convert the DML augments (embedded in an application program) into regular function Canguages are called in the host language). To Produce the suitable code. i needs to interact with the DML compiler, 2) DDL Interpreter: It interprets and Converts the DDL statements into a set! tables to record metadata (such as the name of the files, data items, sto dciails of each file, mapping information and Constraints, etc,), The sclet® definitions stated in DDL statements are Processed, : 3) File Manager: The task of the file mani Storage and data structure w on the disk. It is implemented usi ich rantBer is space allocation on dt hich represents the information stor’ ng an interface to the current file subsyste™ eres luded in a file Subsystem written exclus 4) Database Manager; like an interface be queries. It has the onus of int The database mana; tween low level erfacing wi er is a program module which 2 data and application programs # th the file system. Introduction to Database Systems (Unit 2) 43 Naive users “Application (Folkers. Agents, ele.) Proprammers gaia des t 1 ministratons ‘Application Application y Interfaces. Programs fae ese Tmbedded a + Query DML [<-> Panis ntl Provestor econ ‘ompiler Interpreter Application ier Pro ; Object Code “Transaction Manager Buffer Manager t sionge Manager File Manager —————— a { L \ J Disk Storage Siatistcal Data Data Dictionary Data Files System Surveture Figure 2.5: DBMS Architecture 5) Query Processor: Query processor is used to interpret the user's queries and convert it into understandable form by the data manager for further execution. A Data dictionary js used by the query processor to find the format of the relevant portion of the query. Query processor uses this information to modify the query. 6) Database Administrator (DBA): This is a high level function which manages all data resources in an organisation and also includes maintaining corporate wide data definitions and standards. lata repository is a significant 7) Data Dictionary: The data dictionary or d part of DBMS which contains data about data or metadata. Tt contains the peal database descriptions used by DBMSs where the data dictionary is active (checks database each time database is accessed) and integrated. 44 BBA Filth Semester (Information System Managemen 65 my 8) Storage Manager: It creates the interface aa i eae data, sty in the database), application programs and ae Storage, i. retrieval and Updation is the main job of storage manager. i 9) Buffer Manager: A buffer is the area in which a block a A fle is a Buffer management comes with the objective of eee Performance yt minimum demand on CPU resources. When two or more Buffers are yse4 a ile, it permits the transfer of data to be related with the processing of g,.* 10) Database Users: Database users are the end users who retriey, information from database. They access the database for querying, upg and generating reports. Types of Users : ' i) Casual End Users: A casual user has occasional access with diffe requirements each time and uses a high level query language like sqy which is the standard query language for relational database systems, ii) Naive and Parametric End Users: These are the people who Use Permanent application programs. Examples of such users are airline reservation clerk, bank teller, data entry clerks, etc. ili) Sophisticated End Users: These are the users who are familiar with te DBMS facilities like engineers and business analysts. iv) Application Programmers: They execute applications like canned (standard types of queries and updates used by Naive or parametric end users to regularly querying and updating) transactions on top of DBMS for providing convenient access to naive and parametric end users. 2.1.8. Advantages of DBMS System 1) Redundancy can be Reduced: DBMS reduces the duplicacy (redundancy) and is aware of the redundancy and takes up the updates responsibility (i.e. automatic change at other places in case of duplicate data). 2) Inconsistency can be Avoided: It also controls the inconsistency (mismath of two entries with same data). Database controls the redundancy which automatically controls inconsistency. 3) Data can be Shared: Data stored in applications and because stored data of creating new file. 4) Standards can be Enforced: To represent th the database can be used with the athe Satisfies all its need so there is no nee? data, standards are used such company. installation, departmental, industry, national and intematioe! Standards. It is useful when user wants to migrate and interchange bete®* systems. . 5) Security Restriction can be Applied: Various authorisation checks (wl sing sensitive data) and proper channels ace required 40 access dhe daxabast- 6) Integrity can be Maintained: Data integrity is important bect¥ databases are used in the shareable i att m % mode. S vi the integrity and ensure that they are accurate Tabascs provide Introduction to Database Systems (Unit 2) . 2.1.9. Disadvantages of DBMS System There are some limitations attached with the data ¢ system, These are: 1) High Cost: Cost is the one of the significant disadvantage of database system because to use a database, organisation requires upgrade or a new hardware. So organisation will have to pay different costs such as developing and hardware. 2) Problems Associated with Centralisation: There is le is accessed in centralised (data is acces: can be lost and damaged. s security when data d by every user) manner. So data Complexity of Back-Up and Recovery: In a multi-user database system when backup is loading, it may lead to duplicacy of data. If one takes the database back-up then it may affect the multi-user database system (which is in operation). 4) Confidentiality, Privacy and Security: When data is accessible from the remote location (i.c., database system is centralised) then the possibilities of misuse of data increases compared to conventional database. To secure the unauthorised access of data, it is mandatory to take technical, administrative, and legal measures 5) Data Quality: Suitable and sufficient controls are required to control the users who are updating the data and control the data quality. Direct access of data by various users leads to massive opportunities for users to damage the data. So if no suitable controls are available then it may be possible that data is comprised. 2.1.10. Applications of DBMS Systems There are various applications of DBMS. Some of them are as follows: 1) Airlines and Railways: Online database management system is used in airlines and railways seat reservations, as well as to display the flight and train schedules. 2) Banking: Core Banking System used in banks consists of database for storing and managing customer accounts, loans, enquiries and different transactions. 3) Education: School Management Systems employed in schools and colleges consists of databases for different operations such as student registration, result processing, fee management etc. 4) Telecommunication: Telecom companies use database management system to store call records, customer bills and payment information, SIM card information, phone numbers, etc. 5) Government: Different departments of Government use database management system like Income Tax department, Sales and Excise department, Municipal Corporations, Health department, Housing Development Authorities etc. 6) Private Organisations: Private organisations maintain DBMS for storing and managing records of their customer, suppliers, employees, inventory, bs BBA Finn Semester lformation System Menage, 1 . : h orders, sales, expenses, income, etc. Laon er are Story records, easy access to information, an Is Compares manual system. 4 2.1.11. File System versvsDBMS _ oe The difference between File System and DBMS is described in the table 24. Table 2.1: Difference between File System and DEMS File System ako a collect 7 A collection of data is termed as the file | DBMS is also a collection of dary tay system. The user has to write the|user needs not to write the procedure, fe procedures for its management. its management. = The file system is saved in temporary |It is well arranged and saved to Permang> locations. locations. _ : It provides details of data representation) It hides details and provides an aba and storage of dat iew of dat Storing and retrieval of data cannot be|Storing and retrieval of data iy a done efficiently, efficiently by use of various sophistcsn techniques. No transaction is possible. Several transactions such as insert, dag view, updating etc. are possible. Simultaneous access to data gives rise to Simultaneous access is smooth as DAM problems. For example, a user reading |uses locking. the file while another one is deleting or updating data in it at the same time. Data is accessed through single or various | Data accessed through tables (schema) | files. It does not have “a crash recovery/It has a crash recovery mechanism wid mechanism, Protects users from the effects of systen failures, DBMS has a good protection mechanism. Protection of file under file system is difficult. 2.1.12. People who Deal with database Following are the people who deal with database: 1) Dates Implementers: Database implementers are those who build DBMS software. They are also the end users w store and use data stored in a DBMS. gant tere a 2) Database Application Programmers: use the host or data languages and soft offer in order to create packages that si are typically not computer specialists. 3) Database Administrator: ibiliti Database 'strator: The responsibilities of database programmers i) Design of the Conce; interact with system the DBM and how it will likely be Database Application Program Ware tools that DBMS manufac mplify data access for end users. “ Introduction to Database Systems (Unit 2) 47 iii) Data Availability and Recovery from Failures: It is the responsibility of database programmers to ensure that users may access as much of the undamaged data as they can in the event of a system failure. iv) Database Tuning: They are responsible for adjusting the database as user requirements change to guarantee sufficient performance. DATA MODELS 2.2.1. Introduction To describe the structure of the database, several concepts are used. These collections of concepts are known as data models, They also provide the essential means to get the abstraction. The structure of a database includes: 1) Data Types, 2) Relationship, and 3) Constrains. These elements should hold for the data. For the specific retrievals and updates of the database, data models also have some operations. When real world entities, their constraints and relationships are logically organised, then it is known as ‘data model’. For a data model a database language is a concrete syntax. A data model is implemented by a database. A group of conceptual tools is known as data model. It describe the: 1) Data, 2) Data relationships, 3) Data semantics, and 4) Data constraints. Types of Data Models The main categories of data models are: Categories of Database Models Relational Model Network Model Hierarchical Model 2.2.2. Relational Data Model E.F. Codd introduced the relational data model in 1970. It is one of the most evolved and widely used models for organising data, The data can be described in a flexible and simple manner using the relational model. This model can be observed in almost every sphere of everyday life. | 48 BBA Fifth Semester (Information System Managemen ca! Tables are used to represent data in the relational model. There ig alg theoretical foundation associated with the relational model because j, ole rules of the mathematical theory. Following are three components that Take the relational model: aoe 7 1) Data Structure: The tables contain rows and columns in which the = organised. i i d to perform 2) Data Manipulation: SQL languages are used ; operations that help in manipulating the data, stored in the relations, P°™*tR 3) Data Integrity: It is possible to specify certain rules that help in maintaining the integrity of the data in the database. To Fepresent the data and relationships among them, this model useg ‘relations’ (group of tables). Every table has the number of attributes (Colum, with unique names. This model relates the records using the value of the relation. This model is based on the mathematical theory of relation and it is conceptually simple. This is one of the main advantages of relational data model, In this, users need to worry mor about the storage structure and access method, For example, let's consider a table (named wage) is a relational database, Hours | Rate | Total Abhay [40.5 [10.35 | 419.175 Shobhit [38 18.751 332.50 (Aiay [42.70 [9.25] 394.975 | 2.2.2.1. Relations Relation is Tepresented using a two-dimensional table, A table or relation is made up of a definite number of ‘named columns’ and indefinite number of ‘unnamed tows’. A ‘named column’ of a relation is called ‘attribute’. Each TOW stores a Fecord, Data values fora single entity make up a recon An example of a Attributes such as Emp attributes to describe the A short hand notation can also be used to represe; i re. f nt th Using is method the attitue " Pr the relation structui the at cS are written (within parenthese be ich the name of ‘the relation is written. The telation for EMPLOYER a DeptName and Salary) has been given below. ee Table 22: EMPLOYEE} ;— Table 2.2: EM EmpID [Name | DeptName”] [00 Taare Marketing 140_{ Sanjay tha [Aceon ting 110 _| Indira Singh [infé Syne 190 “| Davis Ca — [ee Sete | 150_| Kamini Verma Marketin, 42,000 ~atketing [42.000 ] Introduction to Database Systems (Unit 2) 49 Let us consider the relation named PRODUCT as shown in figure 2.6. There are 4 tuples in the relation. Cardinality is defined as the number of tuples that are present in a relation. The Quantity-on-Hand attribute present in PRODUCT relation has a domain consisting of all integers that are greater than or equal to zero. PRODUCT Relation Attributes Production | Description | Price | Quantity-on-Hand | Relative 0100 | Table 500.00 2 1 0975 | Wall unit | 750.00. 0 2 Tuples) 1250 | Chair 400.00 13 3 1775 Dresser 500.00 | 3 4 Primary Key Figure 2.6: Example of Relational Data Model 2.2.2.2. Properties of Relations 1) No Duplicate Tuples: There should not be two tuples having the same values for every attribute in a relation. In other words it can be said that every row in a relation must be unique. 2) Tuples are unordered: There is no specific ordering for rows in a tuple 3) Attributes are Unordered: There is no specific order of columns in the relation. 4) Attribute Values are Atomic: There are exactly one value for every attribute for a specific tuple. 2.2.2.3. Advantages of Relational Model 1) Ease of Use: This is simple to use because information is stored in tables so if one is handling (try to make any update) it for the first time, then he/she finds it very attractive. 2) Flexibility: This is flexible, so one can get the data in the form which he/she wants. He/she can extract the information very easily and information can also be manipulated by using various operators such as project, join, etc. 3) Precision: This is precise. Precise means there is no ambiguity in the data. To achieve the precision, this model uses the relational and calculus algebra for the manipulation of the relations between the tables. 4) Security: Security control and authorisation can also be implemented more easily by moving sensitive attributes in a given table into a separate relation with its own authorisation controls. If authorisation requirement permits, a particular attribute could be joined back with others to enable full information retrieval. ') Data Independence: Data independence is achieved more easily with normalisation structure used in a relational database, than in the more complicated tree or network structure. BBA Fifth Semester (Inform 50 , sibility of Tesponding to a4, relational algebra and relay, approach. For data organisa becomes complex or exttengp \ 6) Data Manipulation Language: Bes pos query by means of a Janguage based om calculus is easy in the relational databas other structure the query Janguage either limited in its capabilities. Disadvantages of Relational Model 2.2.4. D Relational Model 1) Hardware Overheads: processing as it uses abstraction la ) Gata to end user so, this is the reason that it re But this is not a big issue because computers available now days in the market. n Result in Bad Design: The relational databyy. tion layer so at user's level; it is an easy... hysical layer is hidden from user so it my and implementation. In such casey ay result in performance degradation iption. of. DBMS requires ng vers to store data physically and represen, quires more powerful hard with high processing POWEr ay 2) Ease of Design cat management system uses abstract design and easy to use. But the pl lead to poorly designed development when the database size increases, it m: resulting to system slowdown and data corruy “Information Island’ Phenomenon: As we know that relational model of database systems are easy to design and use, departments or individuals may design and implement their own databases and software applications. It may result in problems like data redundancy and data inconsistency which in tum may hinder information sharing and integration as well as efficient functioning and operations of an organisation. 3) 2.2.2.5. Difference between DBMS and RDBMS Concept DBMS RDBMS Relation Programmatically maintained. Tables are used to store the relation between between tables and are stored in tables the same database. ‘Multi-User Generally one can access the files simultaneously so DBMS do not support the multiple users. RDBMS supports multiple users atime, Secorly of | Not supported. Security is implemented Data multiple levels. ‘able Storage | Predefine extensions are used to| Single or multiple database files ee table and stored as a are used to store the tables as the! single fil i sae a Ss might belong to different users. Database Files The stored files can be directly accessed by the users. Low level database files ** Protected from the direct access of Distributed | Not supported. the users. Database Supported. Abstract View | There is no support f abstract views that have oie derived from the base tables, There is support for abstract vie™* | Code’s Rules Less than 8 rules are satisfied. More than 8 rules are satisfied- eS nyroduction to Database Systems (Unit 2) sl 2.2.3. Network Data Model This model represents data by collection of records and relationships among data. This is represented by links, which can be viewed as pointers. The records in the database are organised as collection of arbitrary graphs (figure 2.7). Network 1 Network 2 Network A. Network B Network C Figure 2.7: Network Model Database Task Group (DBTG) of the Conference on Data System Language (DBTG/CODASYL) formalised the network data model in the late 1960s. Their first report that has been revised a number of times, contained detailed specifications for the network data model (a model conforming to these specifications is also known as. the DBTG data model). Many of the current database applications have been built on commercial DBMS systems using the DBTG model. 2.2.3.1. Advantages of Network Data Model 1) Network model is useful for representing such records which have many-to- many relationships. 2) Problem of inconsistency does not exist in a Network model because a data element is physically located at just one place. 3) Searching a record is easy since there are multiple access paths to a data element. 2.2.3.2. Disadvantages of Network Data Model 1) All the records are maintained using pointers and hence the whole database structure becomes very complex. 2) Insertion, deletion and updation of any record would require pointer adjustments. 2.2.4. Hierarchical Model This model is similar to network model in the sense that data and relationships among data are represented by records and links respectively. It differs from network model in that the records are organised as collection of trees rather than arbitrary graphs. A DBMS belonging to the hierarchical data model uses tree structures to Tepresent relationship among records. Tree structures occur naturally in many data organisations because some entities have an intrinsic hierarchical order. A hierarchical database therefore consists of a collection of records, which are connected with each other through links. Each record is a collection of fields (attributes), each of which contains one data value. A link is an association Precisely between two records. For example, consider the EMPLOYEE hierarchy in the figure 2.8. BBA Fifth Semester (Information System Managemen g y iG 52 ty Root Employee 7 [Compensation] [ Job Benefits a “ ‘Assignment e—V— ! 1 Somme Pension] { Insurance } Heath Child Rating ty Figure 2.8: Hierarchical Model 2.2.4.1. Advantages of Hierarchical Data Model 1) Ttisa simple, straightforward and natural method of implementing rec, relationships. Hierarchical model is use database. 2 ful when there is some hierarchical characte in 2.2.4.2. Disadvantages of Hierarchical Data Model 1) The hierarchical model cannot represent all the relationships that occur inh real world. 2) It cannot demonstrate the overall data model for the enterprise because of ty non-availability of actual data at the time of designing the data model. 3) The hierarchical model is used only when there is a hierarchical characte in the concerned database. It cannot represent many-to-many relationship (a child can have only one parent). 4 Cele arte | 2.3.1. Concept The efficient organisation of data in database is defined as normalisation The process of normalisation aims at: 1) Eliminating the redundancy of data, i.e., no data occurs more than once it one table; and 2) Ensuring sensible data dependencies, ie., only relevant data is stored # the table. ‘The above mentioned goals of normalisation process helps in reducing the sP* captured by a data. It also helps in ensuring that the amount of data stored * logical and relevant. ? Properties of Normalized Relations Normalised relations possess following properties: 1) There should not be unnecessary duplication of any data value in differ rows. 2) For each attribute in a row, a value must be requi i 7 eof quired and specified. 3) A normalised relationship must be self-sufficient, i.e., a eritical data show not be accidentally lost if a row from a relation is deleted am tnsroduction to Database Systems (Unit 2) 53 2.3.2. Normal Forms There are numbers of systematic guidelines, known as normal forms, developed by database community to make sure the normal form of data or the data the normalised. These guidelines are numbered from one (the lowest normalisation form), known as First Normal or INF, to five, known as Fifth Normal Form or SNF. Figure 2.9 shows the one normal for that is firstly in previous normal form. Figure 2.9: Example of Successive Normal Forms of a Relation For example, there is relation between the 5" normal form and the 4" normal form first. There may be change in the value of an attribute of a tuple independent of other tuples in the relation and other relations. 2.3.2.1. First Normal Form (INF) Only when each entry of the relation has at most a single or atomic or indivisible value only, the relation is said to be in First Normal Form or INF. For example, table 2.3 shows the employees’ database illustrating more than one address for a single employee: Table 2.3: EMPLOYEE EName Dept. Address: Lucknow Baxter _| Sales Agra Delhi Lucknow Able Computer Glan Delete or eliminate the repeating groups to covert the given relation into First Normal Form or INF (as shown in table 2.4), ‘Table 2.4: INF EMPLOYEE EName Dept. ‘Address Baxter Sales Lucknow. Baxter Sales Agra Baxter Sales Delhi ‘Able ‘Computer Lucknow Able ‘Computer Calcutta oY s BDA Fith Semester (Infomation SEM Manageme NQg, 2.3.2.2. Second Normal Form (2NF) Only when relation R is in INF and every non-key attribute compy dependent on the primary key, it is said to be in second Normal rs NF). For example, consider the relation, ORDER table, with da, " shown in table 2.5). (% ORDER Qty | Unit Price i 300 1 325 i 150 2 175 4 225 3 3 1 Order_No 25, 500 175 ‘Computer Network Data Structure The table shows the lists of the different orders of computer books, including the quantity and unit price of each associate book, The primary key denotes the combination of order_no and title as there is repetition of both order_no ang title in the table. Every attribute in the table is atomic and thus in the first Normal Form. However, it is not in second normal form since unit_price only functionally depends on te title component and not the order_no component of the concatenated primary key. In contrast, quantity (Qty) is functionally dependent of the concentrated primary key. Now, the table should be divided into two tables, ORDER_MASTER (order_no, title, qty) and BOOK_MASTER (title, unit_price), in order to convert it into second normal form, we will get: Table 2.6: TITLE_MASTER Title Unit_Price Database Management 300 Java 325 Software Engineering 150 Data Structure 175 ‘Multimedia 225 Computer Network 300 Table 2.7: ORDER_MASTER ‘Order_No | Title Database Management Java Software Engineering Data Structure Multimedia Java Computer Network Data Structure sfeofea}rofrs]|— | CPP eee Introduction to Database Systems (Unit 2) 55 2.3.2.3. Third Normal Form (3NF) Only when relation R is ready in second normal form (2NF) and no non-key or non-prime attribute is transitively dependent on the key or no non-prime attribute determines any other non-prime attribute, the relation R is said to be in third normal form or 3NB, Thus, by removing the transitive dependene ions can be converted into 3NF. For example, consider the COURSE table (as shown in table 2.8): COURSE (course, head_dept, room_no, capacity of room) ara departments of the college are shown in this table and the prime attribute is Cour Table 2.8: Relation not in 3NF COURSE | HEAD_DEPT|ROOM_NO| CAPACITY OF ROOM B.Tech(CS) | Prof. Gupta 102 60, B.Tech(T) | Prof. Smith 107 50 B.Tech(EC)| Dr. Sundaram 105 60 B.Tech(AD) [ Dr. Srinivasan 103 100) MCA Mr. Sharma 1 40 The above table clearly shown the existence of transitive functional dependency as capacity of room is functionally dependent on room_no and room_no is functionally dependent on course. That is the capacity of room is transitive functionally dependent on the prime attribute course. COURSE_NAME-ROOM_NO-CAPACITY of ROOM The issues arise as the result of this transitive functional dependency. Unless a course is scheduled in a particular room, the capacity of that room cannot be added into the database; moreover, the capacity of a room with only one course scheduled will be eliminated if that course is cancelled. Thus, the relation is not said to be in 3NF. As a result, the given table 4.8 should be decomposed into two tables, Course and Room, so that the given relation can be in 3NF. COURSE, CAUSE HEAD_DEPT. B.Tech(CS) | Prof. Gupta B.Tech(IT) | Prof. Smith, B.Tech(EC) | Dr. Sundaram B.Tech(Al)_| Dr. Srinivasan MCA Mr. Sharma, 102 107, 105 103 wt BBA Fifth Semester (Information System Managemen, 66, My ‘56 2.3.2.4. Boyce-Codd Normal Form CNP) a Rada, “A relation R is said to be in BCNF if whenever x ‘ions when 3NE i nog a then X is a candidate key for R.” The particulate ke) viributes, oF etog “ interdependencies between non-key (but candi lt a mae the tela" said to be in BCNF. Thus, any relation in 3NF can als in Bop "i 3NF relation would not be BCNF when: 1) There are more than one candidate Keys, 2) The keys are composed of multiple attributes, a1 3) The keys have common attribute. For example, consider a relation ‘Sports Club": Table 2.9: Sports Club Member Name | _ Sport| _Coach Sen Soccer Kurian Tshita Soccer _| Kurian Sen Hocke} Karketta Roop. Soccer Tikken ‘Aman ‘Soccer__| Kurian ‘Sams Soccer | Tikken Sams Hockey | Karketta Rita Hocke Dhish Sen ‘Atheletics [ Usha] In the given table 2.9, the candidates for primary keys are: Member + Sport and Member + Coach The candidate keys are so because: 1) One member can participate in many sports. 2) A Member can have only one coach for one sport. 3) There may be more than one coach for each sport, but each coach is oaly assigned on one sport. In the above relation, the coaches can choose sports, but they are not the primary key. Therefore, the given relation cannot said to be in BCNF. This may result in following problems: 1) The data that ‘Dhish’ is coach for hockey wi i ip of ees will of Seppe ment: -y will also be lost if member ship 2) The updation will take place at 3 places if ‘Kran’ coach name need to be update Linapey te flovg wo riosin ono BENE comiions 4 ler to satisfy BCNF conditions: Member Name | Coach Men Sport Coach a sz Karketta Hockey Karketta Rasp Tikken Soccer Tikken eee. = Hockey | Dhish ‘Sams Tikken Atheletics Usha Sams Karketta iu Dhish jen Usha Introduction to Database Systems (Unit 2) 37 2.3.2.5. Fourth Normal Form (4NF) aN) is one additional requirement for relations to be in Fourth Normal Form NF): 1). Satisfy all the conditions of NF. 2) No multi-valued dependencies for a rela jon to be in 4NF, For example, consider EMPLOYEES, SKILLS, and LANGUAGES as the primary keys, where PLOYEES may have several skills and known to multiple languages. Now there are two relationships, one between EMPLOYEES and SKILLS, and one between EMPLOYEES and LANGUAGES. The relationships cannot be represented in a single record under fourth normal form as: EMPLOYEES | SKILLS | LANGUAGES. But, the relationships should be presented in two records, as given below: /EMPLOYEES|SKILLS] [EMPLOYEES|LANGUAGES| 2.3.2.6. Fifth Normal Form (SNF) The Fifth Normal Form or SNF deals with the situations where information may be rebuilt from smaller, less redundant pieces of information. The fifth normal form, which is an extension of the MVD (Multivalued Dependencies), addresses join-dependencies. It is the goal of the fifth normal form to have relations that cannot be further subdivided. In SNF, a relation cannot be built from many smaller relations. For example, take into the three attributes agents, firms, and items in a relation ‘Sales’. We may wish to keep data of which agents sell which items for which company if agents represent companies, companies create product and agents sell products. One record type with three fields might be used to store this data. Table 2.10: Sales AGENT | COMPANY | PRODUCT Smith __| Ford car Smith | GM truck In the majority of cases, this form is mandatory. Let us say agent Smith sells GM trucks and Ford cars, but he does not sell Ford trucks or GM cars. In order to determine which combinations are right and which are not, we thus require the combination of three fields. Imagine, however, if there was a certain condition that if an agent sells a specific product and he represents a company that manufactures that product, then he sells that specific product for that company, Table 2,11: SALES ‘AGENT | COMPANY | PRODUCT ‘Smith | Ford car Smith | Ford truck, GM car, GM ‘truck | Ford car in Semester information System Manage sy ee BBA Fil a normalised form made up of three itereny allows us 10 1 econstruct all the actual facie AGENT | PR ODT Iq) It turns out that in this ving two fields types with each hay scnaat | JOMPANT ‘Smith [car Smith, Ford Seas Aree Smith | truck ‘Smith__| GM ra Tones _| Ford S__| car ' a viously displayed, these 4, i field record pre m or SNF. ONSHIP MODEL Unlike the corresponding three re in fifth normal for record introduced by Peter in 19% 2.4.1. Introduction ining the perspectives of bos The Entity-Relationship (ER) model was initially 1 aiming to provide a unifying framework for combi network and relational database paradigms. conceptual data framework tha d relationships. A fundamen! The Entity-Relationship (ER) model serves as @ diagram, which graphicaly res the real world in terms of entities anc perceiv. del is the Entity-Relationship element of this mo represents data entities. The ER model offers several advantages for the database designer: 1) It seamlessly aligns with the relational model, allowing the constructs employed in the ER model to be easily translated into relational tables. 2) It boasts simplicity and comprehensibility, result, the model facilitates effective communic: database designer to the end user. 3) The model can function as a design blueprint for th guiding the implementation of a data model within specific dat requiring minimal traini ‘ation of designs from tt 1e database develop taba management software 2.4.2. Entities ‘An entity is an object which exists and can be differentiated from other obje** This implies that an entit Si i : y can be uniquely recognised. For example, » Aspect pone. pron is an entity. mes specific depart i ince A srcifc depamen, eg. Eltrnies and Communication Engineet 3) A specific place, e.g., Coimbatore city can be an entity. An entity can be de e a conte defined onan object of significance about which data nee " . Ings are not iti as an enity, a thing should have attibutes andlor wladon tice ‘these @2 Provide information about an entity. ee ee Introduction to Database Systems (Unit 2) 539 Type of Entities A database comprises categorised as: 1) ata hee) Types: This is one which has a complete identifier which es 'y to recognise its instances quickly. A strong entity’s existence is Pendent on another entity. For example, students take up various courses. In this case the students are a strong entity. : Eroups of entities which are alike. They can be STUDENT. TAK COURSE, Here, the course is considered as a weak entity as, if there are no students to take up a particular course, then the specific course cannot be offered. Thus, the COURSE entity is dependent on the STUDENT entity. 2) Weak Entity Types: The entity types which do not have any vital attributes of their own are referred to as weak entity types. They are dependent on another entity (strong entity type) for existence. Sometimes, a weak entity may not have a primary key and cannot be recognised in the absence of the associated strong entity. For Example, i) A customer borrows a loan. Here, loan is the weak entity as it is dependent on the entity customer in order to get identified. For every loan there is a corresponding customer. Customer Borrow Loan ii) The entity set Departures which has date as the only attribute is a weak entity set as there can be many flights on the same date. As such, different flights may have the same date value. The doubly outlined rectangle implies a weak entity. FLT_NO (_ dertme ) ARRLTIME |) (© DATE) Gna DEPARTURES DESTINATION gram for a Weak Entity Set which is Dependent on Strong Entity Set Figure 2.10: B-R 2.4.3. Attribute ‘The specific properties riba the eraplave's name, age, address, salary and job describe the A specific entity will have a value assigned to each of its become a vital part of the data stored in the database. of an entity are referred to as attributes. For example, entity employee. attributes, These a BBA Fifth Semester (Information System Manag. = ren), Sey, Types of Attributes . aoe There can be different types of attributes eich eae 1) Composite Attributes: The eee basic attributes i © sn reflective ©! _attribut in in eee See ane termed to as composite attributes, Kr bute Address can be broken down into gy ¢ useful in modeling situations wher Ch, For example, the attri ite attribute as a unit but at other times) ty "eh, State and Zip. This becomes sometimes considers compost particularly to its components. Simple Attributes: In case the composite attribute is referred toasa then there is no requirement for it to be broken down into individua, - parts. For example, if there is no requirement to know about the indivi components of an address, then the complete address with Street, City, Sa and Zip can be termed as a simple attribute. Single Valued and Multi Valued: Most often, an entity will have a si value for an attribute. This is termed as single-valued. For example, Anis a single-valued attribute. 2 3) In some cases, an entity can have a set of values for an attribute. Sui attributes are called multi-valued. For example, College Degrees of: person. Here, one person may not have a college degree at all, a second oz might have one and a third might have two or more. Thus, different pers can have different numbers of the College Degrees attribute. Stored and Derived Attributes: Two or more attributes might be related For example, the Age and Birth Date attributes of a person. Here, the at of a person can be determined from the current date and value of thi! person’s Birth Date. Thus, the AGE attribute is a derived attribute whit has been derived from the Birth Date attribute which is termed 3¢ stored attribute. 4 Few of the derived attributes can be from related emi’ Ea anne o attribute of Number of Employees of a Department et? lerived from counting the ing i0* specific department 1g number of employees working 5) Null Values: e . appropiate came. @ particular entity does not have @ singt 1 ‘alue of an attribute. For example, the Apartment Num attribute in an address j ; ss is relevant for ‘din 5 of addresses of apartment buildi te We and not single-fami iscreated MY homes. In such situations, a special null The address of a sj : attribute, This “den ily home will have null as the Apartment Nase entity is not known, Pere? Cases if the value i asl Smith” is not inown ea le, if the phone nutnbe oh parca ‘o same i 4 null is u Ce 4S earlier stated and the oe Neteie the meaning of null is "® own, Introduction to Database Systems (Unit 2) a The unknown type of null can be further divided into two types. In the first case, it is known that the attribute value exits but missing for some reason, For example, the Height attribute of a person is listed as null. In the second case, i is not known whether the attribute value exists or not. For example, whether the Home Phone attribute of 4 person is null or not, 2.4.4. Relationships Figure 2.1 shows two entities, Both of these entities Pertain to the “person” type of entity. The relationship that is established between the two is “Is- Married-To”. Both of these people have a clear role in this relationship. One of the persons adopts the role of the “husband” while the other adopts the tole of “wife”, Person Person (Entity) (Entity) Husband Wife (Role) (Role) Relationship Figure 2.11: Concept of Entity and Relationship Mathematical Relationship on Entity Set R is a relationship that exists within n entity types E,, Ey .... Ey. It explains a set of relations among entities from these types, Mathematically, R can be explained as a set of relationship instances r;, where each 1; relates n entities (e1, €2, ... €,), and each entity Ej in r is a subset of entity type Ej, 1 Sj sn. Hence, a relationship type can be defined as mathematical function on E}, Ey. .« Eq, or alternatively it can be defined as a part of the Cartesian Product E, x EX ..x E,, Each of the entity types B}, En, ... By is said to take part in the relationship type R, and similarly each of the individual entities €,, €, . € is said to participate in the relationship instance 1 = (€1, €2, «4 €n). 2.4.4.1. Types of Relationship The ER relationship diagram basically comprises the following types of relationships: 1) One-to-One (1:1): The one-one relationship is very easy to depict. It is also called 1:1. In this relationship, for a particular entity there is exactly one other entity that can be mapped. An example can be a bank account number and a customer. There thus, exists a one —one relationship between the bank account number and the customer.

You might also like