SlideShare a Scribd company logo
Database Group, Georgia Tech
© Leo Mark 1SQL
SQL
- intergalactic dataspeak
[Stonebraker]
Database Group, Georgia Tech
© Leo Mark 2SQL
History of SQL
• SQL: Structured Query Language
• SQL is based on the relational tuple
calculus
• SEQUEL: Structured English QUEry
Language; part of SYSTEM R, 1974
• SQL/86: ANSI & ISO standard
• SQL/89: ANSI & ISO standard
• SQL/92 or SQL2: ANSI & ISO standard
• SQL3: in the works...
• SQL2 supported by ORACLE,
SYBASE, INFORMIX, IBM DB2, SQL
SERVER, OPENINGRES,...
Database Group, Georgia Tech
© Leo Mark 3SQL
SQL
SQL consists of the following parts:
• Data Definition Language (DDL)
• Interactive Data Manipulation
Language (Interactive DML)
• Embedded Data Manipulation
Language (Embedded DML)
• Views
• Integrity
• Transaction Control
• Authorization
• Catalog and Dictionary Facilities
Database Group, Georgia Tech
© Leo Mark 4SQL
FLT-SCHEDULE
FLT-INSTANCE
FLT-WEEKDAY
AIRPLANE
CUSTOMER
flt# date plane#
RESERVATION
flt# airline dtime from-airportcode atime to-airportcode miles price
flt# weekday
plane# plane-type total-#seats
cust# first middle last phone# street city state zip
flt# date cust# seat# check-in-status ticket#
AIRPORT
airportcode name city state
#avail-seats
Database Group, Georgia Tech
© Leo Mark 5SQL
DDL - Overview
• primitive types
• domains
• schema
• tables
Database Group, Georgia Tech
© Leo Mark 6SQL
DDL - Primitive Types
• numeric
– INTEGER (or INT), SMALLINT are subsets of
the integers (machine dependent)
– REAL, DOUBLE PRECISION are floating-point
and double-precision floating-point
(machine dependent)
– FLOAT(N) is floating-point with at least N
digits
– DECIMAL(P,D) (or DEC(P,D), or NUMERIC(P,D)),
with P digits of which D are to the right
of the decimal point
Database Group, Georgia Tech
© Leo Mark 6SQL
DDL - Primitive Types
• numeric
– INTEGER (or INT), SMALLINT are subsets of
the integers (machine dependent)
– REAL, DOUBLE PRECISION are floating-point
and double-precision floating-point
(machine dependent)
– FLOAT(N) is floating-point with at least N
digits
– DECIMAL(P,D) (or DEC(P,D), or NUMERIC(P,D)),
with P digits of which D are to the right
of the decimal point

More Related Content

Similar to Sql tutorial

Ora 4 the_sqldba
Ora 4 the_sqldbaOra 4 the_sqldba
Ora 4 the_sqldba
Kellyn Pot'Vin-Gorman
 
Ajay_oracle dba
Ajay_oracle dbaAjay_oracle dba
Ajay_oracle dba
ajay pat
 
Test labs 2016. Тестирование data warehouse
Test labs 2016. Тестирование data warehouse Test labs 2016. Тестирование data warehouse
Test labs 2016. Тестирование data warehouse
Sasha Soleev
 
Apex ace update
Apex ace updateApex ace update
Apex ace update
Ayesha Fayyaz
 
Rohit_Panot
Rohit_PanotRohit_Panot
Rohit_Panot
Rohit Panot
 
Oracle DB
Oracle DBOracle DB
Pl sql content
Pl sql contentPl sql content
Pl sql content
MargaretMaryT
 
SURENDRA KUMAR_MADDI_Latest_Resume
SURENDRA KUMAR_MADDI_Latest_ResumeSURENDRA KUMAR_MADDI_Latest_Resume
SURENDRA KUMAR_MADDI_Latest_Resume
Surendra Maddi
 
Sql server difference faqs- 6
Sql server difference faqs- 6Sql server difference faqs- 6
Sql server difference faqs- 6
Umar Ali
 
