SlideShare a Scribd company logo
1 of 17
 Collection of interrelated data
 Set of programs to access the data
 DBMS contains information about a particular enterprise
 DBMS provides an environment that is both convenient
and efficient to use.
 Database Applications:
 Banking: all transactions
 Airlines: reservations, schedules
 Universities: registration, grades
 Sales: customers, products, purchases
 Manufacturing: production, inventory, orders, supply chain
 Human resources: employee records, salaries, tax deductions
 Databases touch all aspects of our lives
What is SQL?
– When a user wants to get some
information from a database file, he
can issue a query.
1
– A query is a user–request to retrieve
data or information with a certain
condition.
– SQL is a query language that allows user
to specify the conditions. (instead of
algorithms)
Concept of SQL
– The user specifies a certain condition.
1
– The result of the query will then be
stored in form of a table.
– Statistical information of the data.
– The program will go through all the
records in the database file and select
those records that satisfy the
condition.(searching).
Both an ANSI and ISO standard
Types of commands:
1. Data Definition Language (DDL) : Create, Alter, Drop,
Rename, Truncate
2. Data Manipulation Language (DML): Insert, Delete,
Update
1. Data Retrieval: Select
2. Transaction Control: Commit, Rollback, Savepoint
3. Data Control Language (DCL): Grant, Revoke
5
A simplified schematic of a typical SQL
environment, as described by the SQL-2003
standard
6
 Catalog
 A set of schemas that constitute the description of a database
 Schema (or Database)
 The structure that contains descriptions of objects created by a user (base tables,
views, constraints)
 Data Definition Language (DDL)
 Commands that define a database, including creating, altering, and dropping tables and
establishing constraints
 Data Manipulation Language (DML)
 Commands that maintain and query a database
 Data Control Language (DCL)
 Commands that control a database, including administering privileges and committing data
