SlideShare a Scribd company logo
1 of 23
Click to edit Master title style
1
SQL SHORT NOTES
Pratheesh Kumar N
Click to edit Master title style
2
WHAT IS SQL
SQL is stand for structured query
language.
This database language is mainly
designed for maintaining the data in
relational database management system.
SQL is standard language for accessing
and manipulating database.
2
Click to edit Master title style
3
Some of The Most Important SQL Commands
3
• SELECT - extracts data from a database.
• UPDATE - updates data in a database.
• DELETE - deletes data from a database.
• INSERT INTO - inserts new data into a
database.
• CREATE DATABASE - creates a new database.
• ALTER DATABASE - modifies a database.
• CREATE TABLE - creates a new table.
Click to edit Master title style
4
DDL COMMANDS:
DDL(data Definition Languages) used to
change the structure of the table like creating
the table ,altering the tables & deleting the
table.
All the commands in the DDL are auto
committed that means it permanently saves all
the changes in the data base .
4
Click to edit Master title style
5
CREATE:
This commands is used to create a new
database and table.
Syntax:
CREATE TABLE table_name
(
column1 datatype,
column2 datatype,
column3 datatype,
…..
); 5
Click to edit Master title style
6
ALTER:
The ALTER TABLE statement in structured
Query language allows you to add ,modify ,add
delete columns of an existing table.
Syntax:
ALTER TABLE table_name
ADD “column_name” datatype;
Example:
ALTER TABLE employee
ADD “Email” varchar(255); 6
Click to edit Master title style
7
DROP:
The DROP TABLE statement in used
to drop an existing table in a
database. This command deletes both
the structure & records stored in table.
Syntax:
DROP TABLE table_name;
Example:
Drop TABLE Employee; 7
Click to edit Master title style
8
TRUNCATE:
The truncate SQL statement is used to
remove all rows from a table. It is similar to
the DELETE statement with no WHERE
clause.
Syntax:
TRUNCATE TABLE table_name;
Example:
TRUNCATE TABLE Employee; 8
Click to edit Master title style
9 9
Click to edit Master title style
10
DML COMMANDS:
Data manipulation language (DML)
commands in SQL deals with
manipulations of data records stored with
in the database tables.
 it does not deal with changes to database
object and its structure. The commonly
knows DML commands are
INSERT,UPDATE and DELETE.
10
Click to edit Master title style
11
To delete the field from a table:
11
•ALTER TABLE “TABLE NAME” DROP
“FIELD NAME”;
•EXAMPLE:-
•ALTER TABLE “employee” DROP “age”;
Click to edit Master title style
12
Delete all records from table
12
• DELETE FROM “TABLE NAME”;
• EXAMPLE:-
• DELETE TABLE “employee”;
Click to edit Master title style
13
Delete records from a table using condition
13
• DELETE FROM “TABLE NAME” WHERE “CONDITION” VALUE
• CONDITION IS
• “FIELD NAME” CHECKING OPERATOR WITH VALUE
Click to edit Master title style
14
INSERT:
SQL INSERT statement is a SQL query .it is
used to insert a single or a multiple records in a
table.
Syntax:
INSERT INTO table_name
VALUES(value1,value2,value3…);
Example:
INSERT INTO
STUDENTS(ROLL_NO,NAME,AGE,CITY)
VALUES(1,yadnyesh,19,PUNE); 14
Click to edit Master title style
15
UPDATE:
The UPDATE s tatement is us ed to modify the exis ting
r ec or ds in a table.
Syntax:
UPDATE table_name
SET c olumn1_value1,c olumn2=value2,…
W H ER E c ondition;
Example:
U PD ATE c us tomers
SET c ontac tN ame = ‘yadu ’,c ity= ‘ p u n e ’
W H ER E C us tomer ID = 101;
15
Click to edit Master title style
16
DELETE:
The DELETE
Syntax:
ALTER TABLE table_name
ADD column_name datatype;
Example:
ALTER TABLE employee
ADD Email varchar(255); 16
Click to edit Master title style
17
DCL COMMANDS:
DCL is abstract of data control Language DCL
include commands such as GRANT , and is
concerned with rights , permission, and other
controls of the database system.
17
Click to edit Master title style
18
GRANT:
It is used to give user access
privileges to a database.
Syntax:
GRANT SELECT,UPDATE ON
MY_TABLE TO SOME_USER,
ANOTHER_USER;
18
Click to edit Master title style
19
REVOKE:
GRANT SELECT,UPDATE ON
MY_TABLE TO SOME_USER,
ANOTHER_USER;
Syntax:
REVOKE SELECT,UPDATE ON
MY_TABLE FROM USER1,USER2;
19
Click to edit Master title style
20
TCL COMMANDS:
TCL(Transaction control language) a single
unit of work in a database is formed after the
consecutive execution of commands is known
as a transaction.
20
Click to edit Master title style
21
COMMIT:
Commits a transaction The COMMIT
command saves all the transactions to the
database since the last COMMIT or
ROLLBACK command.
Syntax:
COMMIT;
Example:
DELETE FROM student WHERE AGE=20;
COMMIT; 21
Click to edit Master title style
22
ROLLBACK:
If any error occurs with any of the SQL grouped
statements , all change need to be aborted .The
process of reversing changes is
Called rollback.
Syntax:
ROLLBACK;
Example:
DELETE FROM student WHERE AGE=20;
ROLLBACK; 22
Click to edit Master title style
23
Thank You

