際際滷

際際滷Share a Scribd company logo
Class Presentation
 SQL
 (DDL & DML)
 Submitted By: Submitted To:
 Sharad Dubey Vani Mam
SQL
 SQL is Structured Query Language, which is a
computer language for storing, manipulating
and retrieving data stored in a relational
database.
 SQL was the first commercial language
introduced for E.F Codd's Relational model.
 Today almost all RDBMS ( MySql, Oracle,
Infomix, Sybase, MS Access) uses SQL as the
standard database language..
 SQL functions fit into two broad categories :
Data definition language (DDL)
Data manipulation language (DML)
 Based on relational algebra, but not entirely
identical.
Relations  Tables
Tuples  Rows
Attributes  Columns
DML
 Data Manipulation Language (DML)
statements are used for managing data within
database.
 DML commands are not auto-committed. It
means changes are not permanent to
database, they can be rolled back.
Command Description
insert to insert a new row
update to update existing row
delete to delete a row
merge merging two rows or two tables
DML Commands
Insert Command
 Insert command is used to insert data into a
table.
 Following is its general syntax,
INSERT into table-name values(data1,data2.)
 For e.g.-
Consider a table Student with following fields.
S_id S_Name age
 INSERT into Student values(101,'Adam',15);
The above command will insert a record
into Student table.
S_id S_Name age
101 Adam 15
Update Command
 Update command is used to update a row of a
table.
 Following is its general syntax,
UPDATE table-name set column-name = value
where condition;
S_id S_Name age
101 Adam 15
102 Alex 18
103 chris 14
 UPDATE Student set s_name='Abhi',age=17
where s_id=103;
The above command will update two columns
of a record.
S_id S_Name age
101 Adam 15
102 Alex 18
103 Abhi 17
Delete command
 Delete command is used to delete data from a
table. Delete command can also be used with
condition to delete a particular row.
 Following is its general syntax,
DELETE from table-name ;
 Example to Delete all Records from a Table:
DELETE from Student;
The above command will delete all the records
from Student table.
Example to Delete a particular Record from a
Table
S_id S_Name age
101 Adam 15
102 Alex 18
103 Abhi 17
 Consider the following Student table
DELETE from Student where s_id=103;
The above command will delete the record
where s_id is 103 from Student table.
S_id S_Name age
101 Adam 15
102 Alex 18
DDL
 Data Definition Language (DDL) statements
are used to define the database structure or
schema.
 All DDL commands are auto-committed. That
means it saves all the changes permanently in
the database.
DDL Commands
Command Description
create to create new table or database
alter for alteration
truncate delete data from table
drop to drop a table
rename to rename a table
Create Command
 Create is a DDL command used to create a
table or a database.
 Following is the Syntax,
create database database-name;
 Example for Creating Database,
create database Test;
Alter Command
 Alter command is used for alteration of table
structures. There are various uses
of alter command, such as,
to add a column to existing table
to rename any existing column
to change datatype of any column or to
modify its size.
alter is also used to drop a column
Truncate Command
 Truncate command removes all records from
a table. But this command will not destroy the
table's structure. When we apply truncate
command on a table its Primary key is
initialized.
 Following is its Syntax,
truncate table table-name;
Drop Command
 Drop query completely removes a table from
database. This command will also destroy the
table structure.
 Following is its Syntax,
drop table table-name;
 For Example-
drop table Student;
Rename Command
 Rename command is used to rename a table.
 Following is its Syntax,
rename table old-table-name to new-table-name;
 For Example-
rename table Student to Student-record;
The above query will rename Student table
to Student-record.
SQL(DDL & DML)

More Related Content

What's hot (20)

