SlideShare a Scribd company logo
3
Most read
4
Most read
5
Most read
Introduction to SQL
Ram Kedem
Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent
Objectives
• Defining SQL
• Why do we need to use it ?
• Pronouncing SQL: S-Q-L or Sequel?
• Standard SQL and language adjustments
• Types of SQL Statements
• Basic column data types in MSSQL
Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent
Defining SQL
• Structured Query Language
• Allows users to communicate with Relational Databases and
retrieve data from their tables.
SQL
RDBMS
Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent
Pronouncing : S-Q-L or Sequel?
• SQL was developed at IBM and it was initially called
“Structured English Query Language” (SEQUEL) and
pronounced “sequel”
• Later it was shortened to SQL - “Structured Query Language”
• Both pronunciations are correct
Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent
Standard SQL and
Language Extensions
• The RDBMS model was implemented by many vendors –
• Microsoft (SQL Server), Oracle, IBM (DB2), MySQL, Postgres, etc.
• SQL is the language each of those vendors use in order to
access and manipulate their databases
• In most cases all vendors use the same SQL command in order
to achieve the same goal. In some cases vendors will use
specific SQL extention that will only work under their
platform.
Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent
Standard SQL and
Language Extensions
• Same statement to retrieve data of one column
• SELECT lastName FROM employees
• Different statement to concatencate strings
• SELECT 'hello' + 'world' (SQL Server)
• SELECT 'hello' || 'world' (Oracle)
Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent
Types of SQL Statements
• Data Manipulation Language (DML) statements are used for
managing data within schema objects. For example :
• SELECT - retrieve data from the a database
• INSERT - insert data into a table
• UPDATE - updates existing data within a table
• DELETE – delete existing rows
• Data Definition Language (DDL) statements are used to define the
database structure or schema. For example :
• CREATE - to create objects in the database
• DROP - delete objects from the database
• Data Control Language (DCL) statements. For example :
• GRANT - gives user's access privileges to database
• REVOKE - withdraw access privileges given with the GRANT
command
Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent
Basic column data types
• Numeric columns
• INT - Integer (whole number) data value
• Money - Numeric data types with fixed precision and scale
Product id
(int)
Product price
(numeric)
Product name
(varchar(25))
Experation
(date)
1 53.3 Product1 2014/03/22
2 23.1 Product2 2014/02/21
3 32.3 Product3 2014/03/02
Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent
Basic column data types
• Numeric columns
• INT - Integer (whole number) data value
• Money - Monetary or currency values String columns
• VARCHAR(N) – String data
• Date columns
• DATE – date data
Product id
(int)
Product price
(money)
Product name
(varchar(25))
Experation
(date)
1 53.3 Product1 2014/03/22
2 23.1 Product2 2014/02/21
3 32.3 Product3 2014/03/02
Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent
Essential Points
• SQL is the language we use in order to communicate with the
RDBMS
• Although in most cases vendors use the same SQL command,
in some cases the SQL command might be different
• There are different categories to the SQL language, and each is
responsible on different aspect
• There are many different available data types is MSSQL Server,
most basic columns are Int, Money, Varchar and Date.

More Related Content

PPTX
Erp ppt
ZIP
NoSQL databases
PDF
Recommender system algorithm and architecture
PDF
Innovation and Entrepreneurship
PPTX
Competency Mapping in Banking Sector in India
PPT
Introduction to Microsoft Excel for beginners
PPTX
PPT
Sql Tutorials
Erp ppt
NoSQL databases
Recommender system algorithm and architecture
Innovation and Entrepreneurship
Competency Mapping in Banking Sector in India
Introduction to Microsoft Excel for beginners
Sql Tutorials

What's hot (20)

