SlideShare une entreprise Scribd logo
1  sur  25
Introduction to
SQL
UNIVERSITY OF TEHRAN
NOVEMBER, 2016
What is SQL?
 Structured Query Language
 SQL is Structured Query Language, which is a
computer language for storing, manipulating and
retrieving data stored in relational database.
 SQL is the standard language for Relation Database
System. All relational database management systems
like “MySQL, MS Access, Oracle, Sybase, Informix,
postgres and SQL Server” use SQL as standard
database language.
SQL Commands
 DDL - Data Definition Language
 DML - Data Manipulation Language
 DCL - Data Control Language
 DQL - Data Query Language
SQL Commands
SQL Commands
SQL RDBMS Concepts
 TABLE
 RECORD
 COLUMN
 CELL
 NULL?
SQL RDBMS Concepts
 SQL Constraints: (applied on columns)
 NOT NULL Constraint
 UNIQUE Constraint
 PRIMARY Key
 FOREIGN Key
 CHECK Constraint
 Data Integrity:
 Entity Integrity: There are no duplicate rows in a table
 Domain Integrity: Enforces valid entries for a given column by
restricting the type
 Referential Integrity: Rows cannot be deleted which are used by
other records
 User-Defined Integrity: Enforces some specific business rules
SQL RDBMS Concepts
 Data Types:
 Character datatypes:
 CHAR
 NCHAR
 NVARCHAR2
 VARCHAR2
 Numeric datatypes:
 NUMBER
 BINARY_FLOAT
 BINARY_DOUBLE
 Date time datatype:
 DATE
DCL: CREATE USER
 1) Define User with Username/Password
 2) Grants Sufficient Privileges.
 Using SQL Developer (UI, Command)
 Using SQL *PLUS (Command)
SQL : DDL
 Create Table:
 COLUMNS
 CONSTRAINTS
SQL: DDL
 DROP TABLE:
 ALTER TABLE
 OTHER DDL COMMANDS!!!!
SQL: DML: INSERT
 INSERT INTO:
 NUMBER, CHAR/VARCHAR2, DATE?
SQL: DML: INSERT
 INSERT INTO:
 SPECIFIC COLUMNS
SQL: DML: INSERT
 INSERT INTO:
 FOREIGN KEY
 ALL DML COMMANDS NEED COMMIT
SQL: DML: UPDATE
 UPDATE
 WHERE CLAUSE
SQL: DML: DELETE
 DELETE (DELETE VS DROP????)
HR-Schema
SQL: DQL: SELECT
 SELECT
 *
 SPECIFIC COLUMNS
SQL: DQL: SELECT
 DISTINCT CLUASE
SQL: DQL: SELECT
 WHERE CLUASE
SQL: DQL: SELECT
 IN CLUASE
 NOT IN
 NULL IN WHERE?
 IS NULL
 IS NOT NULL
SQL: DQL: SELECT
 ORDER BY
SQL: DQL: SELECT
 GROUP BY
 AGGREGATE FUCTION
 MAX,MIN
 AVG
 COUNT
 SUM
 …
 HAVING CLAUSE
SQL: DQL: SELECT
 SELECT FROM MULTIPLE TABLES
 CARTESIAN MULTIPICATION
 JOIN
About Me
 Ehsan Hamzei
 Graduate Student of Geospatial Information System
 University of Tehran
 Git-Hub: https://github.com/ehsan-hamzei/
 Source-Codes: https://github.com/ehsan-
hamzei/Oracle-SQL/

Contenu connexe

Tendances (20)

Sql queries presentation
Sql queries presentationSql queries presentation
Sql queries presentation
 
PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts
 
1 - Introduction to PL/SQL
1 - Introduction to PL/SQL1 - Introduction to PL/SQL
1 - Introduction to PL/SQL
 
Ms sql-server
Ms sql-serverMs sql-server
Ms sql-server
 
SQL - RDBMS Concepts
SQL - RDBMS ConceptsSQL - RDBMS Concepts
SQL - RDBMS Concepts
 
Structured Query Language (SQL)
Structured Query Language (SQL)Structured Query Language (SQL)
Structured Query Language (SQL)
 
