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

Getting Real with AI - Columbus DAW - May 2024 - Nick Woo from AlignAI
Getting Real with AI - Columbus DAW - May 2024 - Nick Woo from AlignAIGetting Real with AI - Columbus DAW - May 2024 - Nick Woo from AlignAI
Getting Real with AI - Columbus DAW - May 2024 - Nick Woo from AlignAITim Wilson
 
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 Months
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60%  in 6 MonthsSEO Case Study: How I Increased SEO Traffic & Ranking by 50-60%  in 6 Months
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 MonthsIndeedSEO
 
Challenges and Opportunities: A Qualitative Study on Tax Compliance in Pakistan
Challenges and Opportunities: A Qualitative Study on Tax Compliance in PakistanChallenges and Opportunities: A Qualitative Study on Tax Compliance in Pakistan
Challenges and Opportunities: A Qualitative Study on Tax Compliance in Pakistanvineshkumarsajnani12
 
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai KuwaitThe Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwaitdaisycvs
 
Paradip CALL GIRL❤7091819311❤CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
Paradip CALL GIRL❤7091819311❤CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDINGParadip CALL GIRL❤7091819311❤CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
Paradip CALL GIRL❤7091819311❤CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDINGpr788182
 
Berhampur Call Girl Just Call 8084732287 Top Class Call Girl Service Available
Berhampur Call Girl Just Call 8084732287 Top Class Call Girl Service AvailableBerhampur Call Girl Just Call 8084732287 Top Class Call Girl Service Available
Berhampur Call Girl Just Call 8084732287 Top Class Call Girl Service Availablepr788182
 
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...daisycvs
 
Mckinsey foundation level Handbook for Viewing
Mckinsey foundation level Handbook for ViewingMckinsey foundation level Handbook for Viewing
Mckinsey foundation level Handbook for ViewingNauman Safdar
 
Berhampur CALL GIRL❤7091819311❤CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
Berhampur CALL GIRL❤7091819311❤CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDINGBerhampur CALL GIRL❤7091819311❤CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
Berhampur CALL GIRL❤7091819311❤CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDINGpr788182
 
UAE Bur Dubai Call Girls ☏ 0564401582 Call Girl in Bur Dubai
UAE Bur Dubai Call Girls ☏ 0564401582 Call Girl in Bur DubaiUAE Bur Dubai Call Girls ☏ 0564401582 Call Girl in Bur Dubai
UAE Bur Dubai Call Girls ☏ 0564401582 Call Girl in Bur Dubaijaehdlyzca
 
PARK STREET 💋 Call Girl 9827461493 Call Girls in Escort service book now
PARK STREET 💋 Call Girl 9827461493 Call Girls in  Escort service book nowPARK STREET 💋 Call Girl 9827461493 Call Girls in  Escort service book now
PARK STREET 💋 Call Girl 9827461493 Call Girls in Escort service book nowkapoorjyoti4444
 
Escorts in Nungambakkam Phone 8250092165 Enjoy 24/7 Escort Service Enjoy Your...
Escorts in Nungambakkam Phone 8250092165 Enjoy 24/7 Escort Service Enjoy Your...Escorts in Nungambakkam Phone 8250092165 Enjoy 24/7 Escort Service Enjoy Your...
Escorts in Nungambakkam Phone 8250092165 Enjoy 24/7 Escort Service Enjoy Your...meghakumariji156
 
Uneak White's Personal Brand Exploration Presentation
Uneak White's Personal Brand Exploration PresentationUneak White's Personal Brand Exploration Presentation
Uneak White's Personal Brand Exploration Presentationuneakwhite
 
Organizational Transformation Lead with Culture
Organizational Transformation Lead with CultureOrganizational Transformation Lead with Culture
Organizational Transformation Lead with CultureSeta Wicaksana
 
CROSS CULTURAL NEGOTIATION BY PANMISEM NS
CROSS CULTURAL NEGOTIATION BY PANMISEM NSCROSS CULTURAL NEGOTIATION BY PANMISEM NS
CROSS CULTURAL NEGOTIATION BY PANMISEM NSpanmisemningshen123
 
Berhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
Berhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDINGBerhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
Berhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDINGpr788182
 
Nashik Call Girl Just Call 7091819311 Top Class Call Girl Service Available
Nashik Call Girl Just Call 7091819311 Top Class Call Girl Service AvailableNashik Call Girl Just Call 7091819311 Top Class Call Girl Service Available
Nashik Call Girl Just Call 7091819311 Top Class Call Girl Service Availablepr788182
 
QSM Chap 10 Service Culture in Tourism and Hospitality Industry.pptx
QSM Chap 10 Service Culture in Tourism and Hospitality Industry.pptxQSM Chap 10 Service Culture in Tourism and Hospitality Industry.pptx
QSM Chap 10 Service Culture in Tourism and Hospitality Industry.pptxDitasDelaCruz
 

Recently uploaded (20)

