Showing posts with label DATABASE MANAGEMENT SYSTEM/DBMS. Show all posts
Showing posts with label DATABASE MANAGEMENT SYSTEM/DBMS. Show all posts
What is HAS relation?
HAS relation :- Consider a customer has a two types of account namely saving account and CHECKING ACCOUNT. Also consider, internet rate is an attribute of saving account and overdraft amount is an attribute of checking account.
WHAT IS GENERALIZATION ? DISCUSS ABOUT GENERALIZATION
GENERALIZATIONà Consider the entity set ACCOUNT with Attributes à Acc-No & BALANCE Each Account Contains
1. SAVINGS-ACCOUNT
2. CHECKING-ACCOUNT
Each of these is described by a set of attributes which includes all the attributes of entity set. ACCOUNT PLUS additional attributes . For example SAVINGS-ACCOUNT entities are described further by the attributes INTEREST-RATE while CHECKING ACCOUNT are described further by the attributes OVERDRAFT – AMOUNT. These are similarities between the CHECKING-ACCOUNT entity set and the SAVINGS ACCOUNT entity set in the sense that they have several attributes in common. This commonality can be expressed by generalization which is a containment relationship that exist between a higher level ENTITY set and one or more lower level entity sets . In the above example, ACCOUNT is the higher level entity set and SAVINGS-ACCOUNT and CHECK a ACCOUNT are lower level entity set.
In term of an E-R diagram, generalization is depleted through a triangle component labled is a as shown in following figure. The table ‘ISA’ stands for “is a” and represent that a SAVINGS-ACCOUNT “is an” ACCOUNT.
Discuss about Primary of a Weak Entity Set
OBTAINING PRIMARY OF A WEAK ENTITY SET :-
The primary key of a weak entity set can be obtained as follows :-
Case 1 àThe weak entity set is dependent on a strong entity set and has a discriminator. The discriminator of a weak entity set is an attribute or a set of weak entities related to one strong entity whose primary key value is given.
For exam. The discriminator of weak entity set DEPARTURE is the attribute DATE. Hence the primary key of the entity set DEPARTURE is {File No, Date }.
Case 2 à The weak entity set is dependent on two distinct strong entity sets. In this case, the primary key of the weak entity set is form by the two primary keys of the two strong entity set.The entity set QUOTATIONS is a weak entity set which is depending on two entity sets SUPPLIERS and ITEMS. The weak entity set has no discriminator. A QUOTATION entity is uniquely identified only when both the supplier who has furnished it and the item for which it has been furnished are known. Thus the primary key of the weak entity set QUOTATION is { S-name, S-Add, I-No }.
What is weak and strong entity set ?
Weak and Strong Entity Set :-
An entity set is called a weak entity set if its existence depends on other entities (called strong entities). Thus a weak entity set does not have sufficient attributes to form a primary key. An entity set when has a primary key is called a strong entity set.
What is cascading delete and cascading update ?
Cascading Delete and Cascading Update :-
Referential integrity is a feature of relational database management system. Let table B has a foreign key that point to a field in table A. If a record be deleted from table A, recorders of table B that are linked to the deleted record will also be deleted. This is known as cascading delete.
Further if the value of a linked field in the table A be modified, all records in table that are linked to it also be modified accordingly. This is Known as cascading update.
Write a short note on Relationship within a data model. Discuss about Relationship within a data model
Relationship within a data model :-
A relationship is a mapping or linkage between two sets of data. It can be one-to-one, one-to-many, many-to-many.
1. One-to-one: An entity in A is associated with at most one entity in B and an entity in B is also associated with at most one entity in A.
Example: Between two entity set TEACHER and DEPARTMENT, considered the relationship HEAD-OFF. If we assumed that each department can have only one head an one person can not the HEAD-OFF more than one department, then the relationship HEAD-Off more than one department, then the relationship HEAD-OFF is one-to-one.
2. One-to-many:- An entity in A is associated with any number of entities in B. However an entity in B can be associated with all most one entity in A.
Example: At a given point of time, zero, one or many patients are assigned to one hospital room that is a hospital room may have zero, one or many patients but a patient is assigned to only one hospital room then the relationship between ‘hospital room’ and ‘patient’ is one-to-many.
-à An entity in A is associated with more than one entities in B. More than one entity in B can be associated with one entity in A.
3. Many-to-many:- An entity in A is associated with any number of entity in B and on entity in B is associated with any number of entities in A.
Example: A surgeon may have operated on several patients. A patient may have be operated on by several surgeons. Then the relationship ‘patient’ and ‘surgeon’ is many-to-many.
Short note on E-R diagram (Entity Relationship Diagram).
E-R diagram (Entity Relationship Diagram) :-
The overall logical structure of a data base can be expressed graphically by an ER diagram which consist of the following components.
1. Rectangles , which represent entity sets.
2. Ellipses, which represent attributes.
3. Diamonds, which represent relationship among entity set.
4. Lines, which link attributes to entity set and entity sets to relationship.
E-R diagram for a part of the database of a project management systems.
Some symbols used in E-R diagram
What is foreign key ? Short note on foreign key.
Foreign Key :-
Foreign Keys represent relationship between tables. A foreign Key is a column or a group of column whose values are derived from the primary key or unique key of some other table. The table in which foreign is defined a foreign table or detail table. The table that defines the primary or unique key and is referenced by the foreign key is called the primary table or master table.
For example consider two relations STUDENT ( REGN – NO, NAME, COURSE, STATUS ) and BATCH (Roll-No, REGN-No). Also we consider REGN-No in STUDENT relation is a primary key and it is referenced to the attribute REGN-NO in BATCH relation. Thus REGN-No is a foreign key with respect to the relation STUDENT.
What is the referential integrety constant ?
Referential Integrity Constant :-
The referential integrity constant are specified between two relations and is used to maintain the consistency among tuples of the two relations.
The referential integrity constants states that a tuple in one relation that reefers to another relation must reefer to an existing tuple in that relation.
For exam, the attribute D.N.O of EMPLOYEE given the department number for which each employee works, hence its value in every ‘employee’ tuple must match the D NUMBER value of some tuple in the DEPARTMENT relation.
Tab-1
EMPLOYEE | NAME | - | - | - | - | DNO |
| Amal Bimal Kamal Shyamal | - - - - | - - - - | - - - - | - - - - | 5 5 4 1 |
Tab-2
DEPARMENT | DNAME | DNUMBER | MGRSSN |
| Research Administration Quarter | 5 4 1 | - - - |
What is null value ?
Null Value :-
In some cases a particular entity may not have an applicable value for an attribute. For example a ‘college-degree’ attribute applies only to person with college degrees. For such actuation a special value called null is created. Null can also be used if we do not know the value of an attribute for a particular entity.
What is composite attributes, simple or automatic attributes and multi valued attributes ?
Composite Attributes, Simple or Automatic Attributes and Multivalued Attributes :-
Composit attributes can be divided into smaller subparts, which represent are basic attributes with independent meanings. Composit attributes can form a hierarchy.
Attributes that are not divisible are called simple or automatic attributes.
A hierarchy of composit attributes.
Most attributes have a single value for a particular entity, such attributes are called single valued. For example ‘age’ is a single valued attribute of person. In some cases an attribute can have a set of values for the same entity. For example a ‘college-degree’ attribute for a person. One person may not have a collage degree, another person may have one and third person may have two or more degrees. So different persons can have different number of values for the college-degree attribute. Such attributes are called multivalued attribute.
What is Alternate Key ? Short note on Alternate Key
ALTERNATE KEY :-
A Candidate key which is not the primary key is known as alternate key. For the above example, two candidate key as {CUST-NO } and { CUST-NAME, ADDR }. If the attribute { CUST-NO } is a primary key. The alternate key is { COST-NAME, ADDR}.
What is Primary Key? Write a Short Note on Primary key
PRIMARY KEY :-
A primary key is a candidate key that is chosen by data base design as the principle means of actually identifying entities with in an entity set.
For example, the candidate key CUST-NO can be consider to be the primary key for the entity set CUSTOMER.
What is Candidate Key ? Short note on Candidate Key.
Candidate Key :-
A candidate key is a minimum super-key that is superkies for which proper subset is a superkey.
For example, suppose that a combination of CUST-NAME and ADDR is sufficient to distinguish among members of the customer entity set. Both {CUST-NO} and {CUST-NAME, ADDR } are candidate keys. Although the attributes CUST-NO and CUST-NAME together can distinguish customer entities but there combination does not form a candidate key, since the attributes CUST-NO alone is a candidate key.
What is Super-Key? Short note on Super Key
Super Key :-
A super key for an entity set is a set of one or more attributes whose combined value uniquely identifies the entities in the entity. For example, an entity CUSTOMAR contains the attributes CUST-NO, CUST-NAME, ADDR . The CUST-NO attribute of the entity set CUSTOMER is sufficient to distinguish one customer entity from another. Therefore, CUST-NO is a super-key. Similarly the combination of CUST-NO and CUST-NAME is a super key for the entity set CUSTOMER. The CUST-NAME attribute is not a super-key, as several people might have the same name.
What is Relational Data base management system(RDBMS) ? Discuss about Relational Data base management system(RDBMS) with suitable example
Relational Data Base Management System (RDBMS) :-
The relational model represent the data base as a collection of relation. Generally each relation is represented by a table of values. For exam. The data base of files given below is considered to be in the relational model.
Tab-1
STUDENT | NAME | STUDENT NUMBER | MAJOR |
Milan Malay | 17 18 | CS CS |
Tab-2
COURSE | COURSE NAME | COURSE NUMBER | DEPARTMENT |
Data structure Database Discrete Math | CS 131 CS 380 CS 230 | CS MATH CS |
Tab-3
GRADE REPORT | STUDENT NUMBER | GRADE |
17 18 8 8 8 | B C A B A |
It may be noted that each of the above table is known as relation and the whole database is called relational database.
When a relation is presented as table of values, each row in the table represents a collection of related data values. In the above examples, the first table is called STUDENT because each row represents facts about a particular student entity.
In a formal relational model, a row is called a table. A column header is called an attribute and a table is called relation.
EXAMPLE :-
Student ----Roll
Name
Address
Super key = { Roll}
{ Roll, Name }
{ Roll, Name, Address }
{ Name, Address }
Candidate Key= { Roll }
{ Name, Address }
Primary Key = { Roll }
Alternate Key = { Name, Address }
What is data integrity ?
Data Integrity :-
Data integrity refers to validity of data. Data become invalid due to
1. Human error when data is entered.
2. Errors at the time of transmitting data from one computer to other.
3. Hardware multi functioning such as
4. Natural divestitures such as fire, flood etc.
What are the advantages and disadvantages of DBMS?
Advantages :-
1. A DBMS provides the technology for achieving more effective and efficient integrated information system.
2. The amount of redundancy in stored data can be minimized.
3. Security controls can be applied.
4. Application program can be developed, maintained, faster and more economically with fewer skilled personal.
5. Centralized control of the database is possible.
Disadvantage :-
1. High initial investment in hardware, software and training.
2. Overhead for providing security.
What is Inconsistency?
Inconsistency :-
Files that represent the same data may become inconstant. This may happen because an update is applied to some of the files but not to others.
What is Redundancy?
Redundancy :-
Redundancy means storing the same data multiple times and that leads to several problems.
1. Entering data on a new student multiple times- this leads to duplication of effort.
2. Storage space is whets when same data is stored repeatedly – this problem may be serious for large data bases.
Subscribe to:
Posts
(
Atom
)