SQL Queries Information
SQL Queries InformationSQL Queries Information
SQL Queries Information
 
Rdbms
RdbmsRdbms
Rdbms
 
PL/SQL TRIGGERS
PL/SQL TRIGGERSPL/SQL TRIGGERS
PL/SQL TRIGGERS
 
MYSQL.ppt
MYSQL.pptMYSQL.ppt
MYSQL.ppt
 
Introduction to Oracle Database
Introduction to Oracle DatabaseIntroduction to Oracle Database
Introduction to Oracle Database
 
Working with Databases and MySQL
Working with Databases and MySQLWorking with Databases and MySQL
Working with Databases and MySQL
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Oracle SQL Basics
Oracle SQL BasicsOracle SQL Basics
Oracle SQL Basics
 
Data types in python
Data types in pythonData types in python
Data types in python
 
Integrity Constraints
Integrity ConstraintsIntegrity Constraints
Integrity Constraints
 
Data Models
Data ModelsData Models
Data Models
 
Dbms relational model
Dbms relational modelDbms relational model
Dbms relational model
 
Relational algebra ppt
Relational algebra pptRelational algebra ppt
Relational algebra ppt
 
Basic SQL and History
 Basic SQL and History Basic SQL and History
Basic SQL and History
 

En vedette

SQL Tutorial - Basic Commands
SQL Tutorial - Basic CommandsSQL Tutorial - Basic Commands
SQL Tutorial - Basic Commands1keydata
 
Memory dbms
Memory dbmsMemory dbms
Memory dbmsTech_MX
 
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...Beat Signer
 
SQL Server 2008 Overview
SQL Server 2008 OverviewSQL Server 2008 Overview
SQL Server 2008 OverviewEric Nelson
 
Introduction to database & sql
Introduction to database & sqlIntroduction to database & sql
Introduction to database & sqlzahid6
 
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
 
ITCamp 2013 - Cristian Lefter - Transact-SQL from 0 to SQL Server 2012
ITCamp 2013 - Cristian Lefter - Transact-SQL from 0 to SQL Server 2012ITCamp 2013 - Cristian Lefter - Transact-SQL from 0 to SQL Server 2012
ITCamp 2013 - Cristian Lefter - Transact-SQL from 0 to SQL Server 2012ITCamp
 
Whats New Sql Server 2008 R2
Whats New Sql Server 2008 R2Whats New Sql Server 2008 R2
Whats New Sql Server 2008 R2Eduardo Castro
 
Android App Development Tips for Beginners
Android App Development Tips for BeginnersAndroid App Development Tips for Beginners
Android App Development Tips for BeginnersZoftino
 
SQL Server 2008 Overview
SQL Server 2008 OverviewSQL Server 2008 Overview
SQL Server 2008 OverviewDavid Chou
 
Part 7 ddl dan dml lant..retriving data up
Part 7  ddl dan dml lant..retriving data upPart 7  ddl dan dml lant..retriving data up
Part 7 ddl dan dml lant..retriving data upDenny Yahya
 
Fundamentals of database system - Database System Concepts and Architecture
Fundamentals of database system - Database System Concepts and ArchitectureFundamentals of database system - Database System Concepts and Architecture
Fundamentals of database system - Database System Concepts and ArchitectureMustafa Kamel Mohammadi
 
retrieving data using SQL statements
retrieving data using SQL statementsretrieving data using SQL statements
retrieving data using SQL statementsArun Nair
 

En vedette (20)

Introduction to-sql
Introduction to-sqlIntroduction to-sql
Introduction to-sql
 
SQL Tutorial - Basic Commands
SQL Tutorial - Basic CommandsSQL Tutorial - Basic Commands
SQL Tutorial - Basic Commands
 
Dbms slides
Dbms slidesDbms slides
Dbms slides
 
Memory dbms
Memory dbmsMemory dbms
Memory dbms
 
