Lecture 1 Database
Lecture 1 Database
Database Management is a software system that uses a standard method and running
queries with some of them designed for the oversight and proper control of databases.
There are four structural types of database management systems:
• Hierarchical databases.
• Network databases.
• Relational databases.
• Object-oriented databases
The chronological order of the development
of DBMS
• The chronological order of the development of DBMS is as follows:
• – Flat files – 1960s–1980s
• – Hierarchical – 1970s–1990s
• – Network – 1970s–1990s
• – Relational – 1980s–present
• – Object-oriented – 1990s–present
• – Object-relational – 1990s–present
• – Data warehousing – 1980s–present
• – Web-enabled – 1990s–present
Relational database
• In relational databases, the relationship between data files is relational.
Hierarchical and network databases require the user to pass a hierarchy in
order to access needed data. These databases connect to the data in different
files by using common data numbers or a key field. Data in relational
databases is stored in different access control tables, each having a key field
that mainly identifies each row.
• the relational databases are more reliable than either the hierarchical or
network database structures.
MySQL
• MySQL is the most widely used relational database management
system (RDBMS)and most widely used open-source
RDBMS. The SQL acronym stands for Structured Query Language.
Data Model
• It is a collection of concepts that can be used to describe the structure of a database.
• The data model provides necessary means to achieve the abstraction i.e., hiding the details
of data storage.
• categories of Data Model.
-High Level or Conceptual Data Model (Example: ER model)
– Low Level or Physical Data Model
– Representational or Implementational Data Model
– Relational Data Model
– Network and Hierarchal Data Model
– Record-based Data Model
– Object-based Data Model
Database schema
• Database schema is nothing but description of the database. The types of
schemas that exist in a database complying with three levels of
ANSI/SPARC architecture are:
- External schema
- Conceptual schema
- Internal schema
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.
Conceptual schema.
• The conceptual level is at a higher level than the physical level. It is also
known as the logical level. It describes how the database appears to the users
conceptually and the relationships between various data tables. The
conceptual level does not care for how the data in the database is actually
stored.
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.
Entity–Relationship
Model
The Building Blocks of an Entity–Relationship
Diagram.
• ER diagram is a graphical modeling tool to standardize ER modeling. The
modeling can be carried out with the help of pictorial representation of
entities, attributes, and relationships. The basic building blocks of Entity-
Relationship diagram are Entity, Attribute and Relationship.
Entity
• An entity is an object that exists and is distinguishable from other objects. In
other words, the entity can be uniquely identified.
• The examples of entities are:
– A particular person, for example Agness Mrefu is an entity.
– A particular department, for example Accounts Department.
– A particular place, for example Nanyumbu District.
Entity type(set).
• An entity type or entity set is a collection of similar entities. Some examples of
entity types are:
– All students in FST, say STUDENT.
– All courses in FST, say COURSE.
– All departments in DIT, say DEPARTMENT.
• An entity may belong to more than one entity type. For example, a staff working in
a particular department can pursue higher education as part-time. Hence the same
person is a LECTURER at one instance and STUDENT at
another instance.
Relationship
• A relationship is an association of entities where the association includes one
entity from each participating entity type whereas relationship type is a
meaningful association between entity types.
• The examples of relationship types are:
– Teaching is the relationship type between LECTURER and STUDENT.
– Buying is the relationship between VENDOR and CUSTOMER.
– Treatment is the relationship between DOCTOR and PATIENT.
Attributes
• Attributes are properties of entity types. In other words, entities are
described in a database by a set of attributes.
• The following are example of attributes:
– Brand, cost, and weight are the attributes of CELLPHONE.
– Roll number, name, and grade are the attributes of STUDENT.
– Door, window, rooms and toilet are the attributes of HOUSE.
ER diagram.