SlideShare a Scribd company logo
1 of 20
 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
 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.
 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
 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
 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
 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
 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);
 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))
 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∣
 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 ∣
 Mysql>select*FROMnamesWHEREcontact_id>1
∣ Contact_id ∣FirstName ∣Lastname ∣BirthDate ∣
∣ ∣ 3 ∣sam ∣ son ∣1981-4-12 ∣
2 ∣sanu ∣gupta ∣1987-5-12 ∣
 Mysql>select*FROMnamesWHEREBirthDate>’1973-03-
06’
∣ Contact_id ∣FirstName ∣LastName ∣BirthDate ∣
∣ 3 ∣sam ∣ son ∣1981-4-12 ∣
∣ 2 ∣sanu ∣gupta ∣1987-5-12 ∣
 Mysql>selectFirstName,LastNameFROM names WHERE
LastName LIKE’C%’;
∣ FirstName ∣LastName ∣
∣ Jai ∣ chopra ∣
∣ Diksha ∣chaubey ∣
 Mysql>SELECTFirstName,LastNameFrom
names WHERE LastName LIKE ‘_roy’
∣ FirstName ∣LastName ∣
∣ Bikram ∣Roy ∣
 Mysql>SELECT contact_id FROM names WHERE
LastName IN(“Diaz’,’Carrera’)
∣ Contact_ID ∣
∣ 3 ∣
∣2 ∣
 Mysql>SELECT count(*)FROM names;
∣count(*) ∣
∣3 ∣
 Mysql>SELECT count (FirstName)FROM names;
∣count(FirstName) ∣
∣3 ∣
 Mysql>SELECT*FROMnamesWHEREcontact_id>=1
∣ Contactid ∣ FirstName ∣ LastName ∣ BirthDate ∣
∣ 2 ∣Raj ∣ kumar ∣1980-10-14 ∣
 Mysql>select FirstName,LastName FROM
names WHERE contact_id BETWEEN 2and3
∣ FirstName ∣LastName ∣
∣ Jai ∣ chopra ∣
∣ Diksha ∣chaubey ∣
 mysql>ALTER TABLE names ADD Age
SMALLINT;
 mysql>ALTER TABLE names CHANGE
COLUMN Age Age TINYINT;
 TO Rename a Table:
 mysql>ALTER TABLE names RENAME AS
mynames
 Mysql>ALTER TABLE names RENAME AS
names
 Mysql>update names SET
Age=‘23’WHEREFirstName=‘Tia’;
 Mysql.SELECT*FROM names;
∣ Contactid ∣ FirstName ∣ LastName ∣ BirthDate ∣Age ∣
∣ 2 ∣Tia ∣ kumar ∣1980-10-14 ∣23 ∣
∣ 3 ∣sam ∣ son ∣1981-4-12 ∣24 ∣
 Mysql>DELETE FROM names WHERE Age=23
 Mysql>select*FROM names
∣ 3 ∣sam ∣ son ∣1981-4-12 ∣24 ∣
 Mysql>DELETE FROM names;
 Mysql>SELECT*FROM names;
Empty set
 Mysql>DROP TABLE names;
 Mysql>SHOW TABLE names;
 ∣ Tables in contacts ∣
∣ address∣
∣ Company_details∣
∣ email ∣
∣ Telephones∣
 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

More Related Content

What's hot

Introduction to SQL (for Chicago Booth MBA technology club)
Introduction to SQL (for Chicago Booth MBA technology club)Introduction to SQL (for Chicago Booth MBA technology club)
Introduction to SQL (for Chicago Booth MBA technology club)Jennifer Berk
 
introdution to SQL and SQL functions
introdution to SQL and SQL functionsintrodution to SQL and SQL functions
introdution to SQL and SQL functionsfarwa waqar
 
SQL Queries Information
SQL Queries InformationSQL Queries Information
SQL Queries InformationNishant Munjal
 
A must Sql notes for beginners
A must Sql notes for beginnersA must Sql notes for beginners
A must Sql notes for beginnersRam Sagar Mourya
 
Introduction to structured query language (sql)
Introduction to structured query language (sql)Introduction to structured query language (sql)
Introduction to structured query language (sql)Sabana Maharjan
 
MS SQL Database basic
MS SQL Database basicMS SQL Database basic
MS SQL Database basicwali1195189
 