SQL : introduction
SQL : introductionSQL : introduction
SQL : introduction
 
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
Structured Query Language (SQL) - Lecture 5 - Introduction to Databases (1007...
 
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with ExamplesDML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
DML, DDL, DCL ,DRL/DQL and TCL Statements in SQL with Examples
 
SQL Server 2008 Overview
SQL Server 2008 OverviewSQL Server 2008 Overview
SQL Server 2008 Overview
 
Introduction to database & sql
Introduction to database & sqlIntroduction to database & sql
Introduction to database & 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)
 
ITCamp 2013 - Cristian Lefter - Transact-SQL from 0 to SQL Server 2012
ITCamp 2013 - Cristian Lefter - Transact-SQL from 0 to SQL Server 2012ITCamp 2013 - Cristian Lefter - Transact-SQL from 0 to SQL Server 2012
ITCamp 2013 - Cristian Lefter - Transact-SQL from 0 to SQL Server 2012
 
Whats New Sql Server 2008 R2
Whats New Sql Server 2008 R2Whats New Sql Server 2008 R2
Whats New Sql Server 2008 R2
 
Data manipulation language
Data  manipulation languageData  manipulation language
Data manipulation language
 
Normalization,ddl,dml,dcl
Normalization,ddl,dml,dclNormalization,ddl,dml,dcl
Normalization,ddl,dml,dcl
 
Android App Development Tips for Beginners
Android App Development Tips for BeginnersAndroid App Development Tips for Beginners
Android App Development Tips for Beginners
 
SQL Server 2008 Overview
SQL Server 2008 OverviewSQL Server 2008 Overview
SQL Server 2008 Overview
 
Part 7 ddl dan dml lant..retriving data up
Part 7  ddl dan dml lant..retriving data upPart 7  ddl dan dml lant..retriving data up
Part 7 ddl dan dml lant..retriving data up
 
Fundamentals of database system - Database System Concepts and Architecture
Fundamentals of database system - Database System Concepts and ArchitectureFundamentals of database system - Database System Concepts and Architecture
Fundamentals of database system - Database System Concepts and Architecture
 
DDL DML sysytems
DDL DML sysytemsDDL DML sysytems
DDL DML sysytems
 
retrieving data using SQL statements
retrieving data using SQL statementsretrieving data using SQL statements
retrieving data using SQL statements
 

Similaire à Introduction to SQL (20)

SQL .pptx
SQL .pptxSQL .pptx
SQL .pptx
 
SQL2.pptx
SQL2.pptxSQL2.pptx
SQL2.pptx
 
Structured Query Language
Structured Query LanguageStructured Query Language
Structured Query Language
 
SQL 3.pptx
SQL 3.pptxSQL 3.pptx
SQL 3.pptx
 
Introduction to Database SQL & PL/SQL
Introduction to Database SQL & PL/SQLIntroduction to Database SQL & PL/SQL
Introduction to Database SQL & PL/SQL
 
SQL
SQLSQL
SQL
 
Structured query language
Structured query languageStructured query language
Structured query language
 
Introduction to SQL.pptx
Introduction to SQL.pptxIntroduction to SQL.pptx
Introduction to SQL.pptx
 
SQL Introduction.pptx
SQL Introduction.pptxSQL Introduction.pptx
SQL Introduction.pptx
 
Sql database development part 1
Sql database development part 1Sql database development part 1
Sql database development part 1
 
lovely
lovelylovely
lovely
 
Sq lite module5
Sq lite module5Sq lite module5
Sq lite module5
 
MySQL intro
MySQL introMySQL intro
MySQL intro
 
MySQL intro
MySQL introMySQL intro
MySQL intro
 
SQL overview and software
SQL overview and softwareSQL overview and software
SQL overview and software
 
Sql tutorial
Sql tutorialSql tutorial
Sql tutorial
 
SQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics CoveredSQL Complete Tutorial. All Topics Covered
SQL Complete Tutorial. All Topics Covered
 
Database Fundamental
Database FundamentalDatabase Fundamental
Database Fundamental
 
DBMS Part-3.pptx
DBMS Part-3.pptxDBMS Part-3.pptx
DBMS Part-3.pptx
 
Lab
LabLab
Lab
 

Plus de Ehsan Hamzei

Database Normalization
Database NormalizationDatabase Normalization
Database NormalizationEhsan Hamzei
 
