SlideShare a Scribd company logo
INTRODUCTION TO SQL
Prepared by
Ravichandiran
Senior Oracle Trainer
WHY MAZENET?
• Oracle Certified Partner & more than 10+ years experienced
Trainers.
• Oracle unique id for students
• E-kits from Oracle University
• Course Completion Certificate from Oracle University.
• Flexible timing for working professionals.
• Preparing candidates to face interview and free resume
preparation.
COMMANDS
DDL - DATA DEFINITION LANUGAGE
DML - DATA MANIPULATION LANGUAGE
TCL - TRANSACTION CONTROL LANGUAGE
DCL - DATA CONTROL LANGUAGE
DRL - DATA RETRIEVAL LANGUAGE
DDL
• Used to create or modify the structure of the table.
• Auto commit occurs. Changes cannot be rolled
back.
• Session independent commands.
• Commands are :
CREATE, ALTER DROP, TRUNCATE, RENAME
DDL - CREATE
SYNTAX
create table <tab_name>
(
col1 datatype(size),
col2 datatype(size),
...........
.............
coln datatype(size)
);
SYNTAX
create table <tab_name>
(
col1 datatype(size),
col2 datatype(size),
...........
.............
coln datatype(size)
);
EXAMPLE
Create table emp
(
empno number(5),
ename varchar2(20),
job varchar2(20)
);
EXAMPLE
Create table emp
(
empno number(5),
ename varchar2(20),
job varchar2(20)
);
DDL - ALTER
ADD
• ALTER TABLE EMP ADD
DOJ DATE;
• ALTER TABLE EMP ADD
( SALARY NUMBER(5),
COMM NUMBER(4),
DEPTNO NUMBER(3));
ADD
• ALTER TABLE EMP ADD
DOJ DATE;
• ALTER TABLE EMP ADD
( SALARY NUMBER(5),
COMM NUMBER(4),
DEPTNO NUMBER(3));
MODIFY
• ALTER TABLE EMP ADD
DOJ DATE;
• ALTER TABLE EMP ADD
( SALARY NUMBER(5),
COMM NUMBER(4),
DEPTNO NUMBER(3));
MODIFY
• ALTER TABLE EMP ADD
DOJ DATE;
• ALTER TABLE EMP ADD
( SALARY NUMBER(5),
COMM NUMBER(4),
DEPTNO NUMBER(3));
DDL - ALTER
DROP COLUMN
• ALTER TABLE EMP DROP
COLUMN DEPTNO;
• ALTER TABLE EMP
DROP(DOJ,COMM);
DROP COLUMN
• ALTER TABLE EMP DROP
COLUMN DEPTNO;
• ALTER TABLE EMP
DROP(DOJ,COMM);
RENAME COLUMN
• ALTER TABLE EMP
RENAME COLUMN EMPNO
TO ENO;
RENAME COLUMN
• ALTER TABLE EMP
RENAME COLUMN EMPNO
TO ENO;
DDL - DROP
TABLE DROPPED
• DROP TABLE EMP;
• DROP TABLE EMP
PURGE;
• PURGE RECYCLEBIN;
• PURGE TABLE EMP;
TABLE DROPPED
• DROP TABLE EMP;
• DROP TABLE EMP
PURGE;
• PURGE RECYCLEBIN;
• PURGE TABLE EMP;
FLASHBACK COMMAND
• Flashback table emp to
before drop;
• Flashback table emp to
before drop rename to
employees;
FLASHBACK COMMAND
• Flashback table emp to
before drop;
• Flashback table emp to
before drop rename to
employees;
DDL - TRUNCATE
• Used to remove records from table.
• Cannot delete single row alone
• Changes are permanent. So deleted record cannot
be rolled back.
TRUNCATE TABLE EMP;
DDL - RENAME
• Used to rename the table.
RENAME <OLD_TABLE_NAME> TO
<NEW_TAB_NAME>;
RENAME EMP TO EMPLOYEES;
Ad

Recommended

Testing- Fundamentals of Testing-Mazenet solution
Testing- Fundamentals of Testing-Mazenet solution
Mazenetsolution
 