CREATE TABLE {table}
( {column datatype [DEFAULT expr]
[column_constraint] ... | table_constraint}
[, { column datatype [DEFAULT expr]
[column_constraint] ...
)
ALTER TABLE {table}
[ADD|MODIFY {column datatype [DEFAULT expr] [column_constraint]}
[DROP drop_clause]
DROP TABLE {table} [cascade constraints]
DESC {table}
INSERT INTO {table | view} [ (column [, column] ...) ]
VALUES (expr,expr ...)
UPDATE {table | view }
SET { (column [, column] = { expr | }
[WHERE condition]
DELETE [FROM] {table | view} [WHERE condition]
Data Retrieval:
SELECT [DISTINCT | ALL] {table|view}
FROM {table | view}
[WHERE condition ]
[GROUP BY expr [, expr]]
[ORDER BY {expr} [ASC | DESC]]
select * from dept;
select deptname from dept where deptid='10';
select lname,fname from emp order by lname desc;
select max(salary) from emp group by positionid;
select deptname from dept,emp where
dept.deptid=emp.deptid and emp.empid='111';
Transaction Control:
COMMIT
ROLLBACK [ to {savepoint}]
SAVEPOINT {name}
commit;
savepoint point1;
rollback to point1;
Data Control Language:
GRANT [privileges]
ON object TO user|public
[WITH GRANT OPTION]
REVOKE [privileges]
ON object TO user|public
[CASCADE CONSTRAINTS]
grant select,update on emp to XYZ ;
revoke update on emp to XYZ;
SelectionProjection
Table 1 Table 2
Table 1Table 1
Join
 SELECT identifies the columns to be displayed.
 FROM identifies the table containing those columns.
SELECT *|{[DISTINCT] column|expression [alias],...}
FROM table;
SELECT *
FROM departments;
SELECT department_id, location_id
FROM departments;
 SQL statements are not case-sensitive.
 SQL statements can be entered on one or more lines.
 Keywords cannot be abbreviated or split across lines.
 Clauses are usually placed on separate lines.
 Indents are used to enhance readability.
 In SQL Developer, SQL statements can optionally be
terminated by a semicolon (;). Semicolons are
required when you execute multiple SQL statements.
 In SQL*Plus, you are required to end each SQL
statement with a semicolon (;).

More Related Content

What's hot (20)

Database Architecture
Database ArchitectureDatabase Architecture
Database Architecture
 
Sql introduction
Sql introductionSql introduction
Sql introduction
 
1 ddl
1 ddl1 ddl
1 ddl
 
Data base
Data baseData base
Data base
 
Sql - Structured Query Language
Sql - Structured Query LanguageSql - Structured Query Language
Sql - Structured Query Language
 
What is SQL Server?
What is SQL Server?What is SQL Server?
What is SQL Server?
 
Sql
SqlSql
Sql
 
Structured Query Language
Structured Query LanguageStructured Query Language
Structured Query Language
 
Dml and ddl
Dml and ddlDml and ddl
Dml and ddl
 
SQL Commands
SQL Commands SQL Commands
SQL Commands
 
Data definition language
Data definition languageData definition language
Data definition language
 
Introduction to database
Introduction to databaseIntroduction to database
Introduction to database
 
PT- Oracle session01
PT- Oracle session01 PT- Oracle session01
PT- Oracle session01
 
Sql
SqlSql
Sql
 
Introduction to SQL
Introduction to SQLIntroduction to SQL
Introduction to SQL
 
Module02
Module02Module02
Module02
 
SQL: Structured Query Language
SQL: Structured Query LanguageSQL: Structured Query Language
SQL: Structured Query Language
 
Sql intro & ddl 1
Sql intro & ddl 1Sql intro & ddl 1
Sql intro & ddl 1
 
Data Ware Housing through SQL concept
Data Ware Housing through SQL conceptData Ware Housing through SQL concept
Data Ware Housing through SQL concept
 
DDL(Data defination Language ) Using Oracle
DDL(Data defination Language ) Using OracleDDL(Data defination Language ) Using Oracle
DDL(Data defination Language ) Using Oracle
 

Viewers also liked

Multiplexing ppt15 sep
Multiplexing ppt15 sepMultiplexing ppt15 sep
Multiplexing ppt15 sepSrashti Vyas
 
Common channel Signalling System No 7 ppt
Common channel Signalling System No 7 pptCommon channel Signalling System No 7 ppt
Common channel Signalling System No 7 pptSrashti Vyas
 
The Six Highest Performing B2B Blog Post Formats
The Six Highest Performing B2B Blog Post FormatsThe Six Highest Performing B2B Blog Post Formats
The Six Highest Performing B2B Blog Post FormatsBarry Feldman
 
The Outcome Economy
The Outcome EconomyThe Outcome Economy
The Outcome EconomyHelge Tennø
 

Viewers also liked (6)

Multiplexing ppt15 sep
Multiplexing ppt15 sepMultiplexing ppt15 sep
Multiplexing ppt15 sep
 
SPACE DIVISION MULTIPLEXING (SDMA)
SPACE DIVISION MULTIPLEXING (SDMA)SPACE DIVISION MULTIPLEXING (SDMA)
SPACE DIVISION MULTIPLEXING (SDMA)
 
Common channel Signalling System No 7 ppt
Common channel Signalling System No 7 pptCommon channel Signalling System No 7 ppt
Common channel Signalling System No 7 ppt
 
Signaling system 7 (ss7)
Signaling system 7 (ss7)Signaling system 7 (ss7)
Signaling system 7 (ss7)
 
The Six Highest Performing B2B Blog Post Formats
The Six Highest Performing B2B Blog Post FormatsThe Six Highest Performing B2B Blog Post Formats
The Six Highest Performing B2B Blog Post Formats
 
The Outcome Economy
The Outcome EconomyThe Outcome Economy
The Outcome Economy
 

Similar to SQLSlide

Database Management System (DBMS).pptx
Database Management System (DBMS).pptxDatabase Management System (DBMS).pptx
Database Management System (DBMS).pptxGevitaChinnaiah
 
Sql Commands_Dr.R.Shalini.ppt
Sql Commands_Dr.R.Shalini.pptSql Commands_Dr.R.Shalini.ppt
Sql Commands_Dr.R.Shalini.pptDrRShaliniVISTAS
 
Database Project Airport management System
Database Project Airport management SystemDatabase Project Airport management System
Database Project Airport management SystemFahad Chishti
 
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptxMy lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptxEliasPetros
 
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptxhjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptxEliasPetros
 
Introducing ms sql_server_updated
Introducing ms sql_server_updatedIntroducing ms sql_server_updated
Introducing ms sql_server_updatedleetinhf
 
Sql database development part 1
Sql database development part 1Sql database development part 1
Sql database development part 1Sqlperfomance
 
Database management system by Neeraj Bhandari ( Surkhet.Nepal )
Database management system by Neeraj Bhandari ( Surkhet.Nepal )Database management system by Neeraj Bhandari ( Surkhet.Nepal )
Database management system by Neeraj Bhandari ( Surkhet.Nepal )Neeraj Bhandari
 
Lecture on DBMS & MySQL.pdf v. C. .
Lecture on DBMS & MySQL.pdf v.  C.     .Lecture on DBMS & MySQL.pdf v.  C.     .
Lecture on DBMS & MySQL.pdf v. C. .MayankSinghRawat6
 
Bank mangement system
Bank mangement systemBank mangement system
Bank mangement systemFaisalGhffar
 
Chapter 2: Ms SQL Server
Chapter 2: Ms SQL ServerChapter 2: Ms SQL Server
Chapter 2: Ms SQL ServerNgeam Soly
 
BASIC OF DATABASE PPT new.pptx
BASIC OF DATABASE PPT  new.pptxBASIC OF DATABASE PPT  new.pptx
BASIC OF DATABASE PPT new.pptxNiyatiMandaliya
 
6_SQL.pdf
6_SQL.pdf6_SQL.pdf
6_SQL.pdfLPhct2
 
data manipulation language
data manipulation languagedata manipulation language
data manipulation languageJananiSelvaraj10
 

Similar to SQLSlide (20)

Database Management System (DBMS).pptx
Database Management System (DBMS).pptxDatabase Management System (DBMS).pptx
Database Management System (DBMS).pptx
 
Sql Commands_Dr.R.Shalini.ppt
Sql Commands_Dr.R.Shalini.pptSql Commands_Dr.R.Shalini.ppt
Sql Commands_Dr.R.Shalini.ppt
 
Database Project Airport management System
Database Project Airport management SystemDatabase Project Airport management System
Database Project Airport management System
 
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptxMy lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
 
Lab
LabLab
Lab
 
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptxhjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
 
Oracle 11g SQL Overview
Oracle 11g SQL OverviewOracle 11g SQL Overview
Oracle 11g SQL Overview
 
Dbms sql-final
Dbms  sql-finalDbms  sql-final
Dbms sql-final
 
lovely
lovelylovely
lovely
 
Introducing ms sql_server_updated
Introducing ms sql_server_updatedIntroducing ms sql_server_updated
Introducing ms sql_server_updated
 
Sql database development part 1
Sql database development part 1Sql database development part 1
Sql database development part 1
 
Database management system by Neeraj Bhandari ( Surkhet.Nepal )
Database management system by Neeraj Bhandari ( Surkhet.Nepal )Database management system by Neeraj Bhandari ( Surkhet.Nepal )
Database management system by Neeraj Bhandari ( Surkhet.Nepal )
 
SQL2.pptx
SQL2.pptxSQL2.pptx
SQL2.pptx
 
Lecture on DBMS & MySQL.pdf v. C. .
Lecture on DBMS & MySQL.pdf v.  C.     .Lecture on DBMS & MySQL.pdf v.  C.     .
Lecture on DBMS & MySQL.pdf v. C. .
 
[PHPUGPH] PHP Roadshow - MySQL
[PHPUGPH] PHP Roadshow - MySQL[PHPUGPH] PHP Roadshow - MySQL
[PHPUGPH] PHP Roadshow - MySQL
 
Bank mangement system
Bank mangement systemBank mangement system
Bank mangement system
 
Chapter 2: Ms SQL Server
Chapter 2: Ms SQL ServerChapter 2: Ms SQL Server
Chapter 2: Ms SQL Server
 
BASIC OF DATABASE PPT new.pptx
BASIC OF DATABASE PPT  new.pptxBASIC OF DATABASE PPT  new.pptx
BASIC OF DATABASE PPT new.pptx
 
6_SQL.pdf
6_SQL.pdf6_SQL.pdf
6_SQL.pdf
 
data manipulation language
data manipulation languagedata manipulation language
data manipulation language
 

Recently uploaded

Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 

Recently uploaded (20)

Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 

SQLSlide

  • 1.  Collection of interrelated data  Set of programs to access the data  DBMS contains information about a particular enterprise  DBMS provides an environment that is both convenient and efficient to use.  Database Applications:  Banking: all transactions  Airlines: reservations, schedules  Universities: registration, grades  Sales: customers, products, purchases  Manufacturing: production, inventory, orders, supply chain  Human resources: employee records, salaries, tax deductions  Databases touch all aspects of our lives
  • 2. What is SQL? – When a user wants to get some information from a database file, he can issue a query. 1 – A query is a user–request to retrieve data or information with a certain condition. – SQL is a query language that allows user to specify the conditions. (instead of algorithms)
  • 3. Concept of SQL – The user specifies a certain condition. 1 – The result of the query will then be stored in form of a table. – Statistical information of the data. – The program will go through all the records in the database file and select those records that satisfy the condition.(searching).
  • 4. Both an ANSI and ISO standard Types of commands: 1. Data Definition Language (DDL) : Create, Alter, Drop, Rename, Truncate 2. Data Manipulation Language (DML): Insert, Delete, Update 1. Data Retrieval: Select 2. Transaction Control: Commit, Rollback, Savepoint 3. Data Control Language (DCL): Grant, Revoke
  • 5. 5 A simplified schematic of a typical SQL environment, as described by the SQL-2003 standard
  • 6. 6  Catalog  A set of schemas that constitute the description of a database  Schema (or Database)  The structure that contains descriptions of objects created by a user (base tables, views, constraints)  Data Definition Language (DDL)  Commands that define a database, including creating, altering, and dropping tables and establishing constraints  Data Manipulation Language (DML)  Commands that maintain and query a database  Data Control Language (DCL)  Commands that control a database, including administering privileges and committing data
  • 7. CREATE TABLE {table} ( {column datatype [DEFAULT expr] [column_constraint] ... | table_constraint} [, { column datatype [DEFAULT expr] [column_constraint] ... ) ALTER TABLE {table} [ADD|MODIFY {column datatype [DEFAULT expr] [column_constraint]} [DROP drop_clause] DROP TABLE {table} [cascade constraints] DESC {table}
  • 8. INSERT INTO {table | view} [ (column [, column] ...) ] VALUES (expr,expr ...) UPDATE {table | view } SET { (column [, column] = { expr | } [WHERE condition] DELETE [FROM] {table | view} [WHERE condition]
  • 9. Data Retrieval: SELECT [DISTINCT | ALL] {table|view} FROM {table | view} [WHERE condition ] [GROUP BY expr [, expr]] [ORDER BY {expr} [ASC | DESC]] select * from dept; select deptname from dept where deptid='10'; select lname,fname from emp order by lname desc; select max(salary) from emp group by positionid; select deptname from dept,emp where dept.deptid=emp.deptid and emp.empid='111';
  • 10. Transaction Control: COMMIT ROLLBACK [ to {savepoint}] SAVEPOINT {name} commit; savepoint point1; rollback to point1;
  • 11. Data Control Language: GRANT [privileges] ON object TO user|public [WITH GRANT OPTION] REVOKE [privileges] ON object TO user|public [CASCADE CONSTRAINTS] grant select,update on emp to XYZ ; revoke update on emp to XYZ;
  • 12.
  • 13. SelectionProjection Table 1 Table 2 Table 1Table 1 Join
  • 14.  SELECT identifies the columns to be displayed.  FROM identifies the table containing those columns. SELECT *|{[DISTINCT] column|expression [alias],...} FROM table;
  • 17.  SQL statements are not case-sensitive.  SQL statements can be entered on one or more lines.  Keywords cannot be abbreviated or split across lines.  Clauses are usually placed on separate lines.  Indents are used to enhance readability.  In SQL Developer, SQL statements can optionally be terminated by a semicolon (;). Semicolons are required when you execute multiple SQL statements.  In SQL*Plus, you are required to end each SQL statement with a semicolon (;).