Fundamentals of Database Management System
Fundamentals of Database Management System
Answer of Q.1
(a) Advantages of Database Systems:
1. 2. 3. 4.
The DBMS is a central system, which provides a common interface between the data and the various front-end programs in the application. It also provides a central location for the whole data in the application reside. Providing data security against unauthorized access. Provide an efficient and convenient environment that is used to store data in, and retrieve data from a database.
Functions of DBMS Data Definition: The DBMS provides function to define the structure of the data in the
(b) 1.
application. These include defining and modifying the record structure, the type and size of fields and the various constraints/conditions to be satisfied by the data in each field.
2. Data Manipulation: When the data structure is defined than data needs to be interested,
modified or deleted, the function which perform those operations are also part of the DBMS. These functions can handle planned unplanned data manipulation needs.
3. Data Security & Integrity: The DBMS contains functions, which handle the security and
integrity of data in the application. These can be easily invoked by the application and hence the application programmer need not code these functions in his/her programs.
4. Data Recovery and Concurrency: Recovery of data after a system failure and concurrent access
DBMS. Hence the DBMS has a set of programs forming the Query Optimizer, which evaluates the different implementations of a query and chooses the best among them.
Answer of Q.2
(a) Difference operator: The difference operator builds a relation of tuples appearing in the first
but not the second of two specified relations. For Example: To retrieve Cust # of customers who have placed orders in July but not in August. Cust # 001
A A A B
X Y Z W
X Y Z
City City NY CA WA
Answer of Q.3
First Normal Form: No Repeating Elements or Group
In database lingo, this group of rows is referred to as a single database row. Never mind the fact that one database row is made up here of three spreadsheet rows: It's an unfortunate ambiguity of language. Academic database theoreticians have a special word that helps a bit with the ambiguity: they refer to the "thing" encapsulated by rows 2, 3 and 4 as a tuple (pronounced tu'ple or too'ple). We're not going to use that word here (and if you're lucky, you'll never hear it again for the rest of your life). Here, we will refer to this thing as a row.
Second Normal Form: No Partial Dependencies on a Concatenated
Next we test each table for partial dependencies on a concatenated key. This means that for a table that has a concatenated primary key, each column in the table that is not part of the primary key must depend upon the entire concatenated key for its existence. If any column only depends upon one part of the concatenated key, then we say that the entire table has failed Second Normal Form and we must create another table to rectify the failure.
Third Normal Form: No Dependencies on Non-Key Attributes
At last, we return to the problem of the repeating Customer information. As our database now stands, if a customer places more than one order then we have to input all of that customer's contact information again. This is because there is columns in the orders table that rely on "non-key attributes".
Answer of Q.4
(a) Select: The select operator extracts specified tuples or rows from a given relation, based on a
condition. For example: A student table has the attributes ROLL NO., Student Name, Age and Gender, The condition is to extract the tuples of only those student whose age is more than 25. ROLL NO. 0910 0976 STUDENT NAME Anisha Nancy AGE 28 30 GENDER Female Female
(b)
Project: The project operator extracts specified attributes or column from a given relation.
For example: If only the name and age of the students is to be extracted, the resultant relation appears, as follows Student Name Anisha Nancy Neha Mansi
(c)
Age 21 22 21 20
Product: The product operator builds a relation from two specified relations. It consists of all
possible combinations of tuples, one from each of the two relations. For example: Product P Q R A B C
X Y
P P Q Q R R
A A B B C C
X Y X Y X Y
(d)
from tuples appearing in either or both of the specified relations. For example: Two tables A and B. A consists the roll no. and names of all students whose major discipline is computers science. B contains the roll no. and name of all students whose major discipline is mathematics. These tables are union compatible because they have the same type of attributes. A Table Roll No. Name 0910 Anisha 0846 Nancy B Table Roll No. Name 0846 Nancy 0976 Neha A B Table