Dotnet- An overview of ASP.NET & ADO.NET- Mazenet solution
Dotnet- An overview of ASP.NET & ADO.NET- Mazenet solution
Mazenetsolution
 
.Net- Introduction to Linq & practical session on ADO & ASP.NET- Mazenet solu...
.Net- Introduction to Linq & practical session on ADO & ASP.NET- Mazenet solu...
Mazenetsolution
 
Java- GUI- Mazenet solution
Java- GUI- Mazenet solution
Mazenetsolution
 
Oracle-L11 using Oracle flashback technology-Mazenet solution
Oracle-L11 using Oracle flashback technology-Mazenet solution
Mazenetsolution
 
Rhel6 vs rhel7
Rhel6 vs rhel7
Ratna Likhita
 
Cehv8 - references
Cehv8 - references
Vuz Dở Hơi
 
Cehv8 - Module 20: penetration testing
Cehv8 - Module 20: penetration testing
Vuz Dở Hơi
 
Software Testing- Principles of testing- Mazenet Solution
Software Testing- Principles of testing- Mazenet Solution
Mazenetsolution
 
Cehv8 Labs - Module17: Evading IDS, Firewalls and Honeypots.
Cehv8 Labs - Module17: Evading IDS, Firewalls and Honeypots.
Vuz Dở Hơi
 
Static testing techniques
Static testing techniques
Mazenetsolution
 
Java - Servlet - Mazenet Solution
Java - Servlet - Mazenet Solution
Mazenetsolution
 
Software Testing - Tool support for testing (CAST) - Mazenet Solution
Software Testing - Tool support for testing (CAST) - Mazenet Solution
Mazenetsolution
 
Java- Updates in java8-Mazenet solution
Java- Updates in java8-Mazenet solution
Mazenetsolution
 
Java- Java tech overview- Mazenet solution
Java- Java tech overview- Mazenet solution
Mazenetsolution
 
Cehv8 Labs - Module15: Hacking Wireless Networks.
Cehv8 Labs - Module15: Hacking Wireless Networks.
Vuz Dở Hơi
 
Install and Configure RSyslog – CentOS 7 / RHEL 7
Install and Configure RSyslog – CentOS 7 / RHEL 7
VCP Muthukrishna
 
Ethical Hacking
Ethical Hacking
Mazenetsolution
 
Cehv8 Labs - Module07: Viruses and Worms.
Cehv8 Labs - Module07: Viruses and Worms.
Vuz Dở Hơi
 
Java- JDBC- Mazenet Solution
Java- JDBC- Mazenet Solution
Mazenetsolution
 
CCNAv5 - S1: Chapter11 It's A Network
CCNAv5 - S1: Chapter11 It's A Network
Vuz Dở Hơi
 
Red Hat - LVM - Mazenet Solution
Red Hat - LVM - Mazenet Solution
Mazenetsolution
 
Database Management System
Database Management System
Hitesh Mohapatra
 
8. sql
8. sql
khoahuy82
 
SQL
SQL
Tuhin_Das
 
dbms lab manual
dbms lab manual
stalinjothi
 
Ddl &amp; dml commands
Ddl &amp; dml commands
AnjaliJain167
 
Fundamentals of Database management system Lab Manual.pptx
Fundamentals of Database management system Lab Manual.pptx
Getnet Tigabie Askale -(GM)
 
Introduction to SQL and Data Defination Language Commands
Introduction to SQL and Data Defination Language Commands
priyanaik70
 
MIS 301 RELATIONAL DATABASE MANAGEMENT SYSTEM 10,11&12.pptx
MIS 301 RELATIONAL DATABASE MANAGEMENT SYSTEM 10,11&12.pptx
KrishnaRoy45
 

More Related Content

Viewers also liked (14)

Software Testing- Principles of testing- Mazenet Solution
Software Testing- Principles of testing- Mazenet Solution
Mazenetsolution
 
Cehv8 Labs - Module17: Evading IDS, Firewalls and Honeypots.
Cehv8 Labs - Module17: Evading IDS, Firewalls and Honeypots.
Vuz Dở Hơi
 
