You are on page 1of 35

Group Three

Question

The Three-level ANSI-SPARC architecture


Database Models
The Entity-Relationship Model
Components os a DMMS
Part A : Three-level ANSI SPARC Database
Architecture
The Architecture of most of commercial dbms are available today is mostly based on this
ANSI-SPARC database architecture .
ANSI SPARC THREE-TIER architecture has main three levels:

a) Internal Level
b) Conceptual Level
c) External Level
 These three levels provide data abstraction ;means hide the low level complexities from
end users .
 A database system should be efficient in performance and convenient in use.
 Using these three levels,it is possible to use complex structures at internal level for efficient
operations and to provide simpler convenient interface at external level.
Three-level ANSI SPARC Database Architecture
Diagram
2. Internal level:
 This is the lowest level of data abstraction.

 It describes How the data are actually stored on storage devices.

 It is also known as physical level.

 It provides internal view of physical storage of data.

 It deals with complex low level data structures,file structures and access methods in detail.

 It also deals with Data Compression and Encryption techniques,if used.

2. Conceptual level:
 This is the next higher level

 l than internal level of data abstraction.

 It describes What data are stored in the database and What relationships exist among those data.

 It is also known as Logical level.

 It hides low level complexities of physical storage.

 Database administrator and designers work at this level to determine What data to keep in database.

 Application developers also work on this level.


3. External Level:
 This is the highest level of data abstraction.

 It describes only part of the entire database that a end user concern.

 It is also known as an view level.

 End users need to access only part of the database rather than entire database.

 Different user need different views of database.And so,there can be many view level abstractions of the same
database.

Advantages of Three-tier Architecture:

 The main objective of it is to provide data abstraction.

 Same data can be accessed by different users with different customized views.

 The user is not concerned about the physical data storage details.

 Physical storage structure can be changed without requiring changes in internal structure of the database as
well as users view.

 Conceptual structure of the database can be changed without affecting end users.
Part B : DATABASE MODELS
A Database model defines the logical design and structure of a database and defines how data will be stored,
accessed and updated in a database management system.

TYPES OF DATABASE MODELS:-


 Hierarchical Model
 Network Model
 Entity-relationship Model
 Relational Model
HIERARCHICAL MODEL
 This database model organizes data into a treelike-structure, with a single root, to which all the
other data is linked. The hierarchy starts from the Root data, and expands like a tree, adding child
nodes to the parent nodes.
 In hierarchical model, data is organized into tree-like structure with one one-to-many relationship
between two different types of data, for example, one department can have many courses,
many professors and of-course many students.
NETWORK MODEL
 This is an extension of the Hierarchical model. In this model data is organized more like a graph,
and are allowed to have more than one parent node.
 In this database model data is more related as more relationships are established in this
database model. Also, as the data is more related, hence accessing the data is also easier and
fast. This database model was used to map many-to-many data relationships.
ENTITY-RELATIONSHIP MODEL
 In this database model, relationships are created by dividing object of interest into entity and its
characteristics into attributes.
 E-R Models are defined to represent the relationships into pictorial form to make it easier for
different stakeholders to understand.
 This model is good to design a database, which can then be turned into tables in relational
model.
RELATIONAL MODEL
 In this model, data is organized in two dimensional tables and the relationship is maintained by
storing a common field.
 This model was introduced by E.F Codd in 1970, and since then it has been the most widely used
database model, infact, we can say the only database model used around the world.
 The basic structure of data in the relational model is tables. All the information related to a
particular type is stored in rows of that table.
 Hence, tables are also known as relations in relational model.
Part C : Entity-Relationship Model
ER model
 ER model stands for an Entity-Relationship model. It is a high-level data model. This
model is used to define the data elements and relationship for a specified system.
 It develops a conceptual design for the database. It also develops a very simple
and easy to design view of data.
 In ER modeling, the database structure is portrayed as a diagram called an entity-
relationship diagram.
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.
Components of ER Diagram
1.Entity:
 An entity may be any object, class, person or place. In the ER diagram, an entity can be represented as rectangles.

 Consider an organization as an example- manager, product, employee, department etc. can be taken as an entity.

2. Attribute
 The attribute is used to describe the property of an entity. Eclipse is used to represent an attribute.

 For example, id, age, contact number, name, etc. can be attributes of a student.
a. Key Attribute
 The key attribute is used to represent the main characteristics of an entity. It represents a primary key. The key attribute is
represented by an ellipse with the text underlined. Eg ID

b. Composite Attribute
 An attribute that composed of many other attributes is known as a composite attribute. The composite attribute is
represented by an ellipse, and those ellipses are connected with an ellipse.

c. Multivalued Attribute
 An attribute can have more than one value. These attributes are known as a multivalued attribute. The double oval is used to
represent multivalued attribute. For example, a student can have more than one phone number.

d. Derived Attribute
 An attribute that can be derived from other attribute is known as a derived attribute. It can be represented by a dashed
ellipse.

 For example, A person's age changes over time and can be derived from another attribute like Date of birth.
3. Relationship
 A relationship is used to describe the relation between entities. Diamond or
rhombus is used to represent the relationship.

a. One-to-One Relationship
When only one instance of an entity is associated with the relationship, then it is
known as one to one relationship.
For example, A female can marry to one male, and a male can marry to one
female.
b. One-to-many relationship
When only one instance of the entity on the left, and more than one instance of an entity on the right associates with the
relationship then this is known as a one-to-many relationship.

For example, Scientist can invent many inventions, but the invention is done by the only specific scientist.

c. Many-to-one relationship
When more than one instance of the entity on the left, and only one instance of
an entity on the right associates with the relationship then it is known as a many-
to-one relationship.
For example, Student enrolls for only one course, but a course can have many
students.
 d. Many-to-many relationship
 When more than one instance of the entity on the left, and more than one instance