DDL(Data defination Language ) Using Oracle
DDL(Data defination Language ) Using OracleDDL(Data defination Language ) Using Oracle
DDL(Data defination Language ) Using OracleFarhan Aslam
 
PostgreSQL Tutorial for Beginners | Edureka
PostgreSQL Tutorial for Beginners | EdurekaPostgreSQL Tutorial for Beginners | Edureka
PostgreSQL Tutorial for Beginners | EdurekaEdureka!
 
Session 8 connect your universal application with database .. builders & deve...
Session 8 connect your universal application with database .. builders & deve...Session 8 connect your universal application with database .. builders & deve...
Session 8 connect your universal application with database .. builders & deve...Moatasim Magdy
 
Sql Basics | Edureka
Sql Basics | EdurekaSql Basics | Edureka
Sql Basics | EdurekaEdureka!
 

What's hot (20)

Day 2b i/o.pptx
Day 2b   i/o.pptxDay 2b   i/o.pptx
Day 2b i/o.pptx
 
Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQL
 
Introduction to SQL (for Chicago Booth MBA technology club)
Introduction to SQL (for Chicago Booth MBA technology club)Introduction to SQL (for Chicago Booth MBA technology club)
Introduction to SQL (for Chicago Booth MBA technology club)
 
introdution to SQL and SQL functions
introdution to SQL and SQL functionsintrodution to SQL and SQL functions
introdution to SQL and SQL functions
 
SQL Queries Information
SQL Queries InformationSQL Queries Information
SQL Queries Information
 
BIS05 Introduction to SQL
BIS05 Introduction to SQLBIS05 Introduction to SQL
BIS05 Introduction to SQL
 
A must Sql notes for beginners
A must Sql notes for beginnersA must Sql notes for beginners
A must Sql notes for beginners
 
Introduction to structured query language (sql)
Introduction to structured query language (sql)Introduction to structured query language (sql)
Introduction to structured query language (sql)
 
Mysql Ppt
Mysql PptMysql Ppt
Mysql Ppt
 
MS SQL Database basic
MS SQL Database basicMS SQL Database basic
MS SQL Database basic
 
Sql
SqlSql
Sql
 
Day 2 repeats.pptx
Day 2 repeats.pptxDay 2 repeats.pptx
Day 2 repeats.pptx
 
DDL(Data defination Language ) Using Oracle
DDL(Data defination Language ) Using OracleDDL(Data defination Language ) Using Oracle
DDL(Data defination Language ) Using Oracle
 
Sql
SqlSql
Sql
 
1.2 sql create and drop table
1.2 sql create and drop table1.2 sql create and drop table
1.2 sql create and drop table
 
Crash course in sql
Crash course in sqlCrash course in sql
Crash course in sql
 
PostgreSQL Tutorial for Beginners | Edureka
PostgreSQL Tutorial for Beginners | EdurekaPostgreSQL Tutorial for Beginners | Edureka
PostgreSQL Tutorial for Beginners | Edureka
 
Session 8 connect your universal application with database .. builders & deve...
Session 8 connect your universal application with database .. builders & deve...Session 8 connect your universal application with database .. builders & deve...
Session 8 connect your universal application with database .. builders & deve...
 
Sql12
Sql12Sql12
Sql12
 
Sql Basics | Edureka
Sql Basics | EdurekaSql Basics | Edureka
Sql Basics | Edureka
 

Viewers also liked

Viewers also liked (7)

Environmental activism
Environmental activismEnvironmental activism
Environmental activism
 
Groundwater regulations in bangalore.docx
Groundwater regulations in bangalore.docxGroundwater regulations in bangalore.docx
Groundwater regulations in bangalore.docx
 
Takings law and groundwater regulation - how do we coexist? Deborah Trejo, Ke...
Takings law and groundwater regulation - how do we coexist? Deborah Trejo, Ke...Takings law and groundwater regulation - how do we coexist? Deborah Trejo, Ke...
Takings law and groundwater regulation - how do we coexist? Deborah Trejo, Ke...
 
Environmental activist
Environmental  activistEnvironmental  activist
Environmental activist
 
Bill mullican
Bill mullicanBill mullican
Bill mullican
 
Danny hardcastle
Danny hardcastleDanny hardcastle
Danny hardcastle
 