Static testing techniques
Static testing techniques
Mazenetsolution
 
Java - Servlet - Mazenet Solution
Java - Servlet - Mazenet Solution
Mazenetsolution
 
Software Testing - Tool support for testing (CAST) - Mazenet Solution
Software Testing - Tool support for testing (CAST) - Mazenet Solution
Mazenetsolution
 
Java- Updates in java8-Mazenet solution
Java- Updates in java8-Mazenet solution
Mazenetsolution
 
Java- Java tech overview- Mazenet solution
Java- Java tech overview- Mazenet solution
Mazenetsolution
 
Cehv8 Labs - Module15: Hacking Wireless Networks.
Cehv8 Labs - Module15: Hacking Wireless Networks.
Vuz Dở Hơi
 
Install and Configure RSyslog – CentOS 7 / RHEL 7
Install and Configure RSyslog – CentOS 7 / RHEL 7
VCP Muthukrishna
 
Ethical Hacking
Ethical Hacking
Mazenetsolution
 
Cehv8 Labs - Module07: Viruses and Worms.
Cehv8 Labs - Module07: Viruses and Worms.
Vuz Dở Hơi
 
Java- JDBC- Mazenet Solution
Java- JDBC- Mazenet Solution
Mazenetsolution
 
CCNAv5 - S1: Chapter11 It's A Network
CCNAv5 - S1: Chapter11 It's A Network
Vuz Dở Hơi
 
Red Hat - LVM - Mazenet Solution
Red Hat - LVM - Mazenet Solution
Mazenetsolution
 
Software Testing- Principles of testing- Mazenet Solution
Software Testing- Principles of testing- Mazenet Solution
Mazenetsolution
 
Cehv8 Labs - Module17: Evading IDS, Firewalls and Honeypots.
Cehv8 Labs - Module17: Evading IDS, Firewalls and Honeypots.
Vuz Dở Hơi
 
Static testing techniques
Static testing techniques
Mazenetsolution
 
Java - Servlet - Mazenet Solution
Java - Servlet - Mazenet Solution
Mazenetsolution
 
Software Testing - Tool support for testing (CAST) - Mazenet Solution
Software Testing - Tool support for testing (CAST) - Mazenet Solution
Mazenetsolution
 
Java- Updates in java8-Mazenet solution
Java- Updates in java8-Mazenet solution
Mazenetsolution
 
Java- Java tech overview- Mazenet solution
Java- Java tech overview- Mazenet solution
Mazenetsolution
 
Cehv8 Labs - Module15: Hacking Wireless Networks.
Cehv8 Labs - Module15: Hacking Wireless Networks.
Vuz Dở Hơi
 
Install and Configure RSyslog – CentOS 7 / RHEL 7
Install and Configure RSyslog – CentOS 7 / RHEL 7
VCP Muthukrishna
 
Cehv8 Labs - Module07: Viruses and Worms.
Cehv8 Labs - Module07: Viruses and Worms.
Vuz Dở Hơi
 
Java- JDBC- Mazenet Solution
Java- JDBC- Mazenet Solution
Mazenetsolution
 
CCNAv5 - S1: Chapter11 It's A Network
CCNAv5 - S1: Chapter11 It's A Network
Vuz Dở Hơi
 
Red Hat - LVM - Mazenet Solution
Red Hat - LVM - Mazenet Solution
Mazenetsolution
 

Similar to Oracle- Introduction to Sql commands- Mazenet solution (20)

Database Management System
Database Management System
Hitesh Mohapatra
 
8. sql
8. sql
khoahuy82
 
SQL
SQL
Tuhin_Das
 
dbms lab manual
dbms lab manual
stalinjothi
 
Ddl &amp; dml commands
Ddl &amp; dml commands
AnjaliJain167
 
Fundamentals of Database management system Lab Manual.pptx
Fundamentals of Database management system Lab Manual.pptx
Getnet Tigabie Askale -(GM)
 
Introduction to SQL and Data Defination Language Commands
Introduction to SQL and Data Defination Language Commands
priyanaik70
 