Codd's rules
Codd's rulesCodd's rules
Codd's rules
Mohd Arif
Introduction to Database
Introduction to DatabaseIntroduction to Database
Introduction to Database
Siti Ismail
Presentation on Database management system
Presentation on Database management systemPresentation on Database management system
Presentation on Database management system
Prerana Bhattarai
Transaction management DBMS
Transaction  management DBMSTransaction  management DBMS
Transaction management DBMS
Megha Patel
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
LGS, GBHS&IC, University Of South-Asia, TARA-Technologies
Databases: Normalisation
Databases: NormalisationDatabases: Normalisation
Databases: Normalisation
Damian T. Gordon
Aggregate function
Aggregate functionAggregate function
Aggregate function
Rayhan Chowdhury
Sql subquery
Sql  subquerySql  subquery
Sql subquery
Raveena Thakur
SQL - Structured query language introduction
SQL - Structured query language introductionSQL - Structured query language introduction
SQL - Structured query language introduction
Smriti Jain
Jdbc ppt
Jdbc pptJdbc ppt
Jdbc ppt
Vikas Jagtap
Dbms Notes Lecture 9 : Specialization, Generalization and Aggregation
Dbms Notes Lecture 9 : Specialization, Generalization and AggregationDbms Notes Lecture 9 : Specialization, Generalization and Aggregation
Dbms Notes Lecture 9 : Specialization, Generalization and Aggregation
BIT Durg
Integrity Constraints
Integrity ConstraintsIntegrity Constraints
Integrity Constraints
madhav bansal
1. Introduction to DBMS
1. Introduction to DBMS1. Introduction to DBMS
1. Introduction to DBMS
koolkampus
DDL And DML
DDL And DMLDDL And DML
DDL And DML
pnp @in
Unit 1: Introduction to DBMS Unit 1 Complete
Unit 1: Introduction to DBMS Unit 1 CompleteUnit 1: Introduction to DBMS Unit 1 Complete
Unit 1: Introduction to DBMS Unit 1 Complete
Raj vardhan
JDBC: java DataBase connectivity
JDBC: java DataBase connectivityJDBC: java DataBase connectivity
JDBC: java DataBase connectivity
Tanmoy Barman
Introduction to database & sql
Introduction to database & sqlIntroduction to database & sql
Introduction to database & sql
zahid6
DATABASE CONSTRAINTS
DATABASE CONSTRAINTSDATABASE CONSTRAINTS
DATABASE CONSTRAINTS
sunanditaAnand
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
Prateek Parimal
SQL - DML and DDL Commands
SQL - DML and DDL CommandsSQL - DML and DDL Commands
SQL - DML and DDL Commands
Shrija Madhu
Codd's rules
Codd's rulesCodd's rules
Codd's rules
Mohd Arif
Introduction to Database
Introduction to DatabaseIntroduction to Database
Introduction to Database
Siti Ismail
Presentation on Database management system
Presentation on Database management systemPresentation on Database management system
Presentation on Database management system
Prerana Bhattarai
Transaction management DBMS
Transaction  management DBMSTransaction  management DBMS
Transaction management DBMS
Megha Patel
Databases: Normalisation
Databases: NormalisationDatabases: Normalisation
Databases: Normalisation
Damian T. Gordon
SQL - Structured query language introduction
SQL - Structured query language introductionSQL - Structured query language introduction
SQL - Structured query language introduction
Smriti Jain
Dbms Notes Lecture 9 : Specialization, Generalization and Aggregation
Dbms Notes Lecture 9 : Specialization, Generalization and AggregationDbms Notes Lecture 9 : Specialization, Generalization and Aggregation
Dbms Notes Lecture 9 : Specialization, Generalization and Aggregation
BIT Durg
Integrity Constraints
Integrity ConstraintsIntegrity Constraints
Integrity Constraints
madhav bansal
1. Introduction to DBMS
1. Introduction to DBMS1. Introduction to DBMS
1. Introduction to DBMS
koolkampus
DDL And DML
DDL And DMLDDL And DML
DDL And DML
pnp @in
Unit 1: Introduction to DBMS Unit 1 Complete
Unit 1: Introduction to DBMS Unit 1 CompleteUnit 1: Introduction to DBMS Unit 1 Complete
Unit 1: Introduction to DBMS Unit 1 Complete
Raj vardhan
JDBC: java DataBase connectivity
JDBC: java DataBase connectivityJDBC: java DataBase connectivity
JDBC: java DataBase connectivity
Tanmoy Barman
Introduction to database & sql
Introduction to database & sqlIntroduction to database & sql
Introduction to database & sql
zahid6
DATABASE CONSTRAINTS
DATABASE CONSTRAINTSDATABASE CONSTRAINTS
DATABASE CONSTRAINTS
sunanditaAnand
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
Prateek Parimal
SQL - DML and DDL Commands
SQL - DML and DDL CommandsSQL - DML and DDL Commands
SQL - DML and DDL Commands
Shrija Madhu