environmental movements in india-30slides
  environmental movements in india-30slides  environmental movements in india-30slides
environmental movements in india-30slides
 

Similar to Sql

Similar to Sql (20)

Mysql
MysqlMysql
Mysql
 
sql.pptx
sql.pptxsql.pptx
sql.pptx
 
MYSQL.ppt
MYSQL.pptMYSQL.ppt
MYSQL.ppt
 
MySQL Database System Hiep Dinh
MySQL Database System Hiep DinhMySQL Database System Hiep Dinh
MySQL Database System Hiep Dinh
 
mysqlHiep.ppt
mysqlHiep.pptmysqlHiep.ppt
mysqlHiep.ppt
 
Cassandra Data Modeling
Cassandra Data ModelingCassandra Data Modeling
Cassandra Data Modeling
 
Cassandra
CassandraCassandra
Cassandra
 
MSAvMySQL.pptx
MSAvMySQL.pptxMSAvMySQL.pptx
MSAvMySQL.pptx
 
Introduction to my_sql
Introduction to my_sqlIntroduction to my_sql
Introduction to my_sql
 
LECTURE NOTES.pdf
LECTURE NOTES.pdfLECTURE NOTES.pdf
LECTURE NOTES.pdf
 
LECTURE NOTES.pdf
LECTURE NOTES.pdfLECTURE NOTES.pdf
LECTURE NOTES.pdf
 
MySQL and its basic commands
MySQL and its basic commandsMySQL and its basic commands
MySQL and its basic commands
 
mysqlanditsbasiccommands-150226033905-conversion-gate02.pdf
mysqlanditsbasiccommands-150226033905-conversion-gate02.pdfmysqlanditsbasiccommands-150226033905-conversion-gate02.pdf
mysqlanditsbasiccommands-150226033905-conversion-gate02.pdf
 
MySQL.pptx comuterscience from kvsbbsrs.
MySQL.pptx comuterscience from kvsbbsrs.MySQL.pptx comuterscience from kvsbbsrs.
MySQL.pptx comuterscience from kvsbbsrs.
 
lab#1,2,3.pptx
lab#1,2,3.pptxlab#1,2,3.pptx
lab#1,2,3.pptx
 
Mysql DBI
Mysql DBIMysql DBI
Mysql DBI
 
MySql slides (ppt)
MySql slides (ppt)MySql slides (ppt)
MySql slides (ppt)
 
Mysql-overview.pptx
Mysql-overview.pptxMysql-overview.pptx
Mysql-overview.pptx
 
SQL & PLSQL
SQL & PLSQLSQL & PLSQL
SQL & PLSQL
 
Module 3
Module 3Module 3
Module 3
 

More from Tej Kiran

Transactional Analysis and Communction
Transactional Analysis and CommunctionTransactional Analysis and Communction
Transactional Analysis and CommunctionTej Kiran
 
Organizational communication
Organizational communicationOrganizational communication
Organizational communicationTej Kiran
 
Leadership and group
Leadership and groupLeadership and group
Leadership and groupTej Kiran
 
Internal and external
Internal   and   externalInternal   and   external
Internal and externalTej Kiran
 
Barriers in communication
Barriers in communicationBarriers in communication
Barriers in communicationTej Kiran
 
communtication
 communtication communtication
communticationTej Kiran
 
Partnership accounts
Partnership accountsPartnership accounts
Partnership accountsTej Kiran
 
Basics of company accounts and issue of shares
Basics of company accounts and issue of sharesBasics of company accounts and issue of shares
Basics of company accounts and issue of sharesTej Kiran
 
Amalgamation and absorption
Amalgamation and absorptionAmalgamation and absorption
Amalgamation and absorptionTej Kiran
 
Cash flow statement
Cash flow statementCash flow statement
Cash flow statementTej Kiran
 
Water resources in india
Water resources in indiaWater resources in india
Water resources in indiaTej Kiran
 
Role of govt in environment
Role of govt in environmentRole of govt in environment
Role of govt in environmentTej Kiran
 
Population growth & its effect on environment
Population growth & its effect on environmentPopulation growth & its effect on environment
Population growth & its effect on environmentTej Kiran
 
Noise pollution
Noise pollutionNoise pollution
Noise pollutionTej Kiran
 
Natural resources
Natural resourcesNatural resources
Natural resourcesTej Kiran
 