Introduction to Oracle Spatial
Introduction to Oracle SpatialIntroduction to Oracle Spatial
Introduction to Oracle SpatialEhsan Hamzei
 
Introduction to oracle DB data structure and data access (persian)
Introduction to oracle DB data structure and data access (persian)Introduction to oracle DB data structure and data access (persian)
Introduction to oracle DB data structure and data access (persian)Ehsan Hamzei
 
Arc GIS Overlay Functions
Arc GIS Overlay FunctionsArc GIS Overlay Functions
Arc GIS Overlay FunctionsEhsan Hamzei
 
Air pollution Assessment (GIS,RS Approach)
Air pollution Assessment (GIS,RS Approach)Air pollution Assessment (GIS,RS Approach)
Air pollution Assessment (GIS,RS Approach)Ehsan Hamzei
 
Bluetooth Positioning
Bluetooth PositioningBluetooth Positioning
Bluetooth PositioningEhsan Hamzei
 
Oracle Data Integrator (persian)
Oracle Data Integrator (persian)Oracle Data Integrator (persian)
Oracle Data Integrator (persian)Ehsan Hamzei
 
Introduction to oracle
Introduction to oracleIntroduction to oracle
Introduction to oracleEhsan Hamzei
 
Spatial queries entity recognition and disambiguation
Spatial queries entity recognition and disambiguationSpatial queries entity recognition and disambiguation
Spatial queries entity recognition and disambiguationEhsan Hamzei
 
Uncertainty in Geospatial Data
Uncertainty in Geospatial DataUncertainty in Geospatial Data
Uncertainty in Geospatial DataEhsan Hamzei
 
Spatial Autocorrelation
Spatial AutocorrelationSpatial Autocorrelation
Spatial AutocorrelationEhsan Hamzei
 
Spatial Transformation
Spatial TransformationSpatial Transformation
Spatial TransformationEhsan Hamzei
 
Introduction to GIS
Introduction to GISIntroduction to GIS
Introduction to GISEhsan Hamzei
 
DTM Quality Assessment
DTM Quality AssessmentDTM Quality Assessment
DTM Quality AssessmentEhsan Hamzei
 

Plus de Ehsan Hamzei (19)

Database Normalization
Database NormalizationDatabase Normalization
Database Normalization
 
Introduction to Oracle Spatial
Introduction to Oracle SpatialIntroduction to Oracle Spatial
Introduction to Oracle Spatial
 
Introduction to oracle DB data structure and data access (persian)
Introduction to oracle DB data structure and data access (persian)Introduction to oracle DB data structure and data access (persian)
Introduction to oracle DB data structure and data access (persian)
 
Arc GIS Overlay Functions
Arc GIS Overlay FunctionsArc GIS Overlay Functions
Arc GIS Overlay Functions
 
Air pollution Assessment (GIS,RS Approach)
Air pollution Assessment (GIS,RS Approach)Air pollution Assessment (GIS,RS Approach)
Air pollution Assessment (GIS,RS Approach)
 
Bluetooth Positioning
Bluetooth PositioningBluetooth Positioning
Bluetooth Positioning
 
Oracle Data Integrator (persian)
Oracle Data Integrator (persian)Oracle Data Integrator (persian)
Oracle Data Integrator (persian)
 
Introduction to oracle
Introduction to oracleIntroduction to oracle
Introduction to oracle
 
Spatial queries entity recognition and disambiguation
Spatial queries entity recognition and disambiguationSpatial queries entity recognition and disambiguation
Spatial queries entity recognition and disambiguation
 
Uncertainty in Geospatial Data
Uncertainty in Geospatial DataUncertainty in Geospatial Data
Uncertainty in Geospatial Data
 
Geoprocessing
GeoprocessingGeoprocessing
Geoprocessing
 
Spatial Autocorrelation
Spatial AutocorrelationSpatial Autocorrelation
Spatial Autocorrelation
 
Map algebra
Map algebraMap algebra
Map algebra
 
Fractal Theory
Fractal TheoryFractal Theory
Fractal Theory
 
Graph Theory
Graph TheoryGraph Theory
Graph Theory
 
