0% found this document useful (0 votes)
5 views

Lecture 1 Database

Uploaded by

lemanovil36
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Lecture 1 Database

Uploaded by

lemanovil36
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

DATABASE

Data and Information


• Data are raw facts that constitute building block of information. Data are
the heart of the DBMS. It is to be noted that all the data will not convey useful
information. Useful information is obtained from processed data.
Database
• A database can be summarily described as a repository for data. This makes
clear that building databases is really a continuation of a human activity that
has existed since writing began;
Database definition
• There a many professional definition about database. A database is a
collection of data that is organized so that its contents can easily be accessed,
managed, and updated. A database is just what the name implies, a base
collection of data. The data is organized in some manner so that the
information contained within the database can be easily retrieved.
Cont..
• The database should contain all the data needed by the organization as a
result, a huge volume of data, the need for long-term storage of the data,
and access of the data by a large number of users generally characterize
database systems
Objectives of DBMS
• The main objectives of database management system are data availability,
data integrity, data security, and data independence.
Objectives of DBMS
• Data Availability
Data availability refers to the fact that the data are made available to wide
variety of users in a meaningful format at reasonable cost so that the users can
easily access the data.
• Data Integrity
Data integrity refers to the correctness of the data in the database. In other
words, the data available in the database is a reliable data.
Cont…
• Data Security
Data security refers to the fact that only authorized users can access the data.
Data security can be enforced by passwords. If two separate users are accessing
a particular data at the same time, the DBMS must not allow them to make
conflicting changes
• Data Independence
DBMS allows the user to store, update, and retrieve data in an efficient manner.
Cont…
• In order to store the information efficiently, complex data structures are used
to represent the data. The system hides certain details of how the data are
stored and maintained.
Components of Database Management System

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
• Database Access Language
• Users
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 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.
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.
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).
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.
database access language
• The database access language is used to access the data to and from the database. The users
use the database access language to enter new data, change the existing data in database and
to retrieve required data from databases. The user write a set of appropriate commands in a
database access language and submits these to the DBMS. The DBMS translates the user
commands and sends it to a specific part of the DBMS called the Database Jet Engine. The
database engine generates a set of results according to the commands submitted by user,
converts these into a user readable form called an Inquiry Report and then displays them on
the screen. The administrators may also use the database access language to create and
maintain the databases.
• The most popular database access language is SQL (Structured Query Language). Relational
databases are required to have a database query language.
Users.
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 system.
• Application Programmers
• Database Administrators
• End-Users
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.
Advantages of Database Management Systems

The database management system has promising potential advantages:-


• Integrity can be enforced
Integrity of data means that data in database is always accurate, such that
incorrect information cannot be stored in database.
• Controlling Redundancy
In file system, each application has its own private files, which cannot be shared
between multiple applications.
Cont..
• Inconsistency can be avoided
When the same data is duplicated and changes are made at one site, which is
not propagated to the other site, it gives rise to inconsistency and the two
entries regarding the same data will not agree.
• Data can be shared:
A certain data from a certain office can be shared by multiple applications in
centralized DBMS.
Cont…
• Restricting unauthorized access
When multiple users share a database, it is likely that some users will not be
authorized to access all information or to do some activities in the database.
Types of DBMS.

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.

What is it? ER diagram symbols.


• The ER diagram is used to represent
database schema. In ER diagram:
– A rectangle represents an entity set.
– An ellipse represents an attribute.
– A diamond represents a relationship.
– Lines represent linking of attributes to entity
sets and of entity sets to relationship sets.
Example of ER diagram.

Student and class relationship ER Diagram


• In the ER diagram the two entities are
STUDENT and CLASS. Two
• simple attributes which are associated with
the STUDENT are Roll number
• and the name. The attributes associated
with the entity CLASS are Subject
• Name and Hall Number. The relationship
between the two entities STUDENT
• and CLASS is Attends.

You might also like