More Related Content

Similar to SQL-SHORT-NOTES.pptx

SQL Queries - DDL Commands
SQL Queries - DDL CommandsSQL Queries - DDL Commands
SQL Queries - DDL CommandsShubhamBauddh
 
Himani uppal-221302130 WP ppt.pptx
Himani uppal-221302130  WP ppt.pptxHimani uppal-221302130  WP ppt.pptx
Himani uppal-221302130 WP ppt.pptxMohitYadav889220
 
COMPUTERS SQL
COMPUTERS SQL COMPUTERS SQL
COMPUTERS SQL Rc Os
 
COMMANDS PPT(1).pdf
COMMANDS PPT(1).pdfCOMMANDS PPT(1).pdf
COMMANDS PPT(1).pdfBrahmamKolli
 
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...SakkaravarthiS1
 
introdution to SQL and SQL functions
introdution to SQL and SQL functionsintrodution to SQL and SQL functions
introdution to SQL and SQL functionsfarwa waqar
 
Sql smart reference_by_prasad
Sql smart reference_by_prasadSql smart reference_by_prasad
Sql smart reference_by_prasadpaddu123
 
Sql smart reference_by_prasad
Sql smart reference_by_prasadSql smart reference_by_prasad
Sql smart reference_by_prasadpaddu123
 
Sql Commands_Dr.R.Shalini.ppt
Sql Commands_Dr.R.Shalini.pptSql Commands_Dr.R.Shalini.ppt
Sql Commands_Dr.R.Shalini.pptDrRShaliniVISTAS
 
Database models and DBMS languages
Database models and DBMS languagesDatabase models and DBMS languages
Database models and DBMS languagesDivyaKS12
 
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptxMy lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptxEliasPetros
 
Getting Started with MySQL I
Getting Started with MySQL IGetting Started with MySQL I
Getting Started with MySQL ISankhya_Analytics
 
BCS4L1-Database Management lab.pdf
BCS4L1-Database Management lab.pdfBCS4L1-Database Management lab.pdf
BCS4L1-Database Management lab.pdfKeerthanaP37
 
Sql basics and DDL statements
Sql basics and DDL statementsSql basics and DDL statements
Sql basics and DDL statementsMohd Tousif
 

Similar to SQL-SHORT-NOTES.pptx (20)

