Data Base Management System Notes
DBMS Concept
Database Management System (DBMS)
A database management system (DBMS) is a program that lets one or more computer users create and access data in a database. A DBMS can be thought of as a file manager that manages data in databases rather than files in file systems. The DBMS provides integrity of the data, i.e., making sure data continues to be accessible and is consistently organized as intended and security making sure only those who have privileges can access the data. The DBMS manages user requests and requests from other programs so that users and other programs are free from having to understand where the data is physically located on storage media and, in a multi-user system, who else may also be accessing the data.
Major functions of a database are:
1. Creating records of various data types such as integer, real, character, etc.
2. Query will be made by a standardized language such as SQL (Standard Query Language).
3. Operation such as sort, delete, modify, select, etc.
4. Manipulation such as input, output, analysis, reformatting, etc.
5. Documentation such as metadata or description of the contents of the database should be compiled.
There are four types of database models:
1. Hierarchical model.
2. Network model.
3. Relational model.
4. Object oriented model.
A DBMS is usually an inherent part of a database product. Microsoft’s SQL Server is an example of a DBMS that serves database requests from multiple clients (users). On PCs, Microsoft Access is a popular example of a single- or small-group user DBMS. Other popular DBMSs are IBM’s DB2, Oracle’s line of database management products and Sybase’s products.
Domain Relational Calculus
Domain variables take on values from an attribute’s domain, rather than values for an entire tuple. An expression is of the form:
{ | Q(x1, x2,…, xn)}
Where the xi, 1≤ i ≤ ni represent domain variables, and Q is a formula.
1. An atom in the domain relational calculus is of the following forms:
• € r where r is a relation on n attributes, and xi, 1 ≤ i ≤ n, are domain variables or constants.
• x Θ y, where x and y are domain variables, and Θ is a comparison operator.
• x Θ c, where c is a constant.
2. Formulae are built up from atoms using the following rules:
• An atom is a formula.
• If Q is a formula, then so are Q and (Q).
• If Q1 and Q2 are formulae, then so are Q1 V Q2, Q1 Λ Q2 and Q1 => Q2.
• If Q(x) is a formula where x is a domain variable, then so are x (Q(x)) and x(Q(x)).
Tuple Relational Calculus
A tuple relational calculus expression is of the form
{t | Q(t)}
Where Q is known as formula.
We also use the notation
• t[a] to indicate the value of tuple t on attribute a.
• t Є r to show that tuple t is in relation r.
1. A tuple variable is said to be a free variable unless it is quantified by Then it is said to be a bound variable.
2. A formula is built of atoms. An atom is one of the following forms:
• δ Є r, where δ is a tuple variable, and r is a relation (¢ is not allowed).
• δ[x] Θ u[y], where δ and u are tuple variables, and x and y are attributes, and Θ is a comparison operator (<, ≤ , =, ≠, >, ≥).
• δ[x] Θ c, where is a constant in the domain of attribute x.
3. Formulae are built up from atoms using the following rules:
An atom is a formula.
• If Q is a formula, then so are Q and (Q).
• If Q1 and Q2 are formulae, then so are Q1 V Q2, Q1 Λ Q2 and Q1 => Q2.
• If Q(δ) is a formula containing a free tuple variable δ, then
δ Є r(Q(δ)) and δ Є r(Q(δ))
are formulae also.
3. Note some equivalences:
• Q1 Λ Q2 = (Q1 V Q2).
• t Є r(Q(t)) = t Є r( Q(t)).
• Q1 => Q2 = Q1 V Q2.