0% found this document useful (0 votes)
42 views15 pages

1.8.2 Database

Data modeling is the process of creating a conceptual data model for data stored in a database. It involves defining the external, conceptual, logical, and physical schemas. The external schema describes individual views of the database. The conceptual schema describes how the data is seen by applications using the database. The logical schema defines logical constraints on the data like tables and views. The physical schema defines how the data is physically stored.

Uploaded by

Aqeel Ahmed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views15 pages

1.8.2 Database

Data modeling is the process of creating a conceptual data model for data stored in a database. It involves defining the external, conceptual, logical, and physical schemas. The external schema describes individual views of the database. The conceptual schema describes how the data is seen by applications using the database. The logical schema defines logical constraints on the data like tables and views. The physical schema defines how the data is physically stored.

Uploaded by

Aqeel Ahmed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Compiled by: Aqeel Ahmed Contact No/Whatsapp: 92-21-333-2113627

Skype ID: Aqeel.ahmed162 E-Mail: [email protected]

WHAT IS DATA MODELLING?


Data modelling is the process of creating a data model for the data to be stored in a database. This data
model is conceptual representation of data objects, the associations between different data objects and
the rules.

EXTERNAL SCHEMA
The individual’s view(s) of the database.

CONCEPTUAL DATABASE SCHEMA


Describes the data as seen by the application making use of the DBMS.
Describe the ‘views’ which users of the database might have
We decide, who should have access to the table?

LOGICAL DATABASE SCHEMA


This schema defines all the logical constraints that needs to be applied on the data stored. It defines
tables, views and integrity constraints.
Describe how the relationships will be implemented in the logical structure of the database.

PHYSICAL/INTERNAL DATABASE SCHEMA


This schema pertains to the actual storage of data and its form of storage likes files etc. It defines how
the data will be stored in a secondary storage.

Compiled by: Aqeel Ahmed Contact No/Whatsapp: 92-21-333-2113627


Skype ID: Aqeel.ahmed162 E-Mail: [email protected]
Compiled by: Aqeel Ahmed Contact No/Whatsapp: 92-21-333-2113627
Skype ID: Aqeel.ahmed162 E-Mail: [email protected]

ENTITY
An entity is a person, place, thing, object, event, or even a concept, which can be distinctly identified.
For example, the entities in a university are students, faculty members, and courses.

STANDARD NOTATION
It is a format to show a table's structure, fields, and primary key.

DELNOTE(Num, CastName, City, Country, (ProductID, Description))

To indicate the key, we simply underline the attributes that make up the key.

Because we have identified a key that uniquely identifies each tuple, we have removed the repeating
group.

Compiled by: Aqeel Ahmed Contact No/Whatsapp: 92-21-333-2113627


Skype ID: Aqeel.ahmed162 E-Mail: [email protected]
Compiled by: Aqeel Ahmed Contact No/Whatsapp: 92-21-333-2113627
Skype ID: Aqeel.ahmed162 E-Mail: [email protected]

Compiled by: Aqeel Ahmed Contact No/Whatsapp: 92-21-333-2113627


Skype ID: Aqeel.ahmed162 E-Mail: [email protected]
Compiled by: Aqeel Ahmed Contact No/Whatsapp: 92-21-333-2113627
Skype ID: Aqeel.ahmed162 E-Mail: [email protected]

Advantages of Database Management System


A Database Management System (DBMS) is defined as the software system that allows users to define, create,
maintain and control access to the database. DBMS makes it possible for end users to create, read, update and
delete data in database. It is a layer between programs and data.

Compared to the File Based Data Management System, Database Management System has many advantages.
Some of these advantages are given below −

Reducing Data Redundancy


The file based data management systems contained multiple files that were stored in many different locations in a
system or even across multiple systems. Because of this, there were sometimes multiple copies of the same file
which lead to data redundancy.

This is prevented in a database as there is a single database and any change in it is reflected immediately. Because
of this, there is no chance of encountering duplicate data.

Sharing of Data
In a database, the users of the database can share the data among themselves. There are various levels of
authorisation to access the data, and consequently the data can only be shared based on the correct authorisation
protocols being followed.

Many remote users can also access the database simultaneously and share the data between themselves.

Data Integrity
Data integrity means that the data is accurate and consistent in the database. Data Integrity is very important as there
are multiple databases in a DBMS. All of these databases contain data that is visible to multiple users. So it is
necessary to ensure that the data is correct and consistent in all the databases and for all the users.

Data Security
Data Security is vital concept in a database. Only authorised users should be allowed to access the database and
their identity should be authenticated using a username and password. Unauthorised users should not be allowed to
access the database under any circumstances as it violates the integrity constraints.

Privacy
The privacy rule in a database means only the authorized users can access a database according to its privacy
constraints. There are levels of database access and a user can only view the data he is allowed to. For example - In
social networking sites, access constraints are different for different accounts a user may want to access.

Backup and Recovery


