Introduction To Database
Introduction To Database
Introduction to Database
Course Contents
What is Data? ................................................................................................................................................ 2
Types of Data ................................................................................................................................................ 2
Information ................................................................................................................................................... 2
What is Table?............................................................................................................................................... 2
What is Relationship? ................................................................................................................................... 2
What is Database? ........................................................................................................................................ 4
Types of Database ......................................................................................................................................... 5
What is DBMS ............................................................................................................................................... 6
Role/Functions of (DBMS)............................................................................................................................. 6
Database Model ............................................................................................................................................ 8
Common terminologies of Database .......................................................................................................... 11
Data base anomalies ................................................................................................................................... 13
Normalization.............................................................................................................................................. 13
What is Data?
Data is the plural form of the Latin word Datum.
The collection of fact and figure is called data or anything in Raw form is called
data. Data cannot be used for decision making or Action taking in other Words
Data is the collection facts and figures about any entity or object.
e.g. Name, Address, Phone Number, Roll No etc.
Types of Data
There are different types of data.
1. Alphabetic data. It consists of Letter from A-Z capital letter of small letter.
E.g. hamid , peshawer, lahore, chair, etc.
2. Numeric data. It consists of digit form 0-9 e.g. 123 567 etc.
3. Alphanumeric data. It consists of alphabetic data as well as Numeric
data. e.g. A10 , B23 etc.
4. Graphic data. It consists of table, chart, graphic and Statements.
5. Audio data. It consists of only sound e.g. Radio news, audio songs, etc.
6. Video data. It consist of photos, image and moving picture , animations
etc.
7. Mixed data. It consists more than one type of data such as the
combination of audio and video,
e.g. movies . Tv shows etc.
Information
To organize the data in meaningful form upon which people can take necessary
decision is called information.
Examples are voucher, bills fee registration card or library cards. CNIC card etc.
What is Table?
Table is the collection of data, Table organize the data into rows and columns.
What is Relationship?
Relationship is an association or link between common fields of two or more
tables.
Types of relationship
One to One
One to Many
Many to Many
One to One relationship : one to one relationship exist when the each single
record of table no 1 is associated with each single record of table no 2 and the
single record of table 2 is related with single record of table no 1.
Students Table .
What is Database?
A database is an integrated collection of data that is shared by all the
organizational users. It is large collection of data in computer system organized so
that it can be expanded, updated and retrieved rapidly for various users.
Management complexity
Maintaining cost
Designing & creating database is complex and time taking
Types of Database
Database has following types
1) Operational Database
2) Analytical Database
3) Data warehouse
4) Distributed Database
5) External Database
6) Text Database
7) Images & multimedia Database
Operational Database: - These database stored detailed information needed to
support the operation of entire organization. This database called SADB (subject
Area Database) for example production Database, Inventory Database etc.
Analytical Database: These database store data and information extracted from
operational database. These databases consist of summarized data most needed
by organization users and management. These are also called management data
base or information database. Example decision support system and executive
information system.
Data Warehouse: a data warehouse store data from previous or current and
previous year data extracted from the various operational databases of an
organization. It can be used by manager and other end users professional
throughout an organization.
Images and multimedia Database: These database store data in a text, images ,
sound videos.
What is DBMS
A database management system (DBMS) is system software for creating and
managing databases. A DBMS makes it possible for end users to create, read,
update and delete data in a database. Oracle Is the most prevalent type of data
management platform, the DBMS essentially serves as an interface between
databases and end users or application programs, ensuring that data is
consistently organized and remains easily accessible.
Role/Functions of (DBMS)
DBMS performs several important functions which are.
Data Dictionary Management,
Data Storage Management,
Data Transformation and Presentation,
Security Management,
Multi user Access Control,
Backup and Recovery Management,
Integrity Management
data component structures and relationships which relieves you from coding such
complex relationships in each program.
Data Storage Management
The DBMS creates and manages the complex structures required for data storage,
A modern DBMS system provides storage not only for the data, but also for
related data entry forms or screen definitions, report definitions, data validation
rules, procedural code, structures to handle video and picture formats, and so on.
Security Management
Security Management is another important function of DBMS. The DBMS creates
a security system that enforces user security and data privacy. Security rules
determine which users can access the database, which data items each user can
access, and which data operations (read, add, delete, or modify) the user can
perform. This is especially important in multiuser database systems.
Database Model
What is model? Model is a representation of real world object, event and their
association.
A database model is an abstract representation of the data ,about entities ,
events, activities and their association. A database model represent or describe
organization itself.
There are two purposes of database model. First to represent data and the
second to be understandable. Database model tell us how data is stored in
database of an organization. How entities and attribute are associated with each
other.
There are three types of database models which are commonly used
Hierarchical Data Model
Network Data Model
Relational Data model
Hierarchical Database
It is popular database models. Here records are stored in the form of tree. Record
at the top position is called parent record and bottom record is called child
record. Record at the top most position is called root record. In hierarchical
database model parent record can have more than one child but child can have
only one parent record. It represents one to many relationship.
Pakistan
Gilgit
KP Punjab Balochistan sind
Baltistan
Network Database Model: The records are organized in the form of graph in a
Network data model. Here each parent node can have more than one child and a
children can have more parents. The records are link together by mean of pointer.
In network terminology, the child record is called member while parent record is
called owner. It is more flexible than hierarchical in the sense that different
relationships may be established between different branches. It support many to
many relationship.
Courses
English Math Phy Bio chemistry
Teachers
Aslam Amir Noman Qamar Javed
Students
Ali Baber Zaheer Faisal Usama
Relational Database model: it is more flexible than other two. It connects the
different files through the use of key field. Data elements are stored in different
tables made of rows and columns. Its advantage is that the user needs not to be
aware of any structure. Thus it can be used with a little training. Records can be
easily inserted, deleted and modified.
Students
Rollno Name Address Course Contact
Fee
Identifier
That attributes which identifies one entity from other in the same entity class. For
example Roll No is an identifier for a student.
Attribute
The characteristic of an entity is called attribute
Meta Data
Data about data or information about data is called meta data.
Data item
For each attribute of an entity there is a data item. A data item is smallest unit of
data in database.
Field
The group of related data item is called field.
Record
The collection of fields is called record
File
The Collection of related records is called file.
What is Key and Types of Key?
What is Key?
Key is a data item that identify the record. For example RollNo, Name etc
There are three Types of Key
1) Primary Key
2) Secondary Key
3) Foreign Key
Primary Key: Primary key is a data item that uniquely identifies the record. For
example Rollno would be the primary key in student database.
Secondary Key: Secondary key does not uniquely identify the record, but
identify the number of record on specific condition. For example Course would
be the secondary key in student data base.
Foreign Key: it is primary key field in one table and used as a foreign key in
another table. It is used to link two or more tables.
Normalization
Normalization is a database design technique which organizes tables in a manner
that reduces redundancy and dependency of data.
It divides larger tables to smaller tables and link them using relationships.
Steps in Normalization
1st Normal Form
If Duplicate Columns exists then remove duplicate Columns
2nd Normal Form
If Non Key Columns depends other Then Remove the column
3rd Normal Form
If mutual depended Fields found then remove them
What is ERD?
Entity Relationship Diagram, also known as ERD, ER Diagram or ER model, is a
type of structural diagram for use in database design. An ERD contains different
symbols and connectors that visualize two important information:
The major entities within the system scope, and the Inter-relationships among
these entities.