0% found this document useful (0 votes)
82 views81 pages

Introduction To DBMS

Uploaded by

dolar45755
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)
82 views81 pages

Introduction To DBMS

Uploaded by

dolar45755
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
Q. 1. What do you understand by database and-database management system? (DBRAU 2015) Ans. The term database is made up of two separate words, ie., data and base. ‘Database is a base for data, i.e., an assembled group of data. A database allows easy and efficient ‘Storage, retrieval and modification of data, regardless of the amount of data manipulated, essentially, database is a computerised record keeping system. A database is a logically coherent, organised collection of similar data. Similar data refers to the collection of data, which is stored based on the same context. For example, an Employee database contains ‘similar’ data. For all Exployees and every Employee’s entry contains a Similar type of information. The organised\information : (i.e., database) serves as a base from which the desired information can’ be-retrieved, conclusions can be.drawn and decision can be . made by further reorganising or processing this data. In essence, a database not only stores information, but the information is © integrated so that when the database is interrogated, users can get something useful from it. “A Database Management System (DBMS) is a collection of interrelated data,and.aset of programs to access ‘those data.” The collection of data, \usually. referred to-as the database, contain | information relevant to an enterprise. The primary goal'of a DBMS J is to provide a way to store and retrieve database information that is both convenient and efficient. i Database is the combination of two words : _ Database + Management System=DBMS A database is a collection of related information stored, so that it is available to many users for different ees 3 - Rent oans] —(o5}—rarl “ Fig. On the other hand, ‘managment system isa collection of | proprams that enables users to create and maintain the database. DBMS can also be define “as an interface between the applicati, program and the operating system to access to manipulate tl, database.” ¢ ADBMS isa software system that allows access to data containje in the database. It’s objective is to provide a convenient and effectiji method of defining, storing and retrieving the information containtt in the database. The DBMS interfaces with application programs(« that the data contained in the database can be used by multip]) application and users. : Q. 2. What is the need for DBMS ? Ans . Need for DBMS Historically, information systems employed stand-alone sySsten for separate application each with their own set of files This implic the data such as addresses, may be duplicated in many’ separat systems, such as an employee's address may be héld once in th payroll system and again in the personal systeni, This causes wast of space and inconsistency. There may be a possibility for the addres to be updated in one system but notin) the other, hence, makin, the data in consistent. a} . The problems described aboveled to development of the databas: approach. In the database approach, an organisation attempts t ‘build an integrated “corporated database to support all the dat: requirements of the organisation. DBMS are very good at organisin; and maintaifiing large collections of. persistent data. A DBMS is lik: a suitcase where all the stuff (data) is put so that it is in one plac ./and easy to reach: This proteet data from unauthorised access anc _ accidental corruption or loss due to hardware anid software failures “DBMS allows concurrent access, meaning that a single data set can be accessed by moré than one user at a time. - = Q-3. Explain the components of DBMS. (DBRAU:2045) Ans. Components of DBMS : Usually a DBMS is a lar; diverse tasks including the PI ge software package that carries ott rovision of facilities to enable the user 2 lone eu ee information in the database. On one hand itis ceca « : peureen the physical database, the computer axl Eesenticy ystem and on the other hand, the users, 4% ? ally, this’system involves data, the hardware the! at data, the software that utilises the hardwart 1. Uses ; In DBMS generally three broad classes of users are considered. These are application programmers, end users and DBA (Database Administrator). The application programmers develop the application programs. Theve programs can manipulate the database in all the possible ways.-The end users access the database from a terminal using a query language provided by the database system or through application programs developed by application programmers. The database administrator is the person who is responsble for the design, construction and maintenance of a database. a 2. Software : Software of a database management system included the DBMS, operating system, network software.(if necessary) and the application programs. . * “‘Transaction‘Manager ‘. Request tor | Request tor Specific Block | Specific Block User Request Input/Output . Recovery Manager. Fig. : DBMS components. _ 8%. Hardware : Hardware of the system can range from a PC to anetwork of computers. It also includes various storage devices (like hard disks) and input and output devices (like monitor, printer etc.) 4. Data : Data stored in a database includes numerical data including whole numbers and floating-point-number and non- numerical-data such as characters, data or logical (true or false). More ‘adyised system may include none complicated data entities such as‘printers, images and data types. : : Above diagram shows a typical interaction among various DBMS components. The user,requests for specific information with the help of user interface, that is application programs. This request is processed by DBMS data manager.and after processing, data manager requests for the specific records to the file manager. The file manager then requestes for the specific block to the disk manager. The disk manager then retrieves the block and sends it to file manager, which sends the required record to data manager The transaction manager supervises the data transaction that j, carried out between the data Manager, and the disk manager. Th recovery.manager keeps a check on the transacted data so that iy case of system failure, the data can be protected. Q. 4. Explain the applicatious of DBMS. —(DBRAU 2015) . Ans. ‘ Applications of DBMS Some of the important application fields of DBMS are : 1. Banking : For maintaining customer information, accounts, - loans and banking transactions. 2. Universities : For maintaining student records, course registration and grades. 3. Railway Reservation : For checking the availability of reservation in different trains, tickets, etc. “eS 4. Airlines : For reservation and schedule information. * 5. Telecommunication : For keeping records\of’calls maie, generating monthly bills etc. ‘6. Finance : For storing information about holidays, sales‘and purchases of financial instruments. ) : y 7. Sales : For customer, product and purchase information. Q. 5. Explain the advatages of DBMS. spa Ans. Advantages of DBMS Some of the major advantages provided by the DBMS'are* 1, Reduction'in Data Redundancy : Data redundancy refers - to the duplication of data. In non-database systems, each application has its Own separate files. This can often lead to redundancy in siored data, which results in wastage of space. For, example, in case * of file-based system of a. magazine publishing house, the custémer deparatment keeps a separate customer details file. A similar dep ] a . A similar file in also kept with the postage-handling dapartment? Hence the same data may not be updated consistence. Suppose a customer, requests handling department's life. If the database s zdepa life. ¢ system forget: to update this file, this may lead to Postage: of the sunceal i 2, Reduction in Inconsistency : ihis is a corollary of the provious point discussed above. It is obvious that if the given fact is represented by a single entry then such inconsistence may not occur. Alternatively, even if the redundancy is not removed but is controlled, then to the DBMS ensures that the database is always consistent by ensuring that any change made to either of the two entries is automatically applied to the other one also. This process is also known as propagating update. , 8. Sharing of Data : Sharing of data allows the existing applications to use the data in the database. It also helps in developing new applications, which will use the same store data. Due to shared data only, it is possible to satisfy the data requirements of new applications without having to create any additional stored dataor with marginal modification. ‘ 3 4, Enforcement of Standards : Since access to the database must be through the DBMS, Standards. are easiet tovenforce. Standards may relate to the. naming of the data, \the format of company of organisation using the database’Standardisation of data particularly helps in migrating or interchanging data between different systems. ¢ \ _ \ 5.Improvement in Data Security.+In conventional systems, applications are developed in,an improper manner, usually different systems of an organisationwould access different components of the operational data, In such an environment, enforcing security can be quite difficult, Setting up ofa database management system makes itseasier to enforce security restrictions since the data is storedicentrally) DBMS can ensure that the only means of access to the database in through the authorised channel. Hence, data security “ checks can be carried out whenever access is attempted to sensitive data. To ensure security, DBMS provides security tools such as user name and passwords. ‘ | 6. Maintenance of Data Integrity : Data integrity refers to ensuring that the data in the database is accurate. Since, in DBMS, the data is centralised and is used by a number of users at a time, it is essential to enforee integrity controls. Integrity may be compromised in many ways. ~ However, since all data is stored only at one place, it is often easier to maintain integrity then in conventional system. eee tt ‘1. Better Interaction with Users: As compared to traditional. database system, a DBMS often'provides better service to the users. In conventional systems, usually the information is poorly arranged and as a result, the availability of up-to-date information becomes poor. However, in éase of DBMS, the availability of up-to-date information improves since the data can now be shared and the DBMS makes it easy to respond to unforeseen information requests. 8. Efficient System : It is very common to change the conten, f stored data. These changes can easily be made in a databae aanagment system, than in a conventional system as these change lo not need to have any impact on application programs, The cost f developing and maintaining systems is also lower. Q. 6. Explain the disadvantages of DBMS. Ans. °, Disadvantages of DBMS | 1. Problems associated with Centralization: Centralizatio, increases the security problems and disruption due tothe downtime, and failures. pinnee 2. Cost of Software’: Today’s there are several software whig, are very costly. Hence from economic point of view it is the drawback’ 3. Cost of Hardware: It incurred in the application f DBMS is its major disadvantage. Cost of the hardware ‘is. also 61 r€ of the major drawback. “ : ; el 4, Complexity of Backup and Recovery‘ DBMS provide the centralization of the data, which requires the adequate backups of the data so that in case of failure) the data can be recoyere(, Hance backup problem in also the drawback. Q..7. Explain the difference. between database and file system. . Ans. Difference between Database and File system | DBSM : File Processing System _|@Data, redundancy problem _js|Here redundancy problem exist, | not found: ‘ i i |2. Data. inconsisteney does: not|It also exist in this. ; MY exist. se { \3. Accessing database is easier, Accessing database ~ is = comparatively difficult. : 4, The problem of data isolation is|Data are scattered in various file not found in it. : in different formats. Writing nev! , +>. |program to retrieve appropriate data is difficult, . Atomicity “and” ‘intergrating|Atomicity problems are not found. a and .~ integrating problems are found, 6. Security of data is in DBMS, Here it is not good. 7. Concurrent Access and Crash Here there is a no:current access Recovery, ... and no recovery. Q. 8. Explain the advantages and disadvantages of file based system. : (DBRAU 2015) Ans. Advantages of File-based systeni : Although no one uses files today yet they have not been eliminated completely from our literature. This is because of some of its advantages that are given below : ; is | 1. It helps in overall understanding of design compexity of database systems. : =e 2, It provides a useful historical perspective on how we handle oma It results in smooth transition from traditional ‘file-based system to newer database systems. This is because we have already understood the problems inherent in file-based systems. \ Disadvantages of File-oriented systems : Traditional (conventional) file-oriénted system has the following disadvantages : 1. Data redundancy: Since these systems used a) détentralized approach, so each department used its owri ‘application programs and files. This resulted in data redundancy or duplicacy of information in several files.. This is not-required as it requires additional ‘storage spaces, extra time and’money. Also more effort is required to keep files up-to-date. Duplication can lead to loss of data integrity i.e., data is no longer consistent. ° 2, Poor data control Since these systems are decentralized in nature, so,ther'e was no centralized control on the fields. This made field-names‘ambiguous having many meanings: This results impoor data ‘control. * 3. Poor. data manipulation capabilities : Since’these “systems do not provide strong connections between data in different files so it’s data manipulation capability is quite low: 4,Data dependence : In these systems, files and records were described by specific physical formats that were coded into the application programs. If the format of a certain record was changed, the-code in each file containing that format must be updated. Also the instructions of data storage and access were written into the application’s code. So, changes in storage structure or access , methods could greatly affect the result of an application. : 5. Incompatible file formats : As we know that the structure of flies is embedded in the application programs, so the structures are dependent on the application programming language. _ os For example,ithe structure of a file generated by a PASCAL gram may be different‘from the structure of.a file generated by a C/C ++ program. Please note that the direct incompatibility q such files makes them difficult to process jointly. 6. Security problems : Every user of the database systen, should not be allowed to access all data. Since application program, are added to the file-oriented systems in adhoc manner, it wa difficult to enforce such security system. Q.9. Who is DBA ? Explain the role of DBA. (DBRAU 2018) Ans. Database Administrator (DBA) A DBA is an individual person or a group of persons with ay overview of one or more databases so that he/she can control thy design and the use of these databases. A DBA is the highest salary paid in an organization. A DBA provides the necessary technica support for implementing policy decisions of databases. Please note that the DBA is the central controller of the database'system who manages all resources like database, DBMS andrélated software. A DBA is supported by a number of; Staff Or a team of _ system programmers and other technical essistants. The main functions of a DBA are as follows : 1. Defining conceptual schema : A DBA creates the conceptual schema corresponding to the abstract level database design made by datajadministrator. Please note that the DBA creates the original database schema and the structure of the database. 2. Physical database design: ADBA decides how the data is to berepresented in the stored databriee: This process is called. as the physcial database design. 8. Security and integrity checks: A DBA is responsible: for providing the authorization and authentication checks so'that no malicious users can access the database. DBA must ensure the integrity of the databases also. 4, Give backup and recovery strategies: A DBA auc define and implement an appropriate periodical recovery strategy to revover the database from all types of failures. 5. Granting access to users : A DBA regulates to usage of specific parts of the database by various users. A DBA grants access to use the database to its users, * Q. 10. Explain the characteristics’ of database approath Ans. Characteristics of Database Avproneh. _ The major characteristics of database approach are : (a) Self-describing nature ofa Database system: (b) Insulation between Programs, data and data abstraction. (c) Support of mulitple views of data. (d) Sharing.of Data and Mulit-user Transaction Processing. Data in the database has some characteristics that are discussed elow : ' [ 1. Shared : Data in a database is shared among different users and applications. \ 2, Persistence : Data in a database exists permanently i.e., the data can live beyond the scope of the process that created it. 8. Integrity : Data should be correct with respect to the real world entity that they represent. 4, Security :-Data need to be protected from unauthorized access. i a -. 5. Consistency : Data must be consitent to the data-typéithat stores it. For example, an integer should store an integer only and not a character. a ‘ > -Q. 11. What do you undestand bydatabase models ? Explain different database models. , \ A(DBRAU 2015) “Ans. -_ + Database Models Data Modelling is a way of organising a collection of information pertaining to a system under investigation. A database model is a collection of conceptual tools for, describing data, data relationships, data semantics andonsistency constraints. It consists of two parts : “(a) A’ mathematical’notation for describing the data and relationships. % : (b) A set of operations used to manipulate the data. « Every database and database management system is based ona particular. database model. A database model consists of rules and standards that define how data is organised in a database. It provides a strong theoretical foundation of the database structure. This theoretical base. enchances the power of analysis, the ability to extract inferences and to create deductions that emerge from the new data. Different models provide deficient conceptualizations of the database and they have different outlooks and different perspective. There.are four basic types of database models : Hierarchical, Network, Relational and object-oriented database model. ; - Hierarchical Database Model The hierarchical database is the oldest form of database. It was. developed by the IBM for its IMS (Information Management System) database. This data model organises the data in a tree structure, that is, each child node can have only one parent node and at the top of the structure, there is a single Pear eee In this model, a database record is a tree that consists prone more groupings of fields called segments, which makeup . ie individual nodes of the tree. All the instances of a specific recor ee grouped together as a record, the hierarchical model uses parent-child, that = oo ant vantaas at hierarchical database is tht data access is quite predictable in structure, and therefore, both seiovall La updates can be optimised by a DBMS. However, as the parent-cl i ld relationship is one-to-may, it restricts a child segment to having, only one parent-segment. In the hierarchical database model, the links are ‘hard. coded’ into the data structure, that is, the linksis permanently established and cannot be modified. The hard coding makes the hierarchial model rigid. College Database) .[ Us @-Tech) Ea oo ea Ve fir] °e)» [Fs MBAI - ~ 4 Network Database Model The nétwork database model was developed asa alternative to the hierarchial database. This model was formalised in 1971, by the Database Task Group (DBTG) of the conference on Data Systems Languages. The network database model expands on the hierarchial model by providing multiple paths among Segments, that is more than one parent-child relationship. Hencé, this model allows having 1:1 (one-to-one), 1: M (one-to-many) and M: M (many-to-many) relationships, : ' The basic data-modelling construct in the network model is the set construct.-A set consi. me of the drawbacks of the primary drawback of networked database Dea ee complicating to maintain all the links" es-> that it can be quite Innetworks database model, all the relationships are hardwired (Pre-computed) and build into the structure of ‘the database itself. Therefore, they are very efficient in space utilisation and query execution times. However, the price for such performance is inflexibility and great difficulty of use. Ravi Tina Leena ] | Maths History English | Ram Yuvraj ‘Arun Fig. : Network database model _ Relational Database Model: The hierarchical and network databasemodel) although more flexible than tradition file systems, were'still not flexible enough, The limitations of these,database systems led to the development’ - of Relational Database Management\System (RDBMS). The key difference between previous database models and relational database model is in terms of flexibility. It is relatively easy and quick to create a new database structure and amend existing structures in relational systems as\compared {o reconstructing a network database which is @complex and time consuming task. : « Relational database managment system is based on the relational model developed by E.F. Codd. A relational database represents all datas in the database as simple two-dimensional tables called relations that are the logical equivalent of files. _ . Each:row (record) of a relational table, called tuple, represents a data Entity with columns of the table representing attributes (fields). The allowable values for these attributes are called the domain, indicating that values can be placed in each of the columns of the relational table. Each row in a relational table must have a unique primary keys and typically, it has some secondary keys, these secondary keys correspond with primary keys in other tables, ie., relate all the tables. For example, in Fig. mentioned below; along with ISBN as the primary key, the Book table has secondary keys AUTHOR-ID-and PI’ 8-ID. In turn, these keys serve'as primary keys for the AUTHOR and PUTLISHER tables, respectively. Author Table searun ee Table v Author ID | Author Namo| Author_DOB Pub_ID Publisher Pub_Address : 567896 Sack 8/07/1956 8876432 | 89 bex Books | Walker atroet| { 128875 Kabir 9/04/1958 994683 | 5KG Pub. | Joint street | ( 76928 | Gaurav’ | 10/08/1960 | |_888777_| Pearson Ed. | Mumbai T1654 Hars 9/10/1962 9765543 | Katson Pub. | New Delhi Book Table aoa ! ISBN Author_ID | | Pub_ID Date , Title 1-6885-81-11| 567896 8876432 1995 _| Computer Fundamental $-8674-10-21| 123875 994683 1998 ____ | Operating System’ $-6482-12-18| 876923 888777 1978__[M.S. Office 6-7281-22-15| 776544 - | __976543 1999 _|DataStructure Fig. : Relational Database Model . : In a relational database, threé basic operations are. used to develop useful sets of data : selection, projection and join. The selection operation retrieves certain records from a table based on the user specified criteria. The projection operation extracts fields from a table. Permittingthe user to create new tables that contain only the requirediii:formation. The join operation combines the data from the two tables\based on‘a common column, providing the user with more information than is available in individual tables, Together these three operations all called relational algebra. The relational databases provides flexibility that allows charges to the database structure to be easily accommodated. The relational database system is truly a mathematically compléte data model- Relational model facilities multiple views, thatis, it is easy to present different with different views of the same database. It also in corpor. concurrency control, which guarantees the correct executic concurrent queries, ' i 3 Object-oriented Database Model : The relational database model has been successfully in a wide variety of application areas, However, it does not easily support the and provides an outlook for the future database models. An object- oriented database stores and maintains obects. An object is an item that can contain both data and the procedure that manipulation the eae compared to relational databases, object-oriented database system can store more types of data and access these data much faster. With an object-oriented database, a system can store and access unstructured data such as pictyres, videoclips, sounds more iently. : Sree ovsinieated databases often use a query language called. Object Query Language (OQL) to mainpulate and retrieve data. In figure sketch below is a simple example of object-oriented database structure. The class population is the root of a,class hierarchy, which includes the Nation class. The Population class in.also the root of two sub-class; Men and Women. The‘Nation class is the root of other sub-classes namely, Country, 1, Country 2 and Country 3. Notice that each class hasits own:set of attributes apart from the root class’s attributes. <4 * ‘ee * Population’ i ¢ OY Nation Continent re Govt. Time standard| Language |, ,-| Language currency 5 currency *. Country 18 = A «Country 3 t Language. currency Country 2 | . Fig. : Object-oriented database model Q: 12. Explain Schema and instances... - Ans, B Schema and Instances » eg 2 “The collection of information. stored in the database‘at a particular moments is called an instance of the database.” “The overall design of the database is called the database schema.” : “ 2 . The concept of database schema-and instances can be understood by analogy to a program written in a programming language. A database corresponds to the variable declarations in a program, Each variable has a particular value at a given instant. The'values of. ‘the ‘ variables in a program at a point in time corresponds to an instance of a database schema, ‘ i “There are three types of schema : 1. Physical schema 2. Conceptual schema 8. External schema External Schema 1] External Schema 14 i Fig.’ * ae ~ 1. Physical Schema: Physcial schema'describes the databas, design at the physical level. It specifies additional storage details Essentially, the physical schema summarises how the relation described in the conceptualschema are actually stored on secondary devices such as disks and,tapes. i 2. Conceptual ‘Schema : The conceptual schema (sometimes called logical schema) describes the stored data in terms of ‘the data model ofthe/DBMS. In a relational DBMS, the conceptual schema describes all,relations that are stored in the database. ( 8. External Schema: External schema, which usually aré also in terms of the data model of the DBMS allow data access to be customised at the level of individual users or groups of users, Q. 13. Explain data independence. (DBRAU 2015) Ans. 5 Data Indepencence Pa The ability to modify a schemia definition in one level without affecting a schema definition in the next higher level is called Data Independence. : e : Data indepencence is one of the main advantage of the DBMS. It is of two types: ; : : é 1. Physcial Data Independence 2. Logical Data Andepencence 5 4 1. Physical Data Indepencence : The separation of the conceptual view from the internal view enables us to provide a logical description of the database without the need to satisfy physical Modification ate hee called. physical data independence. Physical level is occasionally necessary in order . 1, What do you understand by ER Model ? Soy a Entity Relationship (ER) model was introduced by P} Chen in 1976. An ER Model is‘defined as'a conceptual data mode that views the real world’as entities. and relationships. An ER-modg is useful to a'database designer in the following ways : = : - 1. An-ER-Model maps Well to the rélational ‘model i.e., th constructs ‘used in' the ER model can be easily transformed int, relational tables. -!% 026 5 e ween age 2."An ER-Model-can be used by the database: desiner t, ‘communicate the design to the end user. Sd Ee ~. . 8. An ER model can be used as a design plan by.the,' atabase developer to implement, a data model in specific DBMS software. --Q. 2. Explain the following terms : . ¢ (a) Entity, (b) Entity type set, (c) Relationship, (d) Degree of relationship, (e) Attributes, (f) Relationship. (DBRAU 2015) Ans. Basic Terminology Related to ER-Model -* : 1, Entities : Anything which exists and is disting; ishable frum one another is known:as an entity. For example, MPLOYEES. TABLE, CHALK, BOARD, PEN etc. are some of the entities: Pleasé note that an entity.is analogous to a table in the relational-model. ! Entities are of: two types :(a) Independent entity,-(b) Dependent ‘entity. —~ Cay eure An independent entity is one that does not rely. identification. While'a dependent entity is one that reli for identification, rene note that an entity occurrence (or j is an individual otcurrencé of an entity. Also note that an ace ‘is analogiiné'te’é row in the relational table...) 2. Entity Type (or Set) : It ig rder to reconcile a many-to-many r aber that the subtypes entities are used “in generalization hierarchiesjto represent a subset of instances of their parent entity (or super. type), but which have attributes or relationships that apply to the subset, : : For example, an entity-set PROJE CT with two entiti d P, are shown below in Fig. : : oe Pian _— Entily-set (PROJECT) Entities << | Fig. : An entity-set Project with entities P, and P, Here, P, and P, are two entities (or relations) with some attributes (or fields), say, (PROJ-ID, START-DATE, END-DATE). Then, the data within this table will form a value whereas a combined values of P, and P, will form a value-set. 3. Relationships : 2A relationship represents .an association between two or more entities. They are classified in terms of. ‘degrée, ‘connectivity, cardinality and existence. For example, ISA relationship, HASA relationship etc. Please note that the relationship has no physical, or conceptual existence: other than that which depends upon their entity associations. A particular occurrence ofa relationship is called as a relationship instance or relational occurrence»In’an ER-model similar relationships are grouped into relations séts called as.the- relationship type. Itis.a set ofmeaningful associations between one -0n' participating \entity types. Please remember that each relationship type is given a name that describes its function. Also note thatthe relationships with the same attributes fall into one peli set. : 4 . Dagree ofa Rel tionship : Itis defined as the number of nt é relationship. " ere are three type: of degrees of relationship : , (a) Unary or Recursive relationship, (b) Binary relationship, ~ “‘(c) Ternary rélationship. ; Please remember that the n-ary Tleem ante, is ie general form for degree n. ., Here, ifn=1, the relationship degree'i is 1, also calléd a as saiy ~ relationship. If n = 2, it is called as binary relationship and if n= =8, . Avis called as ternary relationship. -Recursive relationships are sometimes: called. as “unary relationships. It is defined as a relationship between the instances of a single entity type. This means that an entity related only to “another instance of its own type. For example, consider a recursive binary relationshj “manages” that relates an entity PERSON to another PERSON by management. That is, Managed Fig : Recursive relationship Binary relationships are the association between the two ‘entities, So, it's degree = 2. Please note that recursive binary relationship occurs when an entity is related to itself. For example, ‘a binary © relationship is shown in Fig. given below : ‘ , 5 EMPLOYEE = Fi . Ternary relationship is ‘defined as an association among three entities and is uséd whenmbinary relationship is not sufficient. For example, . ‘ ay Fig: A ternary relationship =), * Three entities are connected with a diamond (relationship) named USES. We.can designate the connectivity of each entity as either ‘one' or 'many'. ~~ E wh aad eee 5. Connectivity or Cardinality : The connect: of a relationship describes the mapping of associated entity instances in the relationship. The values’ of connectivity are “one” or“many’”. : While the actual count of elements associated with the connnéctivity is called as the cordinality of the relationship connectivity. Please note that the term cardinality is used much ‘less frequently than the connectivity constraint because the:actual values are-usually variable across relationship instancés.. 1s ee ‘anere are three basic types of connectivity for relations and they are as follows : : (a) One-to-One(1:1) - (b) One-to-Many (1: M) diner ~ (c) Many-to-Many (M : M). A1:1 relationship is when at most one instance of an entity (say, A) is associated-with one instance of another entity (say, B). For example, one.teacher teaches one student. A1:N relationship is when for one instance of entity A there are zero, or many instances of entity B..For example, one teacher teaches many students. we . A M:N, relationship is when for one instance'of entity A, there are zero, one or many instances: of entity B..For example, many teachers teach many students.” vel b Please remember ‘that M : N:relationship cannot be directly translated to the relational tables but instead must be transformed into two or more one-to-many relationships using associative entities. ¥ 4 6. Attributes : Attributes define the properties of a data object of entity. For example, attributes of flower are it's colour, it's texture etc. Similarly, the attributes of ajball are its shape, colour, size etc. Note here that both ‘flower’ and ‘ball”are the data objects. The collection of all possible values that an attributes can have is known as the domain(ofian attribute. For example, the date of birth attribute for both ‘manager’ and ‘labourer’ entities can share the same domain.» 7 We shall now classify these attrributes. (See Fig). = ~ Attributes ‘ ; _ Fig : Types of attributes _ . |. Simple (or atomic) Attributes : A simple or atomic attributes is defined as an attribute that is composed of.a single component with an independent existence. Please note that a simple attribute cannot be further subdivided. For example, Age, Salary, Person-ID etc. are simple attributes. These attributes are atomic attributes. ‘ : ‘ : IL. Composite Attribute : A composite attribute is defined as an attribute composed of multiple components each with an \independent existence. Please hote here that\some attributes can be further divided to yield smaller components with an independent existence of theri own. For example, the attribute, Name is a composite attribute which can be further subdivided into tname, mname and Iname, i.e, first-name, middle-name and last-name, ‘Also note that the decision of subdividing or modeling an attribute into simple or composite attributes depends on the user view of the data. ‘ ad Single-Valued Attribute : It is defined as an attribute that holds'a single values for a single entity; The majority of attributes are single-valued for a particularentity. . For example, the attribute (or/property or: characteristic or field) ROLL-NO is a single-valued attribute. : ; IV. Multi-valued Attribute : It is defined as an attribute that holds multiple values fora’single entity. For example, for a student’ entity, if one of thé attributes is ‘Hobby’ then ‘Hobby’ can have jnultiple values like,reading, dancing, gardening and so on. Please note,that’a multi-valued attribute.may have a set of numbers with upper'and lower limits. Like, our. ‘Hobby’ attribute above a student may have'a minimum of 1-hobby and a maximum of 3-hobbies where 1 is the lower-limit and 3.is the upper limit. V. Derived Attribute : It is defined as an attribute that represents a value that-is derivable from: the value of related attribute or a set of attributes, not essentially in the same entity. So, the-valuts held a some ,attributes:are derived from two or more attribute values. For example, the age attri i esacivres fromthe dato-of birth attribute and sashes aon

You might also like