Overview of Oracle Product Portfolio (focus on Platform) - April, 2017
Overview of Oracle Product Portfolio (focus on Platform) - April, 2017Overview of Oracle Product Portfolio (focus on Platform) - April, 2017
Overview of Oracle Product Portfolio (focus on Platform) - April, 2017
Lucas Jellema
 
Rajnish singh(presentation on oracle )
Rajnish singh(presentation on  oracle )Rajnish singh(presentation on  oracle )
Rajnish singh(presentation on oracle )
Rajput Rajnish
 
agimbleSum1
agimbleSum1agimbleSum1
agimbleSum1
Avery Gimble
 
Veera Narayanaswamy_PLSQL_Profile
Veera Narayanaswamy_PLSQL_ProfileVeera Narayanaswamy_PLSQL_Profile
Veera Narayanaswamy_PLSQL_Profile
Veera Narayanaswamy M
 
SamBarrie_Primaryvzt
SamBarrie_PrimaryvztSamBarrie_Primaryvzt
SamBarrie_Primaryvzt
Sam Barrie
 
vikram ch resume
vikram ch resumevikram ch resume
vikram ch resume
vikram cherukuri
 
A practical introduction to Oracle NoSQL Database - OOW2014
A practical introduction to Oracle NoSQL Database - OOW2014A practical introduction to Oracle NoSQL Database - OOW2014
A practical introduction to Oracle NoSQL Database - OOW2014
Anuj Sahni
 
Velappan_Manoharan
Velappan_ManoharanVelappan_Manoharan
Velappan_Manoharan
Velappan Manoharan
 
Velappan_Manoharan
Velappan_ManoharanVelappan_Manoharan
Velappan_Manoharan
Velappan Manoharan
 
Hi I need security-related job points for the software develope.docx
Hi I need security-related job points for the software develope.docxHi I need security-related job points for the software develope.docx
Hi I need security-related job points for the software develope.docx
fideladallimore
 
Presenter manual oracle dba (specially for summer interns)
Presenter manual oracle dba (specially for summer interns)Presenter manual oracle dba (specially for summer interns)
Presenter manual oracle dba (specially for summer interns)
XPERT INFOTECH
 

Similar to Sql tutorial (20)

Ora 4 the_sqldba
Ora 4 the_sqldbaOra 4 the_sqldba
Ora 4 the_sqldba
 
Ajay_oracle dba
Ajay_oracle dbaAjay_oracle dba
Ajay_oracle dba
 
Test labs 2016. Тестирование data warehouse
Test labs 2016. Тестирование data warehouse Test labs 2016. Тестирование data warehouse
Test labs 2016. Тестирование data warehouse
 
Apex ace update
Apex ace updateApex ace update
Apex ace update
 
Rohit_Panot
Rohit_PanotRohit_Panot
Rohit_Panot
 
Oracle DB
Oracle DBOracle DB
Oracle DB
 
Pl sql content
Pl sql contentPl sql content
Pl sql content
 
SURENDRA KUMAR_MADDI_Latest_Resume
SURENDRA KUMAR_MADDI_Latest_ResumeSURENDRA KUMAR_MADDI_Latest_Resume
SURENDRA KUMAR_MADDI_Latest_Resume
 
Sql server difference faqs- 6
Sql server difference faqs- 6Sql server difference faqs- 6
Sql server difference faqs- 6
 
Overview of Oracle Product Portfolio (focus on Platform) - April, 2017
Overview of Oracle Product Portfolio (focus on Platform) - April, 2017Overview of Oracle Product Portfolio (focus on Platform) - April, 2017
Overview of Oracle Product Portfolio (focus on Platform) - April, 2017
 
Rajnish singh(presentation on oracle )
Rajnish singh(presentation on  oracle )Rajnish singh(presentation on  oracle )
Rajnish singh(presentation on oracle )
 
agimbleSum1
agimbleSum1agimbleSum1
agimbleSum1
 