Energy resources & types
Energy resources & typesEnergy resources & types
Energy resources & typesTej Kiran
 

More from Tej Kiran (20)

Transactional Analysis and Communction
Transactional Analysis and CommunctionTransactional Analysis and Communction
Transactional Analysis and Communction
 
Organizational communication
Organizational communicationOrganizational communication
Organizational communication
 
Leadership
LeadershipLeadership
Leadership
 
Leadership and group
Leadership and groupLeadership and group
Leadership and group
 
Leadership
Leadership Leadership
Leadership
 
Internal and external
Internal   and   externalInternal   and   external
Internal and external
 
Barriers in communication
Barriers in communicationBarriers in communication
Barriers in communication
 
communtication
 communtication communtication
communtication
 
Partnership accounts
Partnership accountsPartnership accounts
Partnership accounts
 
Basics of company accounts and issue of shares
Basics of company accounts and issue of sharesBasics of company accounts and issue of shares
Basics of company accounts and issue of shares
 
Amalgamation and absorption
Amalgamation and absorptionAmalgamation and absorption
Amalgamation and absorption
 
Cash flow statement
Cash flow statementCash flow statement
Cash flow statement
 
Water resources in india
Water resources in indiaWater resources in india
Water resources in india
 
Solid waste
Solid wasteSolid waste
Solid waste
 
Role of govt in environment
Role of govt in environmentRole of govt in environment
Role of govt in environment
 
Population growth & its effect on environment
Population growth & its effect on environmentPopulation growth & its effect on environment
Population growth & its effect on environment
 
Noise pollution
Noise pollutionNoise pollution
Noise pollution
 
Natural resources
Natural resourcesNatural resources
Natural resources
 
Iso
IsoIso
Iso
 
Energy resources & types
Energy resources & typesEnergy resources & types
Energy resources & types
 

Recently uploaded

7.pdf This presentation captures many uses and the significance of the number...
7.pdf This presentation captures many uses and the significance of the number...7.pdf This presentation captures many uses and the significance of the number...
7.pdf This presentation captures many uses and the significance of the number...Paul Menig
 
VIP Call Girl Jamshedpur Aashi 8250192130 Independent Escort Service Jamshedpur
VIP Call Girl Jamshedpur Aashi 8250192130 Independent Escort Service JamshedpurVIP Call Girl Jamshedpur Aashi 8250192130 Independent Escort Service Jamshedpur
VIP Call Girl Jamshedpur Aashi 8250192130 Independent Escort Service JamshedpurSuhani Kapoor
 
Non Text Magic Studio Magic Design for Presentations L&P.pptx
Non Text Magic Studio Magic Design for Presentations L&P.pptxNon Text Magic Studio Magic Design for Presentations L&P.pptx
Non Text Magic Studio Magic Design for Presentations L&P.pptxAbhayThakur200703
 
VIP Call Girls Pune Kirti 8617697112 Independent Escort Service Pune
VIP Call Girls Pune Kirti 8617697112 Independent Escort Service PuneVIP Call Girls Pune Kirti 8617697112 Independent Escort Service Pune
VIP Call Girls Pune Kirti 8617697112 Independent Escort Service PuneCall girls in Ahmedabad High profile
 
Call Girls in Mehrauli Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Mehrauli Delhi 💯Call Us 🔝8264348440🔝Call Girls in Mehrauli Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Mehrauli Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service AvailableDipal Arora
 
rishikeshgirls.in- Rishikesh call girl.pdf
rishikeshgirls.in- Rishikesh call girl.pdfrishikeshgirls.in- Rishikesh call girl.pdf
rishikeshgirls.in- Rishikesh call girl.pdfmuskan1121w
 
Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...
Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...
Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...lizamodels9
 
M.C Lodges -- Guest House in Jhang.
M.C Lodges --  Guest House in Jhang.M.C Lodges --  Guest House in Jhang.
M.C Lodges -- Guest House in Jhang.Aaiza Hassan
 
Vip Female Escorts Noida 9711199171 Greater Noida Escorts Service
Vip Female Escorts Noida 9711199171 Greater Noida Escorts ServiceVip Female Escorts Noida 9711199171 Greater Noida Escorts Service
Vip Female Escorts Noida 9711199171 Greater Noida Escorts Serviceankitnayak356677
 