Similar to SQL(DDL & DML) (20)

introdution to SQL and SQL functions
introdution to SQL and SQL functionsintrodution to SQL and SQL functions
introdution to SQL and SQL functions
farwa waqar
Unit - II.pptx
Unit - II.pptxUnit - II.pptx
Unit - II.pptx
MrsSavitaKumbhare
Lecture - MY-SQL/ SQL Commands - DDL.pptx
Lecture - MY-SQL/ SQL Commands - DDL.pptxLecture - MY-SQL/ SQL Commands - DDL.pptx
Lecture - MY-SQL/ SQL Commands - DDL.pptx
umershah0263
Introduction to油database and sql fir beginers
Introduction to油database and sql fir beginersIntroduction to油database and sql fir beginers
Introduction to油database and sql fir beginers
reshmi30
Sql smart reference_by_prasad
Sql smart reference_by_prasadSql smart reference_by_prasad
Sql smart reference_by_prasad
paddu123
Sql smart reference_by_prasad
Sql smart reference_by_prasadSql smart reference_by_prasad
Sql smart reference_by_prasad
paddu123
SQL_NOTES.pdf
SQL_NOTES.pdfSQL_NOTES.pdf
SQL_NOTES.pdf
AnshumanDwivedi14
UNIT2.ppt
UNIT2.pptUNIT2.ppt
UNIT2.ppt
SaurabhLokare1
Relational Database Language.pptx
Relational Database Language.pptxRelational Database Language.pptx
Relational Database Language.pptx
Sheethal Aji Mani
SQL-SHORT-NOTES.pptx
SQL-SHORT-NOTES.pptxSQL-SHORT-NOTES.pptx
SQL-SHORT-NOTES.pptx
PratheeshKumarN
Database COMPLETE
Database COMPLETEDatabase COMPLETE
Database COMPLETE
Abrar ali
Sql Commands_Dr.R.Shalini.ppt
Sql Commands_Dr.R.Shalini.pptSql Commands_Dr.R.Shalini.ppt
Sql Commands_Dr.R.Shalini.ppt
DrRShaliniVISTAS
unit-5 sql notes.docx
unit-5 sql notes.docxunit-5 sql notes.docx
unit-5 sql notes.docx
RaviRajput416403
8. sql
8. sql8. sql
8. sql
khoahuy82
SQl data base management and design
SQl     data base management  and designSQl     data base management  and design
SQl data base management and design
franckelsania20
SQL.pptx for the begineers and good know
SQL.pptx for the begineers and good knowSQL.pptx for the begineers and good know
SQL.pptx for the begineers and good know
PavithSingh
Himani uppal-221302130 WP ppt.pptx
Himani uppal-221302130  WP ppt.pptxHimani uppal-221302130  WP ppt.pptx
Himani uppal-221302130 WP ppt.pptx
MohitYadav889220
MySQL Essential Training
MySQL Essential TrainingMySQL Essential Training
MySQL Essential Training
HudaRaghibKadhim
Database Management System PART- II.pptx
Database Management System PART- II.pptxDatabase Management System PART- II.pptx
Database Management System PART- II.pptx
errvmaurya563
SQL: Data Definition Language(DDL) command
SQL: Data Definition Language(DDL) commandSQL: Data Definition Language(DDL) command
SQL: Data Definition Language(DDL) command
sonali sonavane
introdution to SQL and SQL functions
introdution to SQL and SQL functionsintrodution to SQL and SQL functions
introdution to SQL and SQL functions
farwa waqar
Lecture - MY-SQL/ SQL Commands - DDL.pptx
Lecture - MY-SQL/ SQL Commands - DDL.pptxLecture - MY-SQL/ SQL Commands - DDL.pptx
Lecture - MY-SQL/ SQL Commands - DDL.pptx
umershah0263
Introduction to油database and sql fir beginers
Introduction to油database and sql fir beginersIntroduction to油database and sql fir beginers
Introduction to油database and sql fir beginers
reshmi30
Sql smart reference_by_prasad
Sql smart reference_by_prasadSql smart reference_by_prasad
Sql smart reference_by_prasad
paddu123
Sql smart reference_by_prasad
Sql smart reference_by_prasadSql smart reference_by_prasad
Sql smart reference_by_prasad
paddu123
Relational Database Language.pptx
Relational Database Language.pptxRelational Database Language.pptx
Relational Database Language.pptx
Sheethal Aji Mani
Database COMPLETE
Database COMPLETEDatabase COMPLETE
Database COMPLETE
Abrar ali
Sql Commands_Dr.R.Shalini.ppt
Sql Commands_Dr.R.Shalini.pptSql Commands_Dr.R.Shalini.ppt
Sql Commands_Dr.R.Shalini.ppt
DrRShaliniVISTAS
SQl data base management and design
SQl     data base management  and designSQl     data base management  and design
SQl data base management and design
franckelsania20
SQL.pptx for the begineers and good know
SQL.pptx for the begineers and good knowSQL.pptx for the begineers and good know
SQL.pptx for the begineers and good know
PavithSingh
Himani uppal-221302130 WP ppt.pptx
Himani uppal-221302130  WP ppt.pptxHimani uppal-221302130  WP ppt.pptx
Himani uppal-221302130 WP ppt.pptx
MohitYadav889220
MySQL Essential Training
MySQL Essential TrainingMySQL Essential Training
MySQL Essential Training
HudaRaghibKadhim
Database Management System PART- II.pptx
Database Management System PART- II.pptxDatabase Management System PART- II.pptx
Database Management System PART- II.pptx
errvmaurya563
SQL: Data Definition Language(DDL) command
SQL: Data Definition Language(DDL) commandSQL: Data Definition Language(DDL) command
SQL: Data Definition Language(DDL) command
sonali sonavane