SQL Queries - DDL Commands
SQL Queries - DDL CommandsSQL Queries - DDL Commands
SQL Queries - DDL Commands
 
Himani uppal-221302130 WP ppt.pptx
Himani uppal-221302130  WP ppt.pptxHimani uppal-221302130  WP ppt.pptx
Himani uppal-221302130 WP ppt.pptx
 
SQL
SQLSQL
SQL
 
MySQL Essential Training
MySQL Essential TrainingMySQL Essential Training
MySQL Essential Training
 
COMPUTERS SQL
COMPUTERS SQL COMPUTERS SQL
COMPUTERS SQL
 
COMMANDS PPT(1).pdf
COMMANDS PPT(1).pdfCOMMANDS PPT(1).pdf
COMMANDS PPT(1).pdf
 
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...
 
lovely
lovelylovely
lovely
 
introdution to SQL and SQL functions
introdution to SQL and SQL functionsintrodution to SQL and SQL functions
introdution to SQL and SQL functions
 
Sql smart reference_by_prasad
Sql smart reference_by_prasadSql smart reference_by_prasad
Sql smart reference_by_prasad
 
Sql smart reference_by_prasad
Sql smart reference_by_prasadSql smart reference_by_prasad
Sql smart reference_by_prasad
 
Lab2 ddl commands
Lab2 ddl commandsLab2 ddl commands
Lab2 ddl commands
 
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
 
DBMS.pdf
DBMS.pdfDBMS.pdf
DBMS.pdf
 
Sql Commands_Dr.R.Shalini.ppt
Sql Commands_Dr.R.Shalini.pptSql Commands_Dr.R.Shalini.ppt
Sql Commands_Dr.R.Shalini.ppt
 
Database models and DBMS languages
Database models and DBMS languagesDatabase models and DBMS languages
Database models and DBMS languages
 
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptxMy lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
My lablkxjlkxjcvlxkcjvlxckjvlxck ppt.pptx
 
Getting Started with MySQL I
Getting Started with MySQL IGetting Started with MySQL I
Getting Started with MySQL I
 
BCS4L1-Database Management lab.pdf
BCS4L1-Database Management lab.pdfBCS4L1-Database Management lab.pdf
BCS4L1-Database Management lab.pdf
 
Sql basics and DDL statements
Sql basics and DDL statementsSql basics and DDL statements
Sql basics and DDL statements
 

Recently uploaded

Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxabhijeetpadhi001
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 

Recently uploaded (20)

Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptx
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 