PDF
Introduction to Databases
PPTX
SQL commands
PPTX
SQL JOIN
PPTX
SQL - Structured query language introduction
PPTX
SQL(DDL & DML)
PPT
SQL Queries
PPTX
introdution to SQL and SQL functions
PPTX
Chapter 1 introduction to sql server
PPTX
Basic SQL and History
PPTX
Introduction to database & sql
PPTX
SQL Basics
PPTX
SQL Commands
PPTX
Ibm db2
PPT
Mysql
PPT
Introduction to-sql
PPTX
SQL - DML and DDL Commands
PPTX
Sql queries presentation
PPTX
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
PPTX
SQL Queries Information
Introduction to Databases
SQL commands
SQL JOIN
SQL - Structured query language introduction
SQL(DDL & DML)
SQL Queries
introdution to SQL and SQL functions
Chapter 1 introduction to sql server
Basic SQL and History
Introduction to database & sql
SQL Basics
SQL Commands
Ibm db2
Mysql
Introduction to-sql
SQL - DML and DDL Commands
Sql queries presentation
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
SQL Queries Information
Ad

Similar to Introduction to SQL (20)

PDF
Data Warehouse Design Considerations
PPTX
Using Basic Structured Query Language lo1.pptx
PDF
2 designing tables
PPTX
U-SQL - Azure Data Lake Analytics for Developers
PDF
SQL-Server Database.pdf
PPTX
SQL Server Workshop for Developers - Visual Studio Live! NY 2012
PPTX
SQl-1.pptx
PPTX
Querying_with_T-SQL_-_01.pptx
PDF
SQL - RDBMS Concepts
PPTX
SQL Server 2008 For Developers
PPTX
The SQL Query Language: Simple SELECT Commands
PPTX
Database part2-
PDF
Jason Olson - IBM i DB2 Modernization to SQL
PPTX
SQL 3.pptx
PPTX
Query editor for multi databases
PPTX
U-SQL Intro (SQLBits 2016)
PPTX
Chapter 2: Ms SQL Server
PPTX
CSE311_IAH_Slide06_SQL _Retrival_Queries.pptx
PDF
SQL Intro
Data Warehouse Design Considerations
Using Basic Structured Query Language lo1.pptx
2 designing tables
U-SQL - Azure Data Lake Analytics for Developers
SQL-Server Database.pdf
SQL Server Workshop for Developers - Visual Studio Live! NY 2012
SQl-1.pptx
Querying_with_T-SQL_-_01.pptx
SQL - RDBMS Concepts
SQL Server 2008 For Developers
The SQL Query Language: Simple SELECT Commands
Database part2-
Jason Olson - IBM i DB2 Modernization to SQL
SQL 3.pptx
Query editor for multi databases
U-SQL Intro (SQLBits 2016)
Chapter 2: Ms SQL Server
CSE311_IAH_Slide06_SQL _Retrival_Queries.pptx
SQL Intro
Ad

More from Ram Kedem (20)

PDF
Impala use case @ edge
PPTX
Advanced SQL Webinar
PPTX
Managing oracle Database Instance
PDF
Power Pivot and Power View
PDF
Data Mining in SSAS
PDF
Data mining In SSAS
PPTX
SQL Injections - Oracle
PDF
SSAS Attributes
PDF
SSRS Matrix
PDF
DDL Practice (Hebrew)
PDF
DML Practice (Hebrew)
PDF
Exploring Oracle Database Architecture (Hebrew)
PDF
Deploy SSRS Project - SQL Server 2014
PDF
Pig - Processing XML data
PDF
SSAS Cubes & Hierarchies
PDF
SSRS Basic Parameters
PPTX
SSRS Gauges
PDF
SSRS Conditional Formatting
PDF
SSRS Calculated Fields
PDF
SSRS Groups
Impala use case @ edge
Advanced SQL Webinar
Managing oracle Database Instance
Power Pivot and Power View
Data Mining in SSAS
Data mining In SSAS
SQL Injections - Oracle
SSAS Attributes
SSRS Matrix
DDL Practice (Hebrew)
DML Practice (Hebrew)
Exploring Oracle Database Architecture (Hebrew)
Deploy SSRS Project - SQL Server 2014
Pig - Processing XML data
SSAS Cubes & Hierarchies
SSRS Basic Parameters
SSRS Gauges
SSRS Conditional Formatting
SSRS Calculated Fields
SSRS Groups

Recently uploaded (20)