Fuzzy Set
Fuzzy SetFuzzy Set
Fuzzy Set
 
Spatial Transformation
Spatial TransformationSpatial Transformation
Spatial Transformation
 
Introduction to GIS
Introduction to GISIntroduction to GIS
Introduction to GIS
 
DTM Quality Assessment
DTM Quality AssessmentDTM Quality Assessment
DTM Quality Assessment
 

Dernier

Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesPrabhanshu Chaturvedi
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 

Dernier (20)

Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 

Introduction to SQL

  • 1. Introduction to SQL UNIVERSITY OF TEHRAN NOVEMBER, 2016
  • 2. What is SQL?  Structured Query Language  SQL is Structured Query Language, which is a computer language for storing, manipulating and retrieving data stored in relational database.  SQL is the standard language for Relation Database System. All relational database management systems like “MySQL, MS Access, Oracle, Sybase, Informix, postgres and SQL Server” use SQL as standard database language.
  • 3. SQL Commands  DDL - Data Definition Language  DML - Data Manipulation Language  DCL - Data Control Language  DQL - Data Query Language
  • 6. SQL RDBMS Concepts  TABLE  RECORD  COLUMN  CELL  NULL?
  • 7. SQL RDBMS Concepts  SQL Constraints: (applied on columns)  NOT NULL Constraint  UNIQUE Constraint  PRIMARY Key  FOREIGN Key  CHECK Constraint  Data Integrity:  Entity Integrity: There are no duplicate rows in a table  Domain Integrity: Enforces valid entries for a given column by restricting the type  Referential Integrity: Rows cannot be deleted which are used by other records  User-Defined Integrity: Enforces some specific business rules
  • 8. SQL RDBMS Concepts  Data Types:  Character datatypes:  CHAR  NCHAR  NVARCHAR2  VARCHAR2  Numeric datatypes:  NUMBER  BINARY_FLOAT  BINARY_DOUBLE  Date time datatype:  DATE
  • 9. DCL: CREATE USER  1) Define User with Username/Password  2) Grants Sufficient Privileges.  Using SQL Developer (UI, Command)  Using SQL *PLUS (Command)
  • 10. SQL : DDL  Create Table:  COLUMNS  CONSTRAINTS
  • 11. SQL: DDL  DROP TABLE:  ALTER TABLE  OTHER DDL COMMANDS!!!!
  • 12. SQL: DML: INSERT  INSERT INTO:  NUMBER, CHAR/VARCHAR2, DATE?
  • 13. SQL: DML: INSERT  INSERT INTO:  SPECIFIC COLUMNS
  • 14. SQL: DML: INSERT  INSERT INTO:  FOREIGN KEY  ALL DML COMMANDS NEED COMMIT
  • 15. SQL: DML: UPDATE  UPDATE  WHERE CLAUSE
  • 16. SQL: DML: DELETE  DELETE (DELETE VS DROP????)
  • 18. SQL: DQL: SELECT  SELECT  *  SPECIFIC COLUMNS
  • 19. SQL: DQL: SELECT  DISTINCT CLUASE
  • 20. SQL: DQL: SELECT  WHERE CLUASE
  • 21. SQL: DQL: SELECT  IN CLUASE  NOT IN  NULL IN WHERE?  IS NULL  IS NOT NULL
  • 23. SQL: DQL: SELECT  GROUP BY  AGGREGATE FUCTION  MAX,MIN  AVG  COUNT  SUM  …  HAVING CLAUSE
  • 24. SQL: DQL: SELECT  SELECT FROM MULTIPLE TABLES  CARTESIAN MULTIPICATION  JOIN
  • 25. About Me  Ehsan Hamzei  Graduate Student of Geospatial Information System  University of Tehran  Git-Hub: https://github.com/ehsan-hamzei/  Source-Codes: https://github.com/ehsan- hamzei/Oracle-SQL/

Notes de l'éditeur

  1. کارمندانی که حرف o در اسمشون هست و در سال 2003 به بعد استخدام شده اند. SELECT * FROM EMPLOYEES WHERE FIRST_NAME LIKE '%o%' AND HIRE_DATE >= TO_DATE('01-JAN-2003');