Database Management System automatically takes care of backup and recovery. The users don't need to backup
data periodically because this is taken care of by the DBMS. Moreover, it also restores the database after a crash or
system failure to its previous condition.

Data Consistency
Data consistency is ensured in a database because there is no data redundancy. All data appears consistently
across the database and the data is same for all the users viewing the database. Moreover, any changes made to the
database are immediately reflected to all the users and there is no data inconsistency.

Compiled by: Aqeel Ahmed Contact No/Whatsapp: 92-21-333-2113627


Skype ID: Aqeel.ahmed162 E-Mail: [email protected]
Compiled by: Aqeel Ahmed Contact No/Whatsapp: 92-21-333-2113627
Skype ID: Aqeel.ahmed162 E-Mail: [email protected]

Limitations of Database Management System


Database Management System is quite useful compared to the file based management
system. However, it does have some disadvantages. Some of those are as follows −

More Costly
Creating and managing a database is quite costly. High cost software and hardware is
required for the database. Also highly trained staff is required to handle the database
and it also needs continuous maintenance. All of these ends up making a database
quite a costly venture.

High Complexity
A Database Management System is quite complex as it involves creating, modifying
and editing a database. Consequently, the people who handle a database or work with
it need to be quite skilled or valuable data can be lost.

Database handling staff required


As discussed in the previous point, database and DBMS are quite complex. Hence,
skilled personnel are required to handle the database so that it works in optimum
condition. This is a costly venture as these professionals need to be very well paid.

Database Failure
All the relevant data for any company is stored in a database. So it is imperative that the
database works in optimal condition and there are no failures. A database failure can be
catastrophic and can lead to loss or corruption of very important data.

High Hardware Cost


A database contains vast amount of data. So a large disk storage is required to store all
this data. Sometimes extra storage may even be needed. All this increases hardware
costs by a lot and makes a database quite expensive.

Huge Size
A database contains a large amount of data, especially for bigger organisations. This
data may even increase as more data is updated into the database. All of these leads to
a large size of the database.
The bigger the database is, it is more difficult to handle and maintain. It is also more
complex to ensure data consistency and user authentication across big databases.

Upgradation Costs
Often new functionalities are added to the database.This leads to database
upgradations. All of these upgradations cost a lot of money. Moreover it is also quite
expensive to train the database managers and users to handle these new upgradations.
Compiled by: Aqeel Ahmed Contact No/Whatsapp: 92-21-333-2113627
Skype ID: Aqeel.ahmed162 E-Mail: [email protected]
Compiled by: Aqeel Ahmed Contact No/Whatsapp: 92-21-333-2113627
Skype ID: Aqeel.ahmed162 E-Mail: [email protected]

Cost of Data Conversion


If the database is changed or modified in some manner, all the data needs to be
converted to the new form. This cost may even exceed the database creation and
management costs sometimes. This is the reason most organisations prefer to work on
their old databases rather than upgrade to new ones.

Compiled by: Aqeel Ahmed Contact No/Whatsapp: 92-21-333-2113627


Skype ID: Aqeel.ahmed162 E-Mail: [email protected]
Compiled by: Aqeel Ahmed Contact No/Whatsapp: 92-21-333-2113627
Skype ID: Aqeel.ahmed162 E-Mail: [email protected]

What is Normalization?
Normalization is a database design technique that reduces data redundancy.
Normalization rules divides larger tables into smaller tables and links them using
relationships. The purpose of Normalisation in SQL is to eliminate redundant
(repetitive) data and ensure data is stored logically.

UNF

Num CUstName City Country Product ID Description

005 Bill jones London England 1 Table


005 Bill jones London England 2 Desk
005 Bill jones London England 3 Chair

1NF
Definition of 1NF
• Primary Key
• No repeated groups of attributes
• All attributes should be atomic

Compiled by: Aqeel Ahmed Contact No/Whatsapp: 92-21-333-2113627


Skype ID: Aqeel.ahmed162 E-Mail: [email protected]
Compiled by: Aqeel Ahmed Contact No/Whatsapp: 92-21-333-2113627
Skype ID: Aqeel.ahmed162 E-Mail: [email protected]

Definition of 2NF

2NF
• No partial dependencies
STEP # 1
UNF

Num CUstName City Country Product ID Description

005 Bill jones London England 1 Table


005 Bill jones London England 2 Desk
005 Bill jones London England 3 Chair
STEP # 2

Break above table in two parts:

Notice that you have lost the connection between the above two tables.
STEP # 3
Add a common column to create a relation between them.

Compiled by: Aqeel Ahmed Contact No/Whatsapp: 92-21-333-2113627


Skype ID: Aqeel.ahmed162 E-Mail: [email protected]
Compiled by: Aqeel Ahmed Contact No/Whatsapp: 92-21-333-2113627
Skype ID: Aqeel.ahmed162 E-Mail: [email protected]

INTRODUCING THE LINK TABLE

We now have three TABLES.

DELNOTE(Num, CustName, City, Country)