MIS 301 RELATIONAL DATABASE MANAGEMENT SYSTEM 10,11&12.pptx
MIS 301 RELATIONAL DATABASE MANAGEMENT SYSTEM 10,11&12.pptx
KrishnaRoy45
 
CS3481_Database Management Laboratory .pdf
CS3481_Database Management Laboratory .pdf
Kirubaburi R
 
BCS4L1-Database Management lab.pdf
BCS4L1-Database Management lab.pdf
KeerthanaP37
 
unit 3.pptx notes very important prepare
unit 3.pptx notes very important prepare
SanjayKumar255383
 
Sql dml & tcl 2
Sql dml & tcl 2
Dr. C.V. Suresh Babu
 
My SQL.pptx
My SQL.pptx
KieveBarreto1
 
Oracle SQL AND PL/SQL
Oracle SQL AND PL/SQL
suriyae1
 
SQL introduction
SQL introduction
traningoraclecseit
 
DBMS Commands DDL DML DCL ENTITY RELATIONSHIP.pptx
DBMS Commands DDL DML DCL ENTITY RELATIONSHIP.pptx
Tulasi72
 
DBMS_ddlVFSBFSBS22222222222222222222222222222222222
DBMS_ddlVFSBFSBS22222222222222222222222222222222222
227567
 
SQL LECTURE.pptx
SQL LECTURE.pptx
TechnoSavage
 
Les09
Les09
arnold 7490
 
DBMS UNIT-2.pptx ggggggggggggggggggggggg
DBMS UNIT-2.pptx ggggggggggggggggggggggg
Praveen Kumar
 
Database Management System
Database Management System
Hitesh Mohapatra
 
Ddl &amp; dml commands
Ddl &amp; dml commands
AnjaliJain167
 
Fundamentals of Database management system Lab Manual.pptx
Fundamentals of Database management system Lab Manual.pptx
Getnet Tigabie Askale -(GM)
 
Introduction to SQL and Data Defination Language Commands
Introduction to SQL and Data Defination Language Commands
priyanaik70
 
MIS 301 RELATIONAL DATABASE MANAGEMENT SYSTEM 10,11&12.pptx
MIS 301 RELATIONAL DATABASE MANAGEMENT SYSTEM 10,11&12.pptx
KrishnaRoy45
 
CS3481_Database Management Laboratory .pdf
CS3481_Database Management Laboratory .pdf
Kirubaburi R
 
BCS4L1-Database Management lab.pdf
BCS4L1-Database Management lab.pdf
KeerthanaP37
 
unit 3.pptx notes very important prepare
unit 3.pptx notes very important prepare
SanjayKumar255383
 
Oracle SQL AND PL/SQL
Oracle SQL AND PL/SQL
suriyae1
 
DBMS Commands DDL DML DCL ENTITY RELATIONSHIP.pptx
DBMS Commands DDL DML DCL ENTITY RELATIONSHIP.pptx
Tulasi72
 
DBMS_ddlVFSBFSBS22222222222222222222222222222222222
DBMS_ddlVFSBFSBS22222222222222222222222222222222222
227567
 
DBMS UNIT-2.pptx ggggggggggggggggggggggg
DBMS UNIT-2.pptx ggggggggggggggggggggggg
Praveen Kumar
 
Ad

More from Mazenetsolution (14)

Tally Auto E-mail Module | Mazenet Technologies
Tally Auto E-mail Module | Mazenet Technologies
Mazenetsolution
 
Tally Auto SMS Module| Mazenet Technologies
Tally Auto SMS Module| Mazenet Technologies
Mazenetsolution
 
Tally auto synchronization
Tally auto synchronization
Mazenetsolution
 
Print barcode using voucher- Mazenettechnologies
Print barcode using voucher- Mazenettechnologies
Mazenetsolution
 
Copy user list | Tally | Tally Software | Accounting Software | Mazenet
Copy user list | Tally | Tally Software | Accounting Software | Mazenet
Mazenetsolution
 
Auto synchronization | Tally Software | Mazenet Technologies
Auto synchronization | Tally Software | Mazenet Technologies
Mazenetsolution
 
