
DATABASE Database is an important constituent for collection and storage of data. Data provided information after processing on them. To managing record and important data Databases server used. Database transaction is a unit of work in database management system. Database transaction must follow term ACID (Atomicity, Consistency, Isolation, Durability). Any transaction started then till it completion, that transaction follow ACID, for successful and no error. The ability to modify the schema definition in one level should not affect the schema definition in the next higher level is called Data Independence. The application is independent of the storage structure and access strategy of data. Two types of Data Independence are: 1. Logical Data Independence: It is more difficult to achieve. Modification in logical level should affect the view level. 2. Physical Data Independence: Modification in physical level should not affect the logical level. ACID Property Means atomicity, consistency, isolation and durability. Atomicity: Each transaction is said to be “atomic". Means if any part of transaction fail then whole transaction failed. In a word say "ALL OR NOTHING". The failure of transaction commonly depend on Hard disk fail, System crash. Consistency: Consistency means only valid data will be written to the database. If any transaction violate any consistency rule of database the whole transaction is Rollback, means it starts again from beginning. Each state in transaction must be consistent for database. Isolation: If two transactions occurs at a time then both are not impact to each other, separate completion of each transaction. The isolation property does not ensure which transaction will execute first, merely that they will not interfere with each other. If second transaction depend on first then it will done, and data update after completion of traction. Durability: Ensures that any transaction committed to the database will not be lost. Durability is ensured through the use of database backups and transaction logs that facilitate the restoration of committed transactions in spite of any subsequent software or hardware failures. KEYS A database key is a attribute utilized to sort and identify data in some manner. There are many keys: 1. Primary key: The primary key is a attribute of a relational table uniquely identifies the each tuple of a table or each record in the table. It can either be a normal attribute that is guaranteed to be unique. Such as Social Security Number in a table with no more than one record per person. Examples: Imagine we have a employees table that contains a record for each employee at a organization. The employee's unique employee ID number would be a good choice for a primary key in the employees table. The employee's first and last name would not be a good choice, as there is always the chance that more than one employee might have the same name. 2. Foreign Key: These keys are used to create relationships between tables. Natural relationships exist between tables in most database structures. Example: Let’s assume that the Departments table uses the Department Name column as the primary key. To create a relationship between the two tables, we add a new column to the Employees table called Department. We then fill in the name of the department to which each employee belongs. We also inform the database management system that the Department column in the Employees table is a foreign key that references the Departments table. The database will then enforce referential integrity by ensuring that all of the values in the Departments column of the Employees table have corresponding entries in the Departments table. 3. Candidate key, Alternate key and Composite key: Any number of attributes that are uniquely identifying a row in a table is “candidate key” for the table. We select one of the candidate key as Primary key. All candidate keys which are not chosen as "primary key" are “Alternate keys”. The key which uniquely identify the rows of the table and which is made up of more than one attribute is called “composite key”. For Example: In a class we have to select Class Representative. So A, B, C and D stand for that post. So A, B, C and D are candidate for Class Representative so these are candidate key. We select B as Class Representative so B is primary key and A, C and D can be Class Representative but not selected as a Class Representative so they are alternative choice. So A, C and D are alternate key. When two students of class work together in a project then they are composite key for the class. LEVELS OF ABSTRACTION Physical Level: Physical level is the lower level of abstraction. Its define how data is stored in database. Logical Level: The next higher level of abstraction, its describe what data be store and each logical operation done at this level, links and concept apply here. View Level: This is the higher level describe only part of entire database for a particular user. NORMALIZATION Some rules that should followed to achieve a good database design are: 1. Each table should have an identifier. 2. Each table should store data for a single type entity 3. Columns that should store data for a single type of entity. 4. The repetition of values or columns should be avoided. To remove the redundancy of a table as called Normalization. In other words duplicity or repetitions of data never occur in database. Normalization is mainly minimizing redundancy, insertion, deletion and update anomalies. Normalization achieve through functional dependency. Normalization is much type. Functional Dependency: Functional dependencies (FDs) are used to specify formal measures of the "goodness" of relational designs and used to define normal forms for relations. FDs are constraints that are derived from the meaning and interrelationships of the data attributes. FDs are derived from the real-world constraints on the attributes For example: A set of attributes X functionally determines a set of attributes Y if the value of X determines a unique value for Y X-->Y holds if whenever two tuples have the same value for X, they must have the same value for Y If t1[X] =t2[X], then t1[Y] =t2[Y] in any relation instance r(R) X-->Y in R specifies a constraint on all relation instances r(R) Fully Functional dependency: A functional dependency X --> Y is full functional dependency if any attribute A removed from X. It means that the dependency does not hold any more then it is not Fully Functional dependence. Means each attribute is functionally dependent. All categories are in sequential order: 1.1NF: There is no repetition of values and data in table known as 1NF. In other words the 1NF disallows composite attributes, multivalued attributes, and nested relations, attributes whose values for an individual tuple are non-atomic. 2.2NF: A relation schema R is in 2NF when it is in 1NF and every non-prime attribute A in R is fully functionally dependent on primary key. 3.3NF: A relation schema R is in 3NF ,It is in 2NF and no non-prime attribute A in R is transitively dependent on the primary key. Transitive dependent means if there a set of attribute Z that are neither a primary or candidate key and both X-->Z and Y-->Z holds. 4.BCNF: 3NF inadequate in some situation then it was not satisfactory for the table: 1. That had multiple candidate keys. 2. Where the multiple candidate keys were composite. 3. Where the multiple candidate keys were overlapped. A relation schema R is in BCNF, It is in 3NF and additional constraints that for every FD X -> A, X must be a candidate key. "A relation is in the Boyce-Codd normal form (BCNF) if and only if every determinant is a candidate key " 5.4NF: A relation schema R is said to be in 4NF, it is in BCNF and for every Multivalued dependency X --> Y that holds over R, Either X is subset or equal to (or) XY = R. or X is a super key. 6.5NF: A relation schema R is said to be in 5 NF, it is in 4NF and relation schema R is said to be 5NF if for every join dependency {R1, R2, ..., Rn} that holds R, one the following is true Ri = R for some i. and The join dependency is implied by the set of FD, over R in which the left side is key of R. Demoralization The intentional introduction of redundancy in a table in order to improve performance is called demoralization. The decision to demoralize results in a trade- off performance and data integrity. Demoralization increases disk utilization. OTHER DATABASE MODELS Relational Database Model Data represent in form of column and row, column means attribute and row means touples present instance of data. This Database model came into existence with help of mathematical concepts. Its using some other concepts like normalization, touple relational calculus. E-R Model in Database E-R model stands for Entity-Relationship model. This data model is based on real world that consists of basic objects called entities and of relationship among these objects. Entity in database, which existence in real world with number of attributes. In a table attribute know as column. Relationship is a logical thing which relates entities. The E-R diagram shows structure of E-R model. Object Oriented Database Model This model is based on collection of objects. An object is instance variables which store value and bodies of code, that codes are called method. These codes have written to operate the objects.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages43 Page
-
File Size-