PRODUCT(ProdID, Description)
DEL_PROD(Num , ProdID)

Compiled by: Aqeel Ahmed Contact No/Whatsapp: 92-21-333-2113627


Skype ID: Aqeel.ahmed162 E-Mail: [email protected]
Compiled by: Aqeel Ahmed Contact No/Whatsapp: 92-21-333-2113627
Skype ID: Aqeel.ahmed162 E-Mail: [email protected]

Definition of 3NF

• 1NF and 2NF must have been done


• No non-key dependencies
• No transitive dependencies (Note – If A->B and B->C then A->C is called transitive dependency.)

Compiled by: Aqeel Ahmed Contact No/Whatsapp: 92-21-333-2113627


Skype ID: Aqeel.ahmed162 E-Mail: [email protected]
Compiled by: Aqeel Ahmed Contact No/Whatsapp: 92-21-333-2113627
Skype ID: Aqeel.ahmed162 E-Mail: [email protected]

Entity-Relationship (E-R) Diagrams

Entity-Relationship (E-R) diagrams can be used to illustrate the relationships between entities.

Compiled by: Aqeel Ahmed Contact No/Whatsapp: 92-21-333-2113627


Skype ID: Aqeel.ahmed162 E-Mail: [email protected]
Compiled by: Aqeel Ahmed Contact No/Whatsapp: 92-21-333-2113627
Skype ID: Aqeel.ahmed162 E-Mail: [email protected]

Compiled by: Aqeel Ahmed Contact No/Whatsapp: 92-21-333-2113627


Skype ID: Aqeel.ahmed162 E-Mail: [email protected]
Compiled by: Aqeel Ahmed Contact No/Whatsapp: 92-21-333-2113627
Skype ID: Aqeel.ahmed162 E-Mail: [email protected]

SECONDARY KEY

GRADE STUDENTS NAME


A ABBAS MUSTAFA
A ABDUL ALI
A MUHAMMAD AHMED SHAH
A MUHAMMAD JAHANZAIB KHAN
A MUHAMMAD ZUBAIR KHAN
A MURTAZA ABBAS
A NOOR ELAHI
A SAAD AHMED KHANZADA
A SAMEER SHAHAB
A SAMEER UMAR
A SHAHZAIB AMIR
A SUBATA SALMAN
A SYED ALI RAZA
A SYED BAQAR ALI ZAIDI
A SYED MOHAMMAD TALHA
A SYED RAFAY HUSSAIN
A TAHA ZAFAR
A TAQI MIRZA
A UMAR SOHAIL
A USAMA WAQAR
A USMAN KHALID
A WALEED HASSAN
A WASIF RAZA
Compiled by: Aqeel Ahmed Contact No/Whatsapp: 92-21-333-2113627
Skype ID: Aqeel.ahmed162 E-Mail: [email protected]
Compiled by: Aqeel Ahmed Contact No/Whatsapp: 92-21-333-2113627
Skype ID: Aqeel.ahmed162 E-Mail: [email protected]

A YAHYA MOHIUDDIN
A YUSRA MAHMOOD
B AHMED FARAZ
B ARHAM ALI
B EMAAN QAZI
B HAMZA IMAM
B HASHIR REHMAN
B HUZAIFA FARRUKH
B IZAAN ALI ABBASI
B IZAAN SHEIKH
B M TALIB FAROOQ
B M.IBAD KHAN
B MAAZ AHMED
B MAHNOOR REHMAN
B MOHAMMAD KUMAIL KAZMI
B MOHAMMAD SAAD KHAN
B MOHEEZ
B MUHAMMAD ADAM
C AHSAN SHAH
C ALI SUFYAN KHAN
C AMNA ZAFAR
C MUHAMMAD SAAD SOHAIL
C MUHAMMAD WAJIHUDDIN
C SHEHRYAR BAIG
C SHEHRYAR KHAN
C SYED HAMBAL IMAM
C ZAHENASEEB
D ABDULLAH FAREED
D MUHAMMAD HARIS KHAN
D MUHAMMAD JAHANZAIB KHAN
D MUHAMMAD SAMEER

Compiled by: Aqeel Ahmed Contact No/Whatsapp: 92-21-333-2113627


Skype ID: Aqeel.ahmed162 E-Mail: [email protected]
Compiled by: Aqeel Ahmed Contact No/Whatsapp: 92-21-333-2113627
Skype ID: Aqeel.ahmed162 E-Mail: [email protected]

D MUHAMMAD UMER ASIF


D SUDAIS BAIG
U AREEB LODHI
U DANIYAAL AHMED
U GHULAM DASTAGIR
U MOHMMAD HASSAN TARIQ
U MUHAMMAD ALI SIDDIQUI
U SYED RAFE NAQVI

Compiled by: Aqeel Ahmed Contact No/Whatsapp: 92-21-333-2113627


Skype ID: Aqeel.ahmed162 E-Mail: [email protected]

You might also like