Auto backup | Tally Coimbatore | Tally Software
Auto backup | Tally Coimbatore | Tally Software
Mazenetsolution
 
Mazenet Technologies-Tally
Mazenet Technologies-Tally
Mazenetsolution
 
Android - Intents - Mazenet Solution
Android - Intents - Mazenet Solution
Mazenetsolution
 
Software Testing - Test management - Mazenet Solution
Software Testing - Test management - Mazenet Solution
Mazenetsolution
 
PHP - Introduction to PHP - Mazenet Solution
PHP - Introduction to PHP - Mazenet Solution
Mazenetsolution
 
Process management in linux
Process management in linux
Mazenetsolution
 
Software Testing-Dynamic testing technique-Mazenet solution
Software Testing-Dynamic testing technique-Mazenet solution
Mazenetsolution
 
Red Hat Enterprise Linux 7
Red Hat Enterprise Linux 7
Mazenetsolution
 
Tally Auto E-mail Module | Mazenet Technologies
Tally Auto E-mail Module | Mazenet Technologies
Mazenetsolution
 
Tally Auto SMS Module| Mazenet Technologies
Tally Auto SMS Module| Mazenet Technologies
Mazenetsolution
 
Tally auto synchronization
Tally auto synchronization
Mazenetsolution
 
Print barcode using voucher- Mazenettechnologies
Print barcode using voucher- Mazenettechnologies
Mazenetsolution
 
Copy user list | Tally | Tally Software | Accounting Software | Mazenet
Copy user list | Tally | Tally Software | Accounting Software | Mazenet
Mazenetsolution
 
Auto synchronization | Tally Software | Mazenet Technologies
Auto synchronization | Tally Software | Mazenet Technologies
Mazenetsolution
 
Auto backup | Tally Coimbatore | Tally Software
Auto backup | Tally Coimbatore | Tally Software
Mazenetsolution
 
Mazenet Technologies-Tally
Mazenet Technologies-Tally
Mazenetsolution
 
Android - Intents - Mazenet Solution
Android - Intents - Mazenet Solution
Mazenetsolution
 
Software Testing - Test management - Mazenet Solution
Software Testing - Test management - Mazenet Solution
Mazenetsolution
 
PHP - Introduction to PHP - Mazenet Solution
PHP - Introduction to PHP - Mazenet Solution
Mazenetsolution
 
Process management in linux
Process management in linux
Mazenetsolution
 
Software Testing-Dynamic testing technique-Mazenet solution
Software Testing-Dynamic testing technique-Mazenet solution
Mazenetsolution
 
Red Hat Enterprise Linux 7
Red Hat Enterprise Linux 7
Mazenetsolution
 
Ad

Recently uploaded (20)

Plate Tectonic Boundaries and Continental Drift Theory
Plate Tectonic Boundaries and Continental Drift Theory
Marie
 
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
ChristinaFortunova
 
The Man In The Back – Exceptional Delaware.pdf
The Man In The Back – Exceptional Delaware.pdf
dennisongomezk
 
GEOGRAPHY-Study Material [ Class 10th] .pdf
GEOGRAPHY-Study Material [ Class 10th] .pdf
SHERAZ AHMAD LONE
 
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
razelitouali
 
Revista digital preescolar en transformación
Revista digital preescolar en transformación
guerragallardo26
 
Wax Moon, Richmond, VA. Terrence McPherson
Wax Moon, Richmond, VA. Terrence McPherson
TerrenceMcPherson1
 
Assisting Individuals and Families to Promote and Maintain Health – Unit 7 | ...
Assisting Individuals and Families to Promote and Maintain Health – Unit 7 | ...
RAKESH SAJJAN
 
Overview of Employee in Odoo 18 - Odoo Slides
Overview of Employee in Odoo 18 - Odoo Slides
Celine George
 
Unit- 4 Biostatistics & Research Methodology.pdf
Unit- 4 Biostatistics & Research Methodology.pdf
KRUTIKA CHANNE
 