Progress Report - Oracle Database Analyst Summit
Progress  Report - Oracle Database Analyst SummitProgress  Report - Oracle Database Analyst Summit
Progress Report - Oracle Database Analyst SummitHolger Mueller
 
Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...
Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...
Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...lizamodels9
 
Pharma Works Profile of Karan Communications
Pharma Works Profile of Karan CommunicationsPharma Works Profile of Karan Communications
Pharma Works Profile of Karan Communicationskarancommunications
 
Monte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSMMonte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSMRavindra Nath Shukla
 
The CMO Survey - Highlights and Insights Report - Spring 2024
The CMO Survey - Highlights and Insights Report - Spring 2024The CMO Survey - Highlights and Insights Report - Spring 2024
The CMO Survey - Highlights and Insights Report - Spring 2024christinemoorman
 
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...lizamodels9
 
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,noida100girls
 
Russian Faridabad Call Girls(Badarpur) : ☎ 8168257667, @4999
Russian Faridabad Call Girls(Badarpur) : ☎ 8168257667, @4999Russian Faridabad Call Girls(Badarpur) : ☎ 8168257667, @4999
Russian Faridabad Call Girls(Badarpur) : ☎ 8168257667, @4999Tina Ji
 

Recently uploaded (20)

Best Practices for Implementing an External Recruiting Partnership
Best Practices for Implementing an External Recruiting PartnershipBest Practices for Implementing an External Recruiting Partnership
Best Practices for Implementing an External Recruiting Partnership
 
7.pdf This presentation captures many uses and the significance of the number...
7.pdf This presentation captures many uses and the significance of the number...7.pdf This presentation captures many uses and the significance of the number...
7.pdf This presentation captures many uses and the significance of the number...
 
VIP Call Girl Jamshedpur Aashi 8250192130 Independent Escort Service Jamshedpur
VIP Call Girl Jamshedpur Aashi 8250192130 Independent Escort Service JamshedpurVIP Call Girl Jamshedpur Aashi 8250192130 Independent Escort Service Jamshedpur
VIP Call Girl Jamshedpur Aashi 8250192130 Independent Escort Service Jamshedpur
 
Non Text Magic Studio Magic Design for Presentations L&P.pptx
Non Text Magic Studio Magic Design for Presentations L&P.pptxNon Text Magic Studio Magic Design for Presentations L&P.pptx
Non Text Magic Studio Magic Design for Presentations L&P.pptx
 
VIP Call Girls Pune Kirti 8617697112 Independent Escort Service Pune
VIP Call Girls Pune Kirti 8617697112 Independent Escort Service PuneVIP Call Girls Pune Kirti 8617697112 Independent Escort Service Pune
VIP Call Girls Pune Kirti 8617697112 Independent Escort Service Pune
 
Call Girls in Mehrauli Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Mehrauli Delhi 💯Call Us 🔝8264348440🔝Call Girls in Mehrauli Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Mehrauli Delhi 💯Call Us 🔝8264348440🔝
 
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
 
rishikeshgirls.in- Rishikesh call girl.pdf
rishikeshgirls.in- Rishikesh call girl.pdfrishikeshgirls.in- Rishikesh call girl.pdf
rishikeshgirls.in- Rishikesh call girl.pdf
 
Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...
Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...
Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...
 
KestrelPro Flyer Japan IT Week 2024 (English)
KestrelPro Flyer Japan IT Week 2024 (English)KestrelPro Flyer Japan IT Week 2024 (English)
KestrelPro Flyer Japan IT Week 2024 (English)
 
M.C Lodges -- Guest House in Jhang.
M.C Lodges --  Guest House in Jhang.M.C Lodges --  Guest House in Jhang.
M.C Lodges -- Guest House in Jhang.
 
Vip Female Escorts Noida 9711199171 Greater Noida Escorts Service
Vip Female Escorts Noida 9711199171 Greater Noida Escorts ServiceVip Female Escorts Noida 9711199171 Greater Noida Escorts Service
Vip Female Escorts Noida 9711199171 Greater Noida Escorts Service
 
Progress Report - Oracle Database Analyst Summit
Progress  Report - Oracle Database Analyst SummitProgress  Report - Oracle Database Analyst Summit
Progress Report - Oracle Database Analyst Summit
 
Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...
Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...
Call Girls In Radisson Blu Hotel New Delhi Paschim Vihar ❤️8860477959 Escorts...
 