PPTX
TLE Review Electricity (Electricity).pptx
PPTX
Spectroscopy.pptx food analysis technology
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Empathic Computing: Creating Shared Understanding
PDF
Approach and Philosophy of On baking technology
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPT
Teaching material agriculture food technology
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
Encapsulation theory and applications.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
OMC Textile Division Presentation 2021.pptx
TLE Review Electricity (Electricity).pptx
Spectroscopy.pptx food analysis technology
A comparative analysis of optical character recognition models for extracting...
Empathic Computing: Creating Shared Understanding
Approach and Philosophy of On baking technology
Assigned Numbers - 2025 - Bluetooth® Document
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Teaching material agriculture food technology
SOPHOS-XG Firewall Administrator PPT.pptx
Encapsulation theory and applications.pdf
Programs and apps: productivity, graphics, security and other tools
Digital-Transformation-Roadmap-for-Companies.pptx
Heart disease approach using modified random forest and particle swarm optimi...
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Reach Out and Touch Someone: Haptics and Empathic Computing
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
OMC Textile Division Presentation 2021.pptx

Introduction to SQL

  • 2. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent Objectives • Defining SQL • Why do we need to use it ? • Pronouncing SQL: S-Q-L or Sequel? • Standard SQL and language adjustments • Types of SQL Statements • Basic column data types in MSSQL
  • 3. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent Defining SQL • Structured Query Language • Allows users to communicate with Relational Databases and retrieve data from their tables. SQL RDBMS
  • 4. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent Pronouncing : S-Q-L or Sequel? • SQL was developed at IBM and it was initially called “Structured English Query Language” (SEQUEL) and pronounced “sequel” • Later it was shortened to SQL - “Structured Query Language” • Both pronunciations are correct
  • 5. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent Standard SQL and Language Extensions • The RDBMS model was implemented by many vendors – • Microsoft (SQL Server), Oracle, IBM (DB2), MySQL, Postgres, etc. • SQL is the language each of those vendors use in order to access and manipulate their databases • In most cases all vendors use the same SQL command in order to achieve the same goal. In some cases vendors will use specific SQL extention that will only work under their platform.
  • 6. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent Standard SQL and Language Extensions • Same statement to retrieve data of one column • SELECT lastName FROM employees • Different statement to concatencate strings • SELECT 'hello' + 'world' (SQL Server) • SELECT 'hello' || 'world' (Oracle)
  • 7. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent Types of SQL Statements • Data Manipulation Language (DML) statements are used for managing data within schema objects. For example : • SELECT - retrieve data from the a database • INSERT - insert data into a table • UPDATE - updates existing data within a table • DELETE – delete existing rows • Data Definition Language (DDL) statements are used to define the database structure or schema. For example : • CREATE - to create objects in the database • DROP - delete objects from the database • Data Control Language (DCL) statements. For example : • GRANT - gives user's access privileges to database • REVOKE - withdraw access privileges given with the GRANT command
  • 8. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent Basic column data types • Numeric columns • INT - Integer (whole number) data value • Money - Numeric data types with fixed precision and scale Product id (int) Product price (numeric) Product name (varchar(25)) Experation (date) 1 53.3 Product1 2014/03/22 2 23.1 Product2 2014/02/21 3 32.3 Product3 2014/03/02
  • 9. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent Basic column data types • Numeric columns • INT - Integer (whole number) data value • Money - Monetary or currency values String columns • VARCHAR(N) – String data • Date columns • DATE – date data Product id (int) Product price (money) Product name (varchar(25)) Experation (date) 1 53.3 Product1 2014/03/22 2 23.1 Product2 2014/02/21 3 32.3 Product3 2014/03/02
  • 10. Copyright 2014 © Ram Kedem. All rights reserved. Not to be reproduced without written consent Essential Points • SQL is the language we use in order to communicate with the RDBMS • Although in most cases vendors use the same SQL command, in some cases the SQL command might be different • There are different categories to the SQL language, and each is responsible on different aspect • There are many different available data types is MSSQL Server, most basic columns are Int, Money, Varchar and Date.