Getting Real with AI - Columbus DAW - May 2024 - Nick Woo from AlignAI
Getting Real with AI - Columbus DAW - May 2024 - Nick Woo from AlignAIGetting Real with AI - Columbus DAW - May 2024 - Nick Woo from AlignAI
Getting Real with AI - Columbus DAW - May 2024 - Nick Woo from AlignAI
 
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 Months
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60%  in 6 MonthsSEO Case Study: How I Increased SEO Traffic & Ranking by 50-60%  in 6 Months
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 Months
 
Challenges and Opportunities: A Qualitative Study on Tax Compliance in Pakistan
Challenges and Opportunities: A Qualitative Study on Tax Compliance in PakistanChallenges and Opportunities: A Qualitative Study on Tax Compliance in Pakistan
Challenges and Opportunities: A Qualitative Study on Tax Compliance in Pakistan
 
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai KuwaitThe Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
 
Paradip CALL GIRL❤7091819311❤CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
Paradip CALL GIRL❤7091819311❤CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDINGParadip CALL GIRL❤7091819311❤CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
Paradip CALL GIRL❤7091819311❤CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
 
Berhampur Call Girl Just Call 8084732287 Top Class Call Girl Service Available
Berhampur Call Girl Just Call 8084732287 Top Class Call Girl Service AvailableBerhampur Call Girl Just Call 8084732287 Top Class Call Girl Service Available
Berhampur Call Girl Just Call 8084732287 Top Class Call Girl Service Available
 
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
 
Mckinsey foundation level Handbook for Viewing
Mckinsey foundation level Handbook for ViewingMckinsey foundation level Handbook for Viewing
Mckinsey foundation level Handbook for Viewing
 
Berhampur CALL GIRL❤7091819311❤CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
Berhampur CALL GIRL❤7091819311❤CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDINGBerhampur CALL GIRL❤7091819311❤CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
Berhampur CALL GIRL❤7091819311❤CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
 
UAE Bur Dubai Call Girls ☏ 0564401582 Call Girl in Bur Dubai
UAE Bur Dubai Call Girls ☏ 0564401582 Call Girl in Bur DubaiUAE Bur Dubai Call Girls ☏ 0564401582 Call Girl in Bur Dubai
UAE Bur Dubai Call Girls ☏ 0564401582 Call Girl in Bur Dubai
 
Buy gmail accounts.pdf buy Old Gmail Accounts
Buy gmail accounts.pdf buy Old Gmail AccountsBuy gmail accounts.pdf buy Old Gmail Accounts
Buy gmail accounts.pdf buy Old Gmail Accounts
 
PARK STREET 💋 Call Girl 9827461493 Call Girls in Escort service book now
PARK STREET 💋 Call Girl 9827461493 Call Girls in  Escort service book nowPARK STREET 💋 Call Girl 9827461493 Call Girls in  Escort service book now
PARK STREET 💋 Call Girl 9827461493 Call Girls in Escort service book now
 
Escorts in Nungambakkam Phone 8250092165 Enjoy 24/7 Escort Service Enjoy Your...
Escorts in Nungambakkam Phone 8250092165 Enjoy 24/7 Escort Service Enjoy Your...Escorts in Nungambakkam Phone 8250092165 Enjoy 24/7 Escort Service Enjoy Your...
Escorts in Nungambakkam Phone 8250092165 Enjoy 24/7 Escort Service Enjoy Your...
 
Uneak White's Personal Brand Exploration Presentation
Uneak White's Personal Brand Exploration PresentationUneak White's Personal Brand Exploration Presentation
Uneak White's Personal Brand Exploration Presentation
 
Organizational Transformation Lead with Culture
Organizational Transformation Lead with CultureOrganizational Transformation Lead with Culture
Organizational Transformation Lead with Culture
 
HomeRoots Pitch Deck | Investor Insights | April 2024
HomeRoots Pitch Deck | Investor Insights | April 2024HomeRoots Pitch Deck | Investor Insights | April 2024
HomeRoots Pitch Deck | Investor Insights | April 2024
 
CROSS CULTURAL NEGOTIATION BY PANMISEM NS
CROSS CULTURAL NEGOTIATION BY PANMISEM NSCROSS CULTURAL NEGOTIATION BY PANMISEM NS
CROSS CULTURAL NEGOTIATION BY PANMISEM NS
 
Berhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
Berhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDINGBerhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
Berhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
 
Nashik Call Girl Just Call 7091819311 Top Class Call Girl Service Available
Nashik Call Girl Just Call 7091819311 Top Class Call Girl Service AvailableNashik Call Girl Just Call 7091819311 Top Class Call Girl Service Available
Nashik Call Girl Just Call 7091819311 Top Class Call Girl Service Available
 
QSM Chap 10 Service Culture in Tourism and Hospitality Industry.pptx
QSM Chap 10 Service Culture in Tourism and Hospitality Industry.pptxQSM Chap 10 Service Culture in Tourism and Hospitality Industry.pptx
QSM Chap 10 Service Culture in Tourism and Hospitality Industry.pptx
 

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