2. 1979,IBM researchers created a simple non
procedural language called “Structured
English Query Language or SEQUEL”
1980’s ANSI &OSI (organizations deal with
Standards) standardized version called
Structured query language & Sql
Pronounced as “sequel”
Latest versions is SQL -99 ,SQL -92 is current
universally adopted standard
3. A relational database uses the concept of
linked two dimensional tables which
comprise of rows and columns .
a user can draw relationships between
multiple tables and present the output as a
table again.
A user of a relational database need not
understand the representation of data in
order to retrieve it
Relational programming is non procedural.
4. Programming language are procedural if they
use programming elements such as
conditional statements (if-then-else, do-
while etc.)
SQL has none of these types of statements ,
hence Non procedural.
My sql and MSqL are DBMS
Procedural & non Procedural
5. It is the process where a database is
designed in a way that removes redundancies
and increases the clarity in organizing data in
a database
It raises the eficiency of the database in terms
of management data storage and scalability
6. For E-g :Contacts Database
Create a database with the following fields
First name,Last name,Birth Date, street
,address,City,State,Zip,Country,
TelephoneHome,Telephonework,Email,
Companyname,Designation
Keep the FirstName,Lastname&Birthdate in one
table
Address related data in another
Company details in another
E-mails in another
Telephones in another
7. INT(length) integer with unsigned range 0-429467295
a signed from -2147483648-2147483648
Decimal (length, decimal)-floating point number with the
range of the Double type that is store as a char field typed
Date YYYY-MM-DD
Time HH:MM:DD
DATETIME:YYYY-MM-DD-HH:MM:SS
Year YYYY or YY
Varchar (length)A fixed length text string (255 character
Max)where unused trailing spaces are removed before
storing
8. Run the command line tool “Mysql”
MySQL>use contacts
MySQL>CREATE TABLE
names(contact_idSMALLINT NOT
NULLAUTO_INCREAMENTPRIMARYKEY,
FIRSTNAME
CHAR(20),LastNameCHAR(20),Birthdate
DATE);
9. Mysql>CREAT TABLE address(contact_id
SMALLINT NOT NULL PRIMARY
KEY,streetAddressCHAR(50),city CHAR (20),state
CHAR(20),Zip CHAR(15),country CHAR (20))
Mysql>CREAT TABLE telephones(contact_Id
SMALLINT NOT NULL PRIMARY
KEY,TELEPHONEHOME INT (20));
Mysql>CREAT TABLE email (Contact_Id SMALLINT
NOT NULL PRIMARYKEY,Email CHAR(20));
Mysql>CREAT TABLE company details(contact_id
SMALLINT NOT NULL PRIMARY
KEY,companyName CHAR(25),Designation
CHAR(15))
10. A Foreign Key is a Field which is also the Primary
Key in Another table. This is Known commonly
as referential integrity.
To see the tables inside the database:
Mysql>SHOW TABLES;
∣ Tables in contacts ∣
∣ address∣
∣ Company_details∣
∣ email ∣
∣ names ∣
∣ Telephones∣
11. Mysql>SHOWCOLUMNSFROM address;
Insert data one row at a time
Mysql>INSERT INTO
names(FirstName,LastName,BirthDate)VALUES
(‘raj’,‘kumar’,‘1980-10-14’);
To see what the data looks like inside the
table- using select command
Mysql>select*fromNAMES;
∣ Contactid ∣ FirstName ∣ LastName ∣ BirthDate ∣
∣ 2 ∣Raj ∣ kumar ∣1980-10-14 ∣
20. Normalisation Example
We will demonstrate the process of normalisation
(to 3NF) by use of an example. Normalisation is a
bottom-up technique for database design,
normally based on an existing system (which may
be paper-based). We start by analysing the
documentation, eg reports, screen layouts from
that system. We will begin with the Project
Management Report, which describes projects
being worked upon by employees. This report is
to be 'normalised'. Each of the first four
normalisation steps is explained.
Next: Step 1