Recently uploaded (20)

How to Configure Flexible Working Schedule in Odoo 18 Employee
How to Configure Flexible Working Schedule in Odoo 18 EmployeeHow to Configure Flexible Working Schedule in Odoo 18 Employee
How to Configure Flexible Working Schedule in Odoo 18 Employee
Celine George
Mate, a short story by Kate Grenvile.pptx
Mate, a short story by Kate Grenvile.pptxMate, a short story by Kate Grenvile.pptx
Mate, a short story by Kate Grenvile.pptx
Liny Jenifer
The Dravidian Languages: Tamil, Telugu, Kannada, Malayalam, Brahui, Kuvi, Tulu
The Dravidian Languages: Tamil, Telugu, Kannada, Malayalam, Brahui, Kuvi, TuluThe Dravidian Languages: Tamil, Telugu, Kannada, Malayalam, Brahui, Kuvi, Tulu
The Dravidian Languages: Tamil, Telugu, Kannada, Malayalam, Brahui, Kuvi, Tulu
DrIArulAram
Kaun TALHA quiz Finals -- El Dorado 2025
Kaun TALHA quiz Finals -- El Dorado 2025Kaun TALHA quiz Finals -- El Dorado 2025
Kaun TALHA quiz Finals -- El Dorado 2025
Conquiztadors- the Quiz Society of Sri Venkateswara College
Information Technology for class X CBSE skill Subject
Information Technology for class X CBSE skill SubjectInformation Technology for class X CBSE skill Subject
Information Technology for class X CBSE skill Subject
VEENAKSHI PATHAK
How to Modify Existing Web Pages in Odoo 18
How to Modify Existing Web Pages in Odoo 18How to Modify Existing Web Pages in Odoo 18
How to Modify Existing Web Pages in Odoo 18
Celine George
DUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAM
DUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAMDUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAM
DUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAM
vlckovar
N.C. DPI's 2023 Language Diversity Briefing
N.C. DPI's 2023 Language Diversity BriefingN.C. DPI's 2023 Language Diversity Briefing
N.C. DPI's 2023 Language Diversity Briefing
Mebane Rash
A PPT Presentation on The Princess and the God: A tale of ancient India by A...
A PPT Presentation on The Princess and the God: A tale of ancient India  by A...A PPT Presentation on The Princess and the God: A tale of ancient India  by A...
A PPT Presentation on The Princess and the God: A tale of ancient India by A...
Beena E S
APM People Interest Network Conference - Oliver Randall & David Bovis - Own Y...
APM People Interest Network Conference - Oliver Randall & David Bovis - Own Y...APM People Interest Network Conference - Oliver Randall & David Bovis - Own Y...
APM People Interest Network Conference - Oliver Randall & David Bovis - Own Y...
Association for Project Management
Adventure Activities Final By H R Gohil Sir
Adventure Activities Final By H R Gohil SirAdventure Activities Final By H R Gohil Sir
Adventure Activities Final By H R Gohil Sir
GUJARATCOMMERCECOLLE
English 4 Quarter 4 Week 4 Classroom Obs
English 4 Quarter 4 Week 4 Classroom ObsEnglish 4 Quarter 4 Week 4 Classroom Obs
English 4 Quarter 4 Week 4 Classroom Obs
NerissaMendez1
Research & Research Methods: Basic Concepts and Types.pptx
Research & Research Methods: Basic Concepts and Types.pptxResearch & Research Methods: Basic Concepts and Types.pptx
Research & Research Methods: Basic Concepts and Types.pptx
Dr. Sarita Anand
How to Configure Restaurants in Odoo 17 Point of Sale
How to Configure Restaurants in Odoo 17 Point of SaleHow to Configure Restaurants in Odoo 17 Point of Sale
How to Configure Restaurants in Odoo 17 Point of Sale
Celine George
Principle and Practices of Animal Breeding || Boby Basnet
Principle and Practices of Animal Breeding || Boby BasnetPrinciple and Practices of Animal Breeding || Boby Basnet
Principle and Practices of Animal Breeding || Boby Basnet
Boby Basnet
TRANSFER OF PATIENTS IN HOSPITAL SETTING.pptx
TRANSFER OF PATIENTS IN HOSPITAL SETTING.pptxTRANSFER OF PATIENTS IN HOSPITAL SETTING.pptx
TRANSFER OF PATIENTS IN HOSPITAL SETTING.pptx
PoojaSen20
How to attach file using upload button Odoo 18
How to attach file using upload button Odoo 18How to attach file using upload button Odoo 18
How to attach file using upload button Odoo 18
Celine George
QuickBooks Desktop to QuickBooks Online How to Make the Move
QuickBooks Desktop to QuickBooks Online  How to Make the MoveQuickBooks Desktop to QuickBooks Online  How to Make the Move
QuickBooks Desktop to QuickBooks Online How to Make the Move
TechSoup
Year 10 The Senior Phase Session 3 Term 1.pptx
Year 10 The Senior Phase Session 3 Term 1.pptxYear 10 The Senior Phase Session 3 Term 1.pptx
Year 10 The Senior Phase Session 3 Term 1.pptx
mansk2
Useful environment methods in Odoo 18 - Odoo 際際滷s
Useful environment methods in Odoo 18 - Odoo 際際滷sUseful environment methods in Odoo 18 - Odoo 際際滷s
Useful environment methods in Odoo 18 - Odoo 際際滷s
Celine George
How to Configure Flexible Working Schedule in Odoo 18 Employee
How to Configure Flexible Working Schedule in Odoo 18 EmployeeHow to Configure Flexible Working Schedule in Odoo 18 Employee
How to Configure Flexible Working Schedule in Odoo 18 Employee
Celine George
Mate, a short story by Kate Grenvile.pptx
Mate, a short story by Kate Grenvile.pptxMate, a short story by Kate Grenvile.pptx
Mate, a short story by Kate Grenvile.pptx
Liny Jenifer
The Dravidian Languages: Tamil, Telugu, Kannada, Malayalam, Brahui, Kuvi, Tulu
The Dravidian Languages: Tamil, Telugu, Kannada, Malayalam, Brahui, Kuvi, TuluThe Dravidian Languages: Tamil, Telugu, Kannada, Malayalam, Brahui, Kuvi, Tulu
The Dravidian Languages: Tamil, Telugu, Kannada, Malayalam, Brahui, Kuvi, Tulu
DrIArulAram
Information Technology for class X CBSE skill Subject
Information Technology for class X CBSE skill SubjectInformation Technology for class X CBSE skill Subject
Information Technology for class X CBSE skill Subject
VEENAKSHI PATHAK
How to Modify Existing Web Pages in Odoo 18
How to Modify Existing Web Pages in Odoo 18How to Modify Existing Web Pages in Odoo 18
How to Modify Existing Web Pages in Odoo 18
Celine George
DUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAM
DUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAMDUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAM
DUBLIN PROGRAM DUBLIN PROGRAM DUBLIN PROGRAM
vlckovar
N.C. DPI's 2023 Language Diversity Briefing
N.C. DPI's 2023 Language Diversity BriefingN.C. DPI's 2023 Language Diversity Briefing
N.C. DPI's 2023 Language Diversity Briefing
Mebane Rash
A PPT Presentation on The Princess and the God: A tale of ancient India by A...
A PPT Presentation on The Princess and the God: A tale of ancient India  by A...A PPT Presentation on The Princess and the God: A tale of ancient India  by A...
A PPT Presentation on The Princess and the God: A tale of ancient India by A...
Beena E S
APM People Interest Network Conference - Oliver Randall & David Bovis - Own Y...
APM People Interest Network Conference - Oliver Randall & David Bovis - Own Y...APM People Interest Network Conference - Oliver Randall & David Bovis - Own Y...
APM People Interest Network Conference - Oliver Randall & David Bovis - Own Y...
Association for Project Management
Adventure Activities Final By H R Gohil Sir
Adventure Activities Final By H R Gohil SirAdventure Activities Final By H R Gohil Sir
Adventure Activities Final By H R Gohil Sir
GUJARATCOMMERCECOLLE
English 4 Quarter 4 Week 4 Classroom Obs
English 4 Quarter 4 Week 4 Classroom ObsEnglish 4 Quarter 4 Week 4 Classroom Obs
English 4 Quarter 4 Week 4 Classroom Obs
NerissaMendez1
Research & Research Methods: Basic Concepts and Types.pptx
Research & Research Methods: Basic Concepts and Types.pptxResearch & Research Methods: Basic Concepts and Types.pptx
Research & Research Methods: Basic Concepts and Types.pptx
Dr. Sarita Anand
How to Configure Restaurants in Odoo 17 Point of Sale
How to Configure Restaurants in Odoo 17 Point of SaleHow to Configure Restaurants in Odoo 17 Point of Sale
How to Configure Restaurants in Odoo 17 Point of Sale
Celine George
Principle and Practices of Animal Breeding || Boby Basnet
Principle and Practices of Animal Breeding || Boby BasnetPrinciple and Practices of Animal Breeding || Boby Basnet
Principle and Practices of Animal Breeding || Boby Basnet
Boby Basnet
TRANSFER OF PATIENTS IN HOSPITAL SETTING.pptx
TRANSFER OF PATIENTS IN HOSPITAL SETTING.pptxTRANSFER OF PATIENTS IN HOSPITAL SETTING.pptx
TRANSFER OF PATIENTS IN HOSPITAL SETTING.pptx
PoojaSen20
How to attach file using upload button Odoo 18
How to attach file using upload button Odoo 18How to attach file using upload button Odoo 18
How to attach file using upload button Odoo 18
Celine George
QuickBooks Desktop to QuickBooks Online How to Make the Move
QuickBooks Desktop to QuickBooks Online  How to Make the MoveQuickBooks Desktop to QuickBooks Online  How to Make the Move
QuickBooks Desktop to QuickBooks Online How to Make the Move
TechSoup
Year 10 The Senior Phase Session 3 Term 1.pptx
Year 10 The Senior Phase Session 3 Term 1.pptxYear 10 The Senior Phase Session 3 Term 1.pptx
Year 10 The Senior Phase Session 3 Term 1.pptx
mansk2
Useful environment methods in Odoo 18 - Odoo 際際滷s
Useful environment methods in Odoo 18 - Odoo 際際滷sUseful environment methods in Odoo 18 - Odoo 際際滷s
Useful environment methods in Odoo 18 - Odoo 際際滷s
Celine George