Veera Narayanaswamy_PLSQL_Profile
Veera Narayanaswamy_PLSQL_ProfileVeera Narayanaswamy_PLSQL_Profile
Veera Narayanaswamy_PLSQL_Profile
 
SamBarrie_Primaryvzt
SamBarrie_PrimaryvztSamBarrie_Primaryvzt
SamBarrie_Primaryvzt
 
vikram ch resume
vikram ch resumevikram ch resume
vikram ch resume
 
A practical introduction to Oracle NoSQL Database - OOW2014
A practical introduction to Oracle NoSQL Database - OOW2014A practical introduction to Oracle NoSQL Database - OOW2014
A practical introduction to Oracle NoSQL Database - OOW2014
 
Velappan_Manoharan
Velappan_ManoharanVelappan_Manoharan
Velappan_Manoharan
 
Velappan_Manoharan
Velappan_ManoharanVelappan_Manoharan
Velappan_Manoharan
 
Hi I need security-related job points for the software develope.docx
Hi I need security-related job points for the software develope.docxHi I need security-related job points for the software develope.docx
Hi I need security-related job points for the software develope.docx
 
Presenter manual oracle dba (specially for summer interns)
Presenter manual oracle dba (specially for summer interns)Presenter manual oracle dba (specially for summer interns)
Presenter manual oracle dba (specially for summer interns)
 

Recently uploaded

GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 

Recently uploaded (20)

GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 

Sql tutorial

  • 1. Database Group, Georgia Tech © Leo Mark 1SQL SQL - intergalactic dataspeak [Stonebraker]
  • 2. Database Group, Georgia Tech © Leo Mark 2SQL History of SQL • SQL: Structured Query Language • SQL is based on the relational tuple calculus • SEQUEL: Structured English QUEry Language; part of SYSTEM R, 1974 • SQL/86: ANSI & ISO standard • SQL/89: ANSI & ISO standard • SQL/92 or SQL2: ANSI & ISO standard • SQL3: in the works... • SQL2 supported by ORACLE, SYBASE, INFORMIX, IBM DB2, SQL SERVER, OPENINGRES,...
  • 3. Database Group, Georgia Tech © Leo Mark 3SQL SQL SQL consists of the following parts: • Data Definition Language (DDL) • Interactive Data Manipulation Language (Interactive DML) • Embedded Data Manipulation Language (Embedded DML) • Views • Integrity • Transaction Control • Authorization • Catalog and Dictionary Facilities
  • 4. Database Group, Georgia Tech © Leo Mark 4SQL FLT-SCHEDULE FLT-INSTANCE FLT-WEEKDAY AIRPLANE CUSTOMER flt# date plane# RESERVATION flt# airline dtime from-airportcode atime to-airportcode miles price flt# weekday plane# plane-type total-#seats cust# first middle last phone# street city state zip flt# date cust# seat# check-in-status ticket# AIRPORT airportcode name city state #avail-seats
  • 5. Database Group, Georgia Tech © Leo Mark 5SQL DDL - Overview • primitive types • domains • schema • tables
  • 6. Database Group, Georgia Tech © Leo Mark 6SQL DDL - Primitive Types • numeric – INTEGER (or INT), SMALLINT are subsets of the integers (machine dependent) – REAL, DOUBLE PRECISION are floating-point and double-precision floating-point (machine dependent) – FLOAT(N) is floating-point with at least N digits – DECIMAL(P,D) (or DEC(P,D), or NUMERIC(P,D)), with P digits of which D are to the right of the decimal point
  • 7. Database Group, Georgia Tech © Leo Mark 6SQL DDL - Primitive Types • numeric – INTEGER (or INT), SMALLINT are subsets of the integers (machine dependent) – REAL, DOUBLE PRECISION are floating-point and double-precision floating-point (machine dependent) – FLOAT(N) is floating-point with at least N digits – DECIMAL(P,D) (or DEC(P,D), or NUMERIC(P,D)), with P digits of which D are to the right of the decimal point