How to Manage Inventory Movement in Odoo 18 POS
How to Manage Inventory Movement in Odoo 18 POS
Celine George
 
What is FIle and explanation of text files.pptx
What is FIle and explanation of text files.pptx
Ramakrishna Reddy Bijjam
 
Ray Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big Cycle
Dadang Solihin
 
Paper 108 | Thoreau’s Influence on Gandhi: The Evolution of Civil Disobedience
Paper 108 | Thoreau’s Influence on Gandhi: The Evolution of Civil Disobedience
Rajdeep Bavaliya
 
Non-Communicable Diseases and National Health Programs – Unit 10 | B.Sc Nursi...
Non-Communicable Diseases and National Health Programs – Unit 10 | B.Sc Nursi...
RAKESH SAJJAN
 
LDMMIA GRAD Student Check-in Orientation Sampler
LDMMIA GRAD Student Check-in Orientation Sampler
LDM & Mia eStudios
 
Sustainable Innovation with Immersive Learning
Sustainable Innovation with Immersive Learning
Leonel Morgado
 
How to Implement Least Package Removal Strategy in Odoo 18 Inventory
How to Implement Least Package Removal Strategy in Odoo 18 Inventory
Celine George
 
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
parmarjuli1412
 
BINARY files CSV files JSON files with example.pptx
BINARY files CSV files JSON files with example.pptx
Ramakrishna Reddy Bijjam
 
Plate Tectonic Boundaries and Continental Drift Theory
Plate Tectonic Boundaries and Continental Drift Theory
Marie
 
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
FEBA Sofia Univercity final diplian v3 GSDG 5.2025.pdf
ChristinaFortunova
 
The Man In The Back – Exceptional Delaware.pdf
The Man In The Back – Exceptional Delaware.pdf
dennisongomezk
 
GEOGRAPHY-Study Material [ Class 10th] .pdf
GEOGRAPHY-Study Material [ Class 10th] .pdf
SHERAZ AHMAD LONE
 
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
Energy Balances Of Oecd Countries 2011 Iea Statistics 1st Edition Oecd
razelitouali
 
Revista digital preescolar en transformación
Revista digital preescolar en transformación
guerragallardo26
 
Wax Moon, Richmond, VA. Terrence McPherson
Wax Moon, Richmond, VA. Terrence McPherson
TerrenceMcPherson1
 
Assisting Individuals and Families to Promote and Maintain Health – Unit 7 | ...
Assisting Individuals and Families to Promote and Maintain Health – Unit 7 | ...
RAKESH SAJJAN
 
Overview of Employee in Odoo 18 - Odoo Slides
Overview of Employee in Odoo 18 - Odoo Slides
Celine George
 
Unit- 4 Biostatistics & Research Methodology.pdf
Unit- 4 Biostatistics & Research Methodology.pdf
KRUTIKA CHANNE
 
How to Manage Inventory Movement in Odoo 18 POS
How to Manage Inventory Movement in Odoo 18 POS
Celine George
 
What is FIle and explanation of text files.pptx
What is FIle and explanation of text files.pptx
Ramakrishna Reddy Bijjam
 
Ray Dalio How Countries go Broke the Big Cycle
Ray Dalio How Countries go Broke the Big Cycle
Dadang Solihin
 
Paper 108 | Thoreau’s Influence on Gandhi: The Evolution of Civil Disobedience
Paper 108 | Thoreau’s Influence on Gandhi: The Evolution of Civil Disobedience
Rajdeep Bavaliya
 
Non-Communicable Diseases and National Health Programs – Unit 10 | B.Sc Nursi...
Non-Communicable Diseases and National Health Programs – Unit 10 | B.Sc Nursi...
RAKESH SAJJAN
 
LDMMIA GRAD Student Check-in Orientation Sampler
LDMMIA GRAD Student Check-in Orientation Sampler
LDM & Mia eStudios
 
Sustainable Innovation with Immersive Learning
Sustainable Innovation with Immersive Learning
Leonel Morgado
 
How to Implement Least Package Removal Strategy in Odoo 18 Inventory
How to Implement Least Package Removal Strategy in Odoo 18 Inventory
Celine George
 
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
THERAPEUTIC COMMUNICATION included definition, characteristics, nurse patient...
parmarjuli1412
 