of an entity on the right associates with the relationship then it is known as a many-
to-many relationship.
 For example, Employee can assign by many projects and project can have many
employees.
Mapping Constraints
 A mapping constraint is a data constraint that expresses the number of entities
to which another entity can be related via a relationship set.
 It is most useful in describing the relationship sets that involve more than two
entity sets.
 For binary relationship set R on an entity set A and B, there are four possible
mapping cardinalities. These are as follows:
 One to one (1:1)
 One to many (1:M)
 Many to one (M:1)
 Many to many (M:M)
One-to-one
 In one-to-one mapping, an entity in E1 is associated with at most one entity
in E2, and an entity in E2 is associated with at most one entity in E1.

One-to-many
 In one-to-many mapping, an entity in E1 is associated with any number of
entities in E2, and an entity in E2 is associated with at most one entity in E1.
Many-to-one
 In one-to-many mapping, an entity in E1 is associated with at most one entity in E2,
and an entity in E2 is associated with any number of entities in E1.

Many-to-many
 In many-to-many mapping, an entity in E1 is associated with any number of entities
in E2, and an entity in E2 is associated with any number of entities in E1.
KEYS
 Keys play an important role in the relational database.
 It is used to uniquely identify any record or row of data from the table. It is
also used to establish and identify relationships between tables.
1. Primary key
 It is the first key which is used to identify one and only one instance of an entity
uniquely.
 In the EMPLOYEE table, ID can be primary key since it is unique for each employee.
In the EMPLOYEE table, we can even select License_Number and
Passport_Number as primary key since they are also unique.
2. Candidate key
 A candidate key is an attribute or set of an attribute which can uniquely identify a
tuple.
3. Super Key
 Super key is a set of an attribute which can uniquely identify a tuple. Super key is a
superset of a candidate key.
 For example: In the above EMPLOYEE table, for(EMPLOEE_ID, EMPLOYEE_NAME) the
name of two employees can be the same, but their EMPLYEE_ID can't be the same.
Hence, this combination can also be a key.
 The super key would be EMPLOYEE-ID, (EMPLOYEE_ID, EMPLOYEE-NAME), etc.
4. Foreign key

Foreign keys are the column of the table which is used to point to the primary key of another table.

In a company, every employee works in a specific department, and employee and department are
two different entities. So we can't store the information of the department in the employee table.
That's why we link these two tables through the primary key of one table.
The ER diagram
Part D Components of DBMS
WHAT IS DBMS??!!
A database-management system (DBMS) is a computer-software application
that interacts with end-users, other applications, and the database itself to
capture and analyse data. A general-purpose DBMS allows the definition,
creation, querying, update, and administration of databases. Well-known DBMSs
include MySQL, PostgreSQL, MongoDB, MariaDB, Microsoft SQL Server, Oracle,
Sybase, SAP HANA, MemSQL, SQLite and IBM DB2.
BASIC COMPONENTS OF DBMS
A database management system (DBMS) consists of several components. Each component
plays very important role in the database management system environment. The major
components of database management system are:
• Software
• Hardware
• Data
• Procedures
• Users (or people)
1. SOFTWARE
• The main component of a DBMS is the software. It is the set of programs used to handle the database and to control
and manage the overall computerized database
• DBMS software itself, is the most important software component in the overall system
• Operating system including network software being used in network, to share the data of database among multiple
users.
• Application programs developed in programming languages such as C++, Visual Basic that are used to access
database in database management system. Each program contains statements that request the DBMS to perform
operation on database. The operations may include retrieving, updating, deleting data etc . The application program
may be conventional or online workstations or terminals.
2. HARDWARE
Hardware consists of a set of physical electronic devices such as computers
(together with associated I/O devices like disk drives), storage devices, I/O
channels, electromechanical devices that make interface between computers
and the real world systems etc, and so on. It is impossible to implement the DBMS
without the hardware devices, In a network, a powerful computer with high data
processing speed and a storage device with large storage capacity is required as
database server.
3.DATA
Data is the most important component of the DBMS.
The main purpose of DBMS is to process the data. In DBMS, databases are defined,
constructed and then data is stored, updated and retrieved to and from the
databases. The database contains both the actual (or operational) data and the
metadata (data about data or description about data).
4. PROCEDURES
• Procedures refer to the instructions and rules that help to design the database and to use the DBMS. The users that
operate and manage the DBMS require documented procedures on hot use or run the database management system.
These may include.
• Procedure to install the new DBMS.
• To log on to the DBMS.
• To use the DBMS or application program.
• To make backup copies of database.
• To change the structure of database.
• To generate the reports of data retrieved
from database.
5. USERS (OR PEOPLE)
 The users are the people who manage the databases and perform different operations on the databases in the
database system. There are three kinds of people who play different roles in database systems:-
1. Application Programmer
2. Database Administrators
3. End-Users
Application Programmers

The people who write application programs in programming languages (such as Visual Basic, Java, or C++) to
interact with databases are called Application Programmer.
Database Administrators
A person who is responsible for managing the overall database management system is called database
administrator or simply DBA.
End-Users
The end-users are the people who interact with database management system to perform different
operations on database such as retrieving, updating, inserting, deleting data etc.i
End Users:
1. Naïve Users: These are the users who are constantly querying and updating the database. E.g. Bank
clerk, Railway clerk.
2. Casual Users: These are the people who use the database occasionally. E.g. ATM users.
3. Sophisticated Users: People who use for their complex requirements. E.g. Business and Financial
analyst.
4. Standalone Users: These are the users who maintain and use the database for their personal queries.ions on database such as
retrieving, updating, inserting, deleting data etc.
 Thank you

You might also like