SQL-SHORT-NOTES.pptx

  • 1. Click to edit Master title style 1 SQL SHORT NOTES Pratheesh Kumar N
  • 2. Click to edit Master title style 2 WHAT IS SQL SQL is stand for structured query language. This database language is mainly designed for maintaining the data in relational database management system. SQL is standard language for accessing and manipulating database. 2
  • 3. Click to edit Master title style 3 Some of The Most Important SQL Commands 3 • SELECT - extracts data from a database. • UPDATE - updates data in a database. • DELETE - deletes data from a database. • INSERT INTO - inserts new data into a database. • CREATE DATABASE - creates a new database. • ALTER DATABASE - modifies a database. • CREATE TABLE - creates a new table.
  • 4. Click to edit Master title style 4 DDL COMMANDS: DDL(data Definition Languages) used to change the structure of the table like creating the table ,altering the tables & deleting the table. All the commands in the DDL are auto committed that means it permanently saves all the changes in the data base . 4
  • 5. Click to edit Master title style 5 CREATE: This commands is used to create a new database and table. Syntax: CREATE TABLE table_name ( column1 datatype, column2 datatype, column3 datatype, ….. ); 5
  • 6. Click to edit Master title style 6 ALTER: The ALTER TABLE statement in structured Query language allows you to add ,modify ,add delete columns of an existing table. Syntax: ALTER TABLE table_name ADD “column_name” datatype; Example: ALTER TABLE employee ADD “Email” varchar(255); 6
  • 7. Click to edit Master title style 7 DROP: The DROP TABLE statement in used to drop an existing table in a database. This command deletes both the structure & records stored in table. Syntax: DROP TABLE table_name; Example: Drop TABLE Employee; 7
  • 8. Click to edit Master title style 8 TRUNCATE: The truncate SQL statement is used to remove all rows from a table. It is similar to the DELETE statement with no WHERE clause. Syntax: TRUNCATE TABLE table_name; Example: TRUNCATE TABLE Employee; 8
  • 9. Click to edit Master title style 9 9
  • 10. Click to edit Master title style 10 DML COMMANDS: Data manipulation language (DML) commands in SQL deals with manipulations of data records stored with in the database tables.  it does not deal with changes to database object and its structure. The commonly knows DML commands are INSERT,UPDATE and DELETE. 10
  • 11. Click to edit Master title style 11 To delete the field from a table: 11 •ALTER TABLE “TABLE NAME” DROP “FIELD NAME”; •EXAMPLE:- •ALTER TABLE “employee” DROP “age”;
  • 12. Click to edit Master title style 12 Delete all records from table 12 • DELETE FROM “TABLE NAME”; • EXAMPLE:- • DELETE TABLE “employee”;
  • 13. Click to edit Master title style 13 Delete records from a table using condition 13 • DELETE FROM “TABLE NAME” WHERE “CONDITION” VALUE • CONDITION IS • “FIELD NAME” CHECKING OPERATOR WITH VALUE
  • 14. Click to edit Master title style 14 INSERT: SQL INSERT statement is a SQL query .it is used to insert a single or a multiple records in a table. Syntax: INSERT INTO table_name VALUES(value1,value2,value3…); Example: INSERT INTO STUDENTS(ROLL_NO,NAME,AGE,CITY) VALUES(1,yadnyesh,19,PUNE); 14
  • 15. Click to edit Master title style 15 UPDATE: The UPDATE s tatement is us ed to modify the exis ting r ec or ds in a table. Syntax: UPDATE table_name SET c olumn1_value1,c olumn2=value2,… W H ER E c ondition; Example: U PD ATE c us tomers SET c ontac tN ame = ‘yadu ’,c ity= ‘ p u n e ’ W H ER E C us tomer ID = 101; 15
  • 16. Click to edit Master title style 16 DELETE: The DELETE Syntax: ALTER TABLE table_name ADD column_name datatype; Example: ALTER TABLE employee ADD Email varchar(255); 16
  • 17. Click to edit Master title style 17 DCL COMMANDS: DCL is abstract of data control Language DCL include commands such as GRANT , and is concerned with rights , permission, and other controls of the database system. 17
  • 18. Click to edit Master title style 18 GRANT: It is used to give user access privileges to a database. Syntax: GRANT SELECT,UPDATE ON MY_TABLE TO SOME_USER, ANOTHER_USER; 18
  • 19. Click to edit Master title style 19 REVOKE: GRANT SELECT,UPDATE ON MY_TABLE TO SOME_USER, ANOTHER_USER; Syntax: REVOKE SELECT,UPDATE ON MY_TABLE FROM USER1,USER2; 19
  • 20. Click to edit Master title style 20 TCL COMMANDS: TCL(Transaction control language) a single unit of work in a database is formed after the consecutive execution of commands is known as a transaction. 20
  • 21. Click to edit Master title style 21 COMMIT: Commits a transaction The COMMIT command saves all the transactions to the database since the last COMMIT or ROLLBACK command. Syntax: COMMIT; Example: DELETE FROM student WHERE AGE=20; COMMIT; 21
  • 22. Click to edit Master title style 22 ROLLBACK: If any error occurs with any of the SQL grouped statements , all change need to be aborted .The process of reversing changes is Called rollback. Syntax: ROLLBACK; Example: DELETE FROM student WHERE AGE=20; ROLLBACK; 22
  • 23. Click to edit Master title style 23 Thank You