BINARY files CSV files JSON files with example.pptx
BINARY files CSV files JSON files with example.pptx
Ramakrishna Reddy Bijjam
 

Oracle- Introduction to Sql commands- Mazenet solution

  • 1. INTRODUCTION TO SQL Prepared by Ravichandiran Senior Oracle Trainer
  • 2. WHY MAZENET? • Oracle Certified Partner & more than 10+ years experienced Trainers. • Oracle unique id for students • E-kits from Oracle University • Course Completion Certificate from Oracle University. • Flexible timing for working professionals. • Preparing candidates to face interview and free resume preparation.
  • 3. COMMANDS DDL - DATA DEFINITION LANUGAGE DML - DATA MANIPULATION LANGUAGE TCL - TRANSACTION CONTROL LANGUAGE DCL - DATA CONTROL LANGUAGE DRL - DATA RETRIEVAL LANGUAGE
  • 4. DDL • Used to create or modify the structure of the table. • Auto commit occurs. Changes cannot be rolled back. • Session independent commands. • Commands are : CREATE, ALTER DROP, TRUNCATE, RENAME
  • 5. DDL - CREATE SYNTAX create table <tab_name> ( col1 datatype(size), col2 datatype(size), ........... ............. coln datatype(size) ); SYNTAX create table <tab_name> ( col1 datatype(size), col2 datatype(size), ........... ............. coln datatype(size) ); EXAMPLE Create table emp ( empno number(5), ename varchar2(20), job varchar2(20) ); EXAMPLE Create table emp ( empno number(5), ename varchar2(20), job varchar2(20) );
  • 6. DDL - ALTER ADD • ALTER TABLE EMP ADD DOJ DATE; • ALTER TABLE EMP ADD ( SALARY NUMBER(5), COMM NUMBER(4), DEPTNO NUMBER(3)); ADD • ALTER TABLE EMP ADD DOJ DATE; • ALTER TABLE EMP ADD ( SALARY NUMBER(5), COMM NUMBER(4), DEPTNO NUMBER(3)); MODIFY • ALTER TABLE EMP ADD DOJ DATE; • ALTER TABLE EMP ADD ( SALARY NUMBER(5), COMM NUMBER(4), DEPTNO NUMBER(3)); MODIFY • ALTER TABLE EMP ADD DOJ DATE; • ALTER TABLE EMP ADD ( SALARY NUMBER(5), COMM NUMBER(4), DEPTNO NUMBER(3));
  • 7. DDL - ALTER DROP COLUMN • ALTER TABLE EMP DROP COLUMN DEPTNO; • ALTER TABLE EMP DROP(DOJ,COMM); DROP COLUMN • ALTER TABLE EMP DROP COLUMN DEPTNO; • ALTER TABLE EMP DROP(DOJ,COMM); RENAME COLUMN • ALTER TABLE EMP RENAME COLUMN EMPNO TO ENO; RENAME COLUMN • ALTER TABLE EMP RENAME COLUMN EMPNO TO ENO;
  • 8. DDL - DROP TABLE DROPPED • DROP TABLE EMP; • DROP TABLE EMP PURGE; • PURGE RECYCLEBIN; • PURGE TABLE EMP; TABLE DROPPED • DROP TABLE EMP; • DROP TABLE EMP PURGE; • PURGE RECYCLEBIN; • PURGE TABLE EMP; FLASHBACK COMMAND • Flashback table emp to before drop; • Flashback table emp to before drop rename to employees; FLASHBACK COMMAND • Flashback table emp to before drop; • Flashback table emp to before drop rename to employees;
  • 9. DDL - TRUNCATE • Used to remove records from table. • Cannot delete single row alone • Changes are permanent. So deleted record cannot be rolled back. TRUNCATE TABLE EMP;
  • 10. DDL - RENAME • Used to rename the table. RENAME <OLD_TABLE_NAME> TO <NEW_TAB_NAME>; RENAME EMP TO EMPLOYEES;