SlideShare ist ein Scribd-Unternehmen logo
1 von 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/

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction to Database
Introduction to DatabaseIntroduction to Database
Introduction to DatabaseSiti Ismail
 
Types Of Join In Sql Server - Join With Example In Sql Server
Types Of Join In Sql Server - Join With Example In Sql ServerTypes Of Join In Sql Server - Join With Example In Sql Server
Types Of Join In Sql Server - Join With Example In Sql Serverprogrammings guru
 
Introduction to oops concepts
Introduction to oops conceptsIntroduction to oops concepts
Introduction to oops conceptsNilesh Dalvi
 
introdution to SQL and SQL functions
introdution to SQL and SQL functionsintrodution to SQL and SQL functions
introdution to SQL and SQL functionsfarwa waqar
 
Types Of Keys in DBMS
Types Of Keys in DBMSTypes Of Keys in DBMS
Types Of Keys in DBMSPadamNepal1
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship DiagramShakila Mahjabin
 
Sql queries presentation
Sql queries presentationSql queries presentation
Sql queries presentationNITISH KUMAR
 
Introduction to databases
Introduction to databasesIntroduction to databases
Introduction to databasesBryan Corpuz
 
1 - Introduction to PL/SQL
1 - Introduction to PL/SQL1 - Introduction to PL/SQL
1 - Introduction to PL/SQLrehaniltifat
 
SQL Joins.pptx
SQL Joins.pptxSQL Joins.pptx
SQL Joins.pptxAnkit Rai
 
1. Introduction to DBMS
1. Introduction to DBMS1. Introduction to DBMS
1. Introduction to DBMSkoolkampus
 

Was ist angesagt? (20)

Create table
Create tableCreate table
Create table
 
Introduction to Database
Introduction to DatabaseIntroduction to Database
Introduction to Database
 
Types Of Join In Sql Server - Join With Example In Sql Server
Types Of Join In Sql Server - Join With Example In Sql ServerTypes Of Join In Sql Server - Join With Example In Sql Server
Types Of Join In Sql Server - Join With Example In Sql Server
 
Data Models
Data ModelsData Models
Data Models
 
Introduction to oops concepts
Introduction to oops conceptsIntroduction to oops concepts
Introduction to oops concepts
 
introdution to SQL and SQL functions
introdution to SQL and SQL functionsintrodution to SQL and SQL functions
introdution to SQL and SQL functions
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Types Of Keys in DBMS
Types Of Keys in DBMSTypes Of Keys in DBMS
Types Of Keys in DBMS
 
DBMS: Types of keys
DBMS:  Types of keysDBMS:  Types of keys
DBMS: Types of keys
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
 
Sql queries presentation
Sql queries presentationSql queries presentation
Sql queries presentation
 
Dbms lab questions
Dbms lab questionsDbms lab questions
Dbms lab questions
 
Oracle SQL Basics
Oracle SQL BasicsOracle SQL Basics
Oracle SQL Basics
 
Introduction to databases
Introduction to databasesIntroduction to databases
Introduction to databases
 
1 - Introduction to PL/SQL
1 - Introduction to PL/SQL1 - Introduction to PL/SQL
1 - Introduction to PL/SQL
 
SQL Overview
SQL OverviewSQL Overview
SQL Overview
 
MYSQL.ppt
MYSQL.pptMYSQL.ppt
MYSQL.ppt
 
SQL Joins.pptx
SQL Joins.pptxSQL Joins.pptx
SQL Joins.pptx
 
1. Introduction to DBMS
1. Introduction to DBMS1. Introduction to DBMS
1. Introduction to DBMS
 
joins in database
 joins in database joins in database
joins in database
 

Andere mochten auch

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
 

Andere mochten auch (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
 

Ähnlich wie 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
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptNANDHAKUMARA10
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiessarkmank1
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersMairaAshraf6
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdfKamal Acharya
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptxJIT KUMAR GUPTA
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdfKamal Acharya
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxSCMS School of Architecture
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Call Girls Mumbai
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.Kamal Acharya
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxSCMS School of Architecture
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxmaisarahman1
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Servicemeghakumariji156
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationBhangaleSonal
 

Kürzlich hochgeladen (20)

Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and properties
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 

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/

Hinweis der Redaktion

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