An Introduction To Mysql: Faculty Name
An Introduction To Mysql: Faculty Name
Course Name:
MySQL
Faculty Name:
Database
Administration
Ms. Zaiba Khan
with MySQL
Assistant Professor(CSE)
Branch-
School of
B.Tech-VI Semester Engineering &
Course Code: Technology
19009300 1
What is Data?
Getting Started
Onceyou have finished installing above you need to set
up MySQL Workbench as shown below -
◦ 1. First step is launching the Workbench MySQL . What you
see is called Home Window
◦ Next you need to create your MySQL Server Connection which
contains details about target database server including how to
connect to it. Click " + " in MySQL Workbench Home Window.
This will open Setup New Connection . Wizard
◦ Next Step is to setup a connection, which can be used to connect
to server. If you have not created a connection already, you can
use the default values given. Click on Test Connection [ 2 ] after
entering the Connection Name [ 1 ].
Install MySQL workbench (Windows)
If the entered password for the user is correct then the following
screen will show. Click on both OK buttons and you will be good to
go.
platform.
MySQL supports multiple storage engines which greatly
The database development life cycle has a number of stages that are
followed when developing database systems.
The steps in the development life cycle do not necessary have to be
followed religiously in a sequential manner.
On small database systems, the database system development life
cycle is usually very simple and does not involve a lot of steps.
In order to fully appreciate the above diagram, let's look at the
individual components listed in each step.
Database Development Life Cycle
(Requirement Analysis)
Normalization
E R Modeling
What is 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 links them using relationships.
The inventor of the relational model Edgar Codd proposed the theory of
normalization with the introduction of First Normal Form, and he
continued to extend theory with Second and Third Normal Form.
◦ Later he joined with Raymond F. Boyce to develop the theory of Boyce-Codd
Normal Form.
Theory of Data Normalization in SQL is still being developed
further. For example, there are discussions even on 6 th Normal
Form. However, in most practical applications,
normalization achieves its best in 3rd Normal Form. The
evolution of Normalization theories is illustrated below-
Database Normalization Example:
Without any normalization, all information is stored in one table as
shown below.
Here you see Movies Rented column has multiple
values
1NF (First Normal Form) Rules:
Each table cell should contain a single value.
Each record needs to be unique.
1NF Example
What is a KEY?
A KEY is a value used to identify a record in a table uniquely. A
KEY could be a single column or combination of multiple columns
Note: Columns in a table that are NOT used to identify a record
uniquely are called non-key columns.
Rule-1-Be in 1NF
Rule-2-Single Column Primary Key
The above problem can be overcome by declaring membership id from Table2 as
foreign key of membership id from Table1
Now, if somebody tries to insert a value in the membership id field that does not
exist in the parent table, an error will be shown!
3NF(Third Normal Form) Rules?
Rule 1- Be in 2NF
Rule 2- Has no transitive functional dependencies
To move our 2NF table into 3NF, we again need to again divide
our table.
3NF(Third Normal Form) Rules?
We have again divided our tables and created a new table which
stores Salutations.
There are no transitive functional dependencies, and hence our
table is in 3NF
In Table 3 Salutation ID is primary key, and in Table 1
Salutation ID is foreign to primary key in Table 3
Now our little example is at a level that cannot further be
decomposed to attain higher forms of normalization.
In fact, it is already in higher normalization forms.
Separate efforts for moving into next levels of normalizing data
are normally needed in complex databases.
However, we will be discussing next levels of normalizations in
brief in the following.