UNIT-1 DBMS AKTU Class Nots PDF
UNIT-1 DBMS AKTU Class Nots PDF
UNIT-1 DBMS AKTU Class Nots PDF
Application of DBMS
Enterprise Information: Sales, accounting, human resources, Manufacturing, online retailers.
Banking and Finance Sector: Banks maintaining the customer details, accounts, loans, banking
transactions, credit card transactions. Finance: Storing the information about sales and holdings,
purchasing of financial stocks and bonds.
University: Maintaining the information about student course enrolled information, student grades,
staff roles.
Airlines: Reservations and schedules.
Telecommunications: Prepaid, postpaid bills maintance.
Disadvantages of DBMS
Increased Cost:
These are different types of costs:
1. Cost of Hardware and Software –
This is because, for DBMS, it is mandatory to have a high-speed processor and also a large
memory size.
2. Cost of Staff Training –
Educated staff (database administrator, application programmers, data entry operations) who
maintains the database management system also requires a good amount
3. Cost of Data Conversion-
This is because for this conversion we need to hire database system designers whom we have to
pay a lot of money and also services of some software house will be required.
4. Complexity:
5. Performance:
o The DBMS design depends upon its architecture. The basic client/server
architecture is used to deal with a large number of PCs, web servers, database
servers and other components that are connected with networks.
o The client/server architecture consists of many PCs and a workstation which are
connected via the network.
o DBMS architecture depends upon how users are connected to the database to
get their request done.
1-Tier Architecture
o In this architecture, the database is directly available to the user. It means the user can
directly sit on the DBMS and uses it.
o Any changes done here will directly be done on the database itself. It doesn't provide a
handy tool for end users.
o The 1-Tier architecture is used for development of the local application, where
programmers can directly communicate with the database for the quick response.
2-Tier Architecture
3-Tier Architecture
o The 3-Tier architecture contains another layer between the client and server. In this
architecture, client can't directly communicate with the server.
o The application on the client-end interacts with an application server which further
communicates with the database system.
o End user has no idea about the existence of the database beyond the application server.
The database also has no idea about any other user beyond the application.
o The 3-Tier architecture is used in case of large web application.
Data Models
Data Model is the modeling of the data description, data semantics, and consistency constraints
of the data. It provides the conceptual tools for describing the design of a database at each level
of data Therefore, there are following four data models used for understanding the structure of
the database:
1) Relational Data Model: This type of model designs the data in the form of rows and
columns within a table. Thus, a relational model uses tables for representing data and
in-between relationships. Tables are also called relations. This model was initially
described by Edgar F. Codd, in 1969. The relational data model is the widely used model
which is primarily used by commercial data processing applications.
4) Semistructured Data Model: This type of data model is different from the other three
data models (explained above). The semistructured data model allows the data
specifications at places where the individual data items of the same type may have
different attributes sets. The Extensible Markup Language, also known as XML, is widely
used for representing the semistructured data. Although XML was initially designed for
including the markup information to the text document, it gains importance because of
its application in the exchange of data.
Data Independence
o A DBMS has appropriate languages and interfaces to express database queries and
updates.
o Database languages can be used to read, store and update the data in the database.
DML stands for Data Manipulation Language. It is used for accessing and
manipulating data in a database. It handles user requests.
(But in Oracle database, the execution of data control language does not have
the feature of rolling back.)
There are the following operations which have the authorization of Revoke:
For example, suppose we design a school database. In this database, the student will be an entity with attributes like address, name,
id, age, etc. The address can be another entity with attributes like city, street name, pin code, etc and there will be a relationship
between them.
Component of ER Diagram
Symbols Used in ER Model
ER Model is used to model the logical view of the system from a data perspective which consists of
these symbols:
Rectangles: Rectangles represent Entities in the ER Model.
Ellipses: Ellipses represent Attributes in the ER Model.
Diamond: Diamonds represent Relationships among Entities.
Lines: Lines represent attributes to entities and entity sets with other relationship types.
Double Ellipse: Double Ellipses represent Multi-Valued Attributes.
Double Rectangle: Double Rectangle represents a Weak Entity.
Notation of ER diagram
Database can be represented using the notations. In ER diagram, many notations are used to express the
cardinality. These notations are as follows:
Key:-
Types of keys:
1. Super Key
A Super key is a combination of all possible attributes that can uniquely identify the
row(or tuple) in the given relation
2. Super key is a superset of candidate key.
3. A table can have much supper key.
4. A super key may have additional attribute that are not needed for unique identity and
have null value.
…etc
2. Candidate Key :-
A Candidate key is an attribute or set of an attribute which can uniquely identify a
tuple(row).
It is also called the minimal super Key because we select of candidate key form set of
super key such that select candidate key is the minimum attribute required to uniquely
identify a tuple.
4. Alternate Key: - Out of all Candidate keys, Only one gets selected as primary key,
remaining Keys are known as alternative Keys.
In the above Table, Emp _id is the best suitable for primary key so rest of candidate key
(Email_id , Addhar_no) are considered as candidate key
5. Foreign Key :-
A key used to link two tables together.
An attribute or set of attributes in one table that refer to the primary key in another
table.
Foreign key is ensure (or maintain) referential integrity of the data.
Example1:- Faculty and Student entities can be generalized and create a higher level entity Person.
Example-2
Specialization:-
Example2 :-
Note:- Inheritance is an important feature of generalization and specialization in
below diagram are showing the both activity (bottom –up approach and top-down
approach)
Example 2:-
Aggregation:- Aggregation is used when need to express a relationship among
relationship .
The database can be represented using the notations, and these notations can be
reduced to a collection of tables.
In the database, every entity set or relationship set can be represented in tabular
form.
There are some points for converting the ER diagram to the table:
In the given ER diagram, LECTURE, STUDENT, SUBJECT and COURSE forms individual tables.
In the STUDENT entity, STUDENT_NAME and STUDENT_ID form the column of STUDENT table.
Similarly, COURSE_NAME and COURSE_ID form the column of COURSE table and so on.
In the student table, a hobby is a multivalued attribute. So it is not possible to represent multiple
values in a single column of STUDENT table. Hence we create a table STUD_HOBBY with column
name STUDENT_ID and HOBBY. Using both the column, we create a composite key.
In the given ER diagram, student address is a composite attribute. It contains CITY, PIN, DOOR#,
STREET, and STATE. In the STUDENT table, these attributes can merge as an individual column.
In the STUDENT table, Age is the derived attribute. It can be calculated at any point of time by
calculating the difference between current date and Date of Birth.
Using these rules, you can convert the ER diagram to tables and columns and assign the mapping
between the tables. Table structure for the given ER diagram is as below:
Relationship of higher degree
The degree of relationship can be defined as the number of occurrences in one entity that is associated with the
number of occurrences in another entity.
1. One-to-one (1:1)
2. One-to-many (1:M)
3. Many-to-many (M:N)
1. One-to-one
o In a one-to-one relationship, one occurrence of an entity relates to only one occurrence in another entity.
o A one-to-one relationship rarely exists in practice.
o For example: if an employee is allocated a company car then that car can only be driven by that employee.
o Therefore, employee and company car have a one-to-one relationship.
2. One-to-many
o In a one-to-many relationship, one occurrence in an entity relates to many occurrences in another entity.
o For example: An employee works in one department, but a department has many employees.
o Therefore, department and employee have a one-to-many relationship.
3. Many-to-many
o In a many-to-many relationship, many occurrences in an entity relate to many occurrences in another entity.
o Same as a one-to-one relationship, the many-to-many relationship rarely exists in practice.
o For example: At the same time, an employee can work on several projects, and a project has a team of many
employees.
o Therefore, employee and project have a many-to-many relationship.