SQL(DDL & DML)

  • 1. Class Presentation SQL (DDL & DML) Submitted By: Submitted To: Sharad Dubey Vani Mam
  • 2. SQL SQL is Structured Query Language, which is a computer language for storing, manipulating and retrieving data stored in a relational database. SQL was the first commercial language introduced for E.F Codd's Relational model. Today almost all RDBMS ( MySql, Oracle, Infomix, Sybase, MS Access) uses SQL as the standard database language..
  • 3. SQL functions fit into two broad categories : Data definition language (DDL) Data manipulation language (DML) Based on relational algebra, but not entirely identical. Relations Tables Tuples Rows Attributes Columns
  • 4. DML Data Manipulation Language (DML) statements are used for managing data within database. DML commands are not auto-committed. It means changes are not permanent to database, they can be rolled back.
  • 5. Command Description insert to insert a new row update to update existing row delete to delete a row merge merging two rows or two tables DML Commands
  • 6. Insert Command Insert command is used to insert data into a table. Following is its general syntax, INSERT into table-name values(data1,data2.) For e.g.- Consider a table Student with following fields. S_id S_Name age
  • 7. INSERT into Student values(101,'Adam',15); The above command will insert a record into Student table. S_id S_Name age 101 Adam 15
  • 8. Update Command Update command is used to update a row of a table. Following is its general syntax, UPDATE table-name set column-name = value where condition; S_id S_Name age 101 Adam 15 102 Alex 18 103 chris 14
  • 9. UPDATE Student set s_name='Abhi',age=17 where s_id=103; The above command will update two columns of a record. S_id S_Name age 101 Adam 15 102 Alex 18 103 Abhi 17
  • 10. Delete command Delete command is used to delete data from a table. Delete command can also be used with condition to delete a particular row. Following is its general syntax, DELETE from table-name ; Example to Delete all Records from a Table: DELETE from Student; The above command will delete all the records from Student table.
  • 11. Example to Delete a particular Record from a Table S_id S_Name age 101 Adam 15 102 Alex 18 103 Abhi 17 Consider the following Student table
  • 12. DELETE from Student where s_id=103; The above command will delete the record where s_id is 103 from Student table. S_id S_Name age 101 Adam 15 102 Alex 18
  • 13. DDL Data Definition Language (DDL) statements are used to define the database structure or schema. All DDL commands are auto-committed. That means it saves all the changes permanently in the database.
  • 14. DDL Commands Command Description create to create new table or database alter for alteration truncate delete data from table drop to drop a table rename to rename a table
  • 15. Create Command Create is a DDL command used to create a table or a database. Following is the Syntax, create database database-name; Example for Creating Database, create database Test;
  • 16. Alter Command Alter command is used for alteration of table structures. There are various uses of alter command, such as, to add a column to existing table to rename any existing column to change datatype of any column or to modify its size. alter is also used to drop a column
  • 17. Truncate Command Truncate command removes all records from a table. But this command will not destroy the table's structure. When we apply truncate command on a table its Primary key is initialized. Following is its Syntax, truncate table table-name;
  • 18. Drop Command Drop query completely removes a table from database. This command will also destroy the table structure. Following is its Syntax, drop table table-name; For Example- drop table Student;
  • 19. Rename Command Rename command is used to rename a table. Following is its Syntax, rename table old-table-name to new-table-name; For Example- rename table Student to Student-record; The above query will rename Student table to Student-record.