Pharma Works Profile of Karan Communications
Pharma Works Profile of Karan CommunicationsPharma Works Profile of Karan Communications
Pharma Works Profile of Karan Communications
 
Monte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSMMonte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSM
 
The CMO Survey - Highlights and Insights Report - Spring 2024
The CMO Survey - Highlights and Insights Report - Spring 2024The CMO Survey - Highlights and Insights Report - Spring 2024
The CMO Survey - Highlights and Insights Report - Spring 2024
 
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
Call Girls In Sikandarpur Gurgaon ❤️8860477959_Russian 100% Genuine Escorts I...
 
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
 
Russian Faridabad Call Girls(Badarpur) : ☎ 8168257667, @4999
Russian Faridabad Call Girls(Badarpur) : ☎ 8168257667, @4999Russian Faridabad Call Girls(Badarpur) : ☎ 8168257667, @4999
Russian Faridabad Call Girls(Badarpur) : ☎ 8168257667, @4999
 

Sql

  • 1.
  • 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 ∣
  • 12.  Mysql>select*FROMnamesWHEREcontact_id>1 ∣ Contact_id ∣FirstName ∣Lastname ∣BirthDate ∣ ∣ ∣ 3 ∣sam ∣ son ∣1981-4-12 ∣ 2 ∣sanu ∣gupta ∣1987-5-12 ∣  Mysql>select*FROMnamesWHEREBirthDate>’1973-03- 06’ ∣ Contact_id ∣FirstName ∣LastName ∣BirthDate ∣ ∣ 3 ∣sam ∣ son ∣1981-4-12 ∣ ∣ 2 ∣sanu ∣gupta ∣1987-5-12 ∣  Mysql>selectFirstName,LastNameFROM names WHERE LastName LIKE’C%’; ∣ FirstName ∣LastName ∣ ∣ Jai ∣ chopra ∣ ∣ Diksha ∣chaubey ∣
  • 13.  Mysql>SELECTFirstName,LastNameFrom names WHERE LastName LIKE ‘_roy’ ∣ FirstName ∣LastName ∣ ∣ Bikram ∣Roy ∣  Mysql>SELECT contact_id FROM names WHERE LastName IN(“Diaz’,’Carrera’) ∣ Contact_ID ∣ ∣ 3 ∣ ∣2 ∣
  • 14.  Mysql>SELECT count(*)FROM names; ∣count(*) ∣ ∣3 ∣  Mysql>SELECT count (FirstName)FROM names; ∣count(FirstName) ∣ ∣3 ∣  Mysql>SELECT*FROMnamesWHEREcontact_id>=1 ∣ Contactid ∣ FirstName ∣ LastName ∣ BirthDate ∣ ∣ 2 ∣Raj ∣ kumar ∣1980-10-14 ∣
  • 15.  Mysql>select FirstName,LastName FROM names WHERE contact_id BETWEEN 2and3 ∣ FirstName ∣LastName ∣ ∣ Jai ∣ chopra ∣ ∣ Diksha ∣chaubey ∣
  • 16.  mysql>ALTER TABLE names ADD Age SMALLINT;  mysql>ALTER TABLE names CHANGE COLUMN Age Age TINYINT;  TO Rename a Table:  mysql>ALTER TABLE names RENAME AS mynames  Mysql>ALTER TABLE names RENAME AS names
  • 17.  Mysql>update names SET Age=‘23’WHEREFirstName=‘Tia’;  Mysql.SELECT*FROM names; ∣ Contactid ∣ FirstName ∣ LastName ∣ BirthDate ∣Age ∣ ∣ 2 ∣Tia ∣ kumar ∣1980-10-14 ∣23 ∣ ∣ 3 ∣sam ∣ son ∣1981-4-12 ∣24 ∣
  • 18.  Mysql>DELETE FROM names WHERE Age=23  Mysql>select*FROM names ∣ 3 ∣sam ∣ son ∣1981-4-12 ∣24 ∣  Mysql>DELETE FROM names;  Mysql>SELECT*FROM names; Empty set
  • 19.  Mysql>DROP TABLE names;  Mysql>SHOW TABLE names;  ∣ Tables in contacts ∣ ∣ address∣ ∣ Company_details∣ ∣ email ∣ ∣ Telephones∣
  • 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