SlideShare a Scribd company logo
3
Most read
4
Most read
5
Most read
Database System Sunita M. Dol
Page 1
HANDOUT#02
Aim:
Implementation of SQL DML commands: Insert, Update, and Delete
Theory:
The SQL(Structured Query Language) Language has several parts:
1. Data-definition language (DDL). The SQL DDL provides commands for defining
relation schemas, deleting relations, and modifying relation schemas.
2. Interactive data-manipulation language (DML). The SQL DML includes a query
language based on both the relational algebra and the tuple relational calculus. It
includes also commands to insert tuples into, delete tuples from, and modify tuples in
the database.
3. View definition. The SQL DDL includes commands for defining views.
4. Transaction control. SQL includes commands for specifying the beginning and
ending of transactions.
5. Embedded SQL and dynamic SQL. Embedded and dynamic SQL define how SQL
statements can be embedded within general-purpose programming languages, such as
C, C++, Java, PL/I, Cobol, Pascal, and Fortran.
6. Integrity. The SQL DDL includes commands for specifying integrity constraints that
the data stored in the database must satisfy. Updates that violate integrity constraints
are disallowed.
7. Authorization. The SQL DDL includes commands for specifying access rights to
relations and views.
Domain Types in SQL:
char(n). Fixed length character string, with user-specified length n.
varchar(n). Variable length character strings, with user-specified maximum length
n.
int. Integer (a finite subset of the integers that is machine-dependent).
smallint. Small integer (a machine-dependent subset of the integer domain type).
numeric(p,d). Fixed point number, with user-specified precision of p digits, with n
digits to the right of decimal point.
real, double precision. Floating point and double-precision floating point numbers,
with machine-dependent precision.
float(n). Floating point number, with user-specified precision of at least n digits.
Database System Sunita M. Dol
Page 2
DML
The SQL DML includes a query language based on both the relational algebra and the tuple
relational calculus. It includes also commands to
insert tuples into,
delete tuples from, and
modify tuples in the database.
INSERT Command
It is possible to write the INSERT INTO statement in two ways.
• Method 1: The first way specifies both the column names and the values to be
inserted:
INSERT INTO table_name (column1, column2, column3, ...)
VALUES (value1, value2, value3, ...);
• Method 2: If you are adding values for all the columns of the table, you do not
need to specify the column names in the SQL query. However, make sure the
order of the values is in the same order as the columns in the table. The INSERT
INTO syntax would be as follows:
INSERT INTO table_name
VALUES (value1, value2, value3, ...);
You can populate data into a table through select statement over another table provided
another table has a set of fields, which are required to populate first table. Here is the
syntax:
INSERT INTO first_table_name [(column1, column2, ... columnN)]
SELECT column1, column2, ...columnN
FROM second_table_name
[WHERE condition];
Insert multiple rows in relation:
• Method 1:The syntax for the INSERT ALL statement:
INSERT ALL
INTO mytable (column1, column2,... column_n) VALUES (expr1,
expr2,... expr_n)
INTO mytable (column1, column2,... column_n) VALUES (expr1,
expr2,... expr_n)
INTO mytable (column1, column2,... column_n) VALUES (expr1,
expr2,... expr_n)
SELECT * FROM dual;
• Method 2: The syntax for the INSERT statement is
INSERT INTO table_name (column1, column2,...columnN.) VALUES
(&column1, &column2, ... &columnN)
If the type of attribute is CHAR or VARCHAR then use single quote in values
e.g. ‘&column1’ else simple use &column1. For inserting remaining rows, simply
used ‘/’.
Database System Sunita M. Dol
Page 3
UPDATE Command
The syntax for the UPDATE statement when updating a table in SQL is:
UPDATE table
SET column1 = expression1,
column2 = expression2,
...
[WHERE conditions];
OR
The syntax for the SQL UPDATE statement when updating a table with data from
another table is:
UPDATE table1
SET column1 = (SELECT expression1
FROM table2
WHERE conditions)
[WHERE conditions];
OR
The syntax for the SQL UPDATE statement when updating multiple tables (not permitted
in Oracle) is:
UPDATE table1, table2, ...
SET column1 = expression1,
column2 = expression2,
...
WHERE table1.column = table2.column
[AND conditions];
DELETE Command
The syntax for the DELETE statement in SQL is:
DELETE FROM table
[WHERE conditions];
Queries and Output:
CREATE Command and Adding Constraints on Relation
SQL> create table branch
2 (branch_name char(15),
3 branch_city char(15),
4 assets numeric(16,2),
5 primary key(branch_name),
6 check(assets>=0));
Table created.
Database System Sunita M. Dol
Page 4
SQL> desc branch;
Name Null? Type
----------------------------------------- -------- ----------------------------
BRANCH_NAME NOT NULL CHAR(15)
BRANCH_CITY CHAR(15)
ASSETS NUMBER(16,2)
INSERT Command
SQL> insert into branch(branch_name,branch_city,assets)
values('&branch_name','&branch_city',&assets
);
Enter value for branch_name: Brighton
Enter value for branch_city: Brooklyn
Enter value for assets: 7100000
old 1: insert into branch(branch_name,branch_city,assets)
values('&branch_name','&branch_city',&assets)
new 1: insert into branch(branch_name,branch_city,assets)
values('Brighton','Brooklyn',7100000)
1 row created.
.
.
SQL> select * from branch;
BRANCH_NAME BRANCH_CITY ASSETS
--------------- --------------- ----------
Brighton Brooklyn 7100000
Downtown Brooklyn 9000000
Mianus Horseneck 400000
North Town Rye 3700000
Perryridge Horseneck 1700000
Pownal Bennington 300000
Redwood Palo Alto 2100000
Round Hill Horseneck 8000000
8 rows selected.
SQL> create table account
2 (account_number char(10),
3 branch_name char(15),
Database System Sunita M. Dol
Page 5
4 balance numeric(12,2),
5 primary key(account_number),
6 foreign key(branch_name)references branch,
7 check(balance>=0));
Table created.
SQL> desc account;
Name Null? Type
----------------------------------------- -------- ----------------------------
ACCOUNT_NUMBER NOT NULL CHAR(10)
BRANCH_NAME CHAR(15)
BALANCE NUMBER(12,2)
SQL> insert into account(account_number,branch_name,balance)
values('&account_number','&branch_name'
,&balance);
Enter value for account_number: A-101
Enter value for branch_name: Downtown
Enter value for balance: 500
old 1: insert into account(account_number,branch_name,balance)
values('&account_number','&branch_name'
,&balance)
new 1: insert into account(account_number,branch_name,balance) values('A-
101','Downtown',500)
1 row created.
.
.
.
SQL> select * from account;
ACCOUNT_NU BRANCH_NAME BALANCE
---------- --------------- ----------
A-101 Downtown 500
A-102 Perryridge 400
A-201 Brighton 900
A-215 Mianus 700
A-217 Brighton 750
A-222 Redwood 700
Database System Sunita M. Dol
Page 6
A-305 Round Hill 350
7 rows selected.
SQL> create table student(roll_no char(10),first_name char(30),middle_name
char(30),last_name char(3
0),address char(50),city char(20),pincode numeric(6,0),state char(20),mobile_number integer);
Table created.
UPDATE Command
SQL> select * from student;
ROLL_NO FIRST_NAME MIDDLE_NAME
---------- ------------------------------ ------------------------------
LAST_NAME
------------------------------
ADDRESS CITY
-------------------------------------------------- --------------------
PINCODE STATE MOBILE_NUM
---------- -------------------- ----------
TECSE-16 Namrata M
Bura
Bhadrawati peth Solapur
413005 Maharashtra 9421067511
ROLL_NO FIRST_NAME MIDDLE_NAME
---------- ------------------------------ ------------------------------
LAST_NAME
------------------------------
ADDRESS CITY
-------------------------------------------------- --------------------
PINCODE STATE MOBILE_NUM
---------- -------------------- ----------
TECSE-26 Pradnya N
Dudam
Sakhar Peth Solapur
413005 Maharashtra 7745865343
Database System Sunita M. Dol
Page 7
SQL> update student set middle_name='Minesh' where roll_no='TECSE-16';
1 row updated.
SQL> select * from student;
ROLL_NO FIRST_NAME MIDDLE_NAME
---------- ------------------------------ ------------------------------
LAST_NAME
------------------------------
ADDRESS CITY
-------------------------------------------------- --------------------
PINCODE STATE MOBILE_NUM
---------- -------------------- ----------
TECSE-16 Namrata Minesh
Bura
Bhadrawati peth Solapur
413005 Maharashtra 9421067511
ROLL_NO FIRST_NAME MIDDLE_NAME
---------- ------------------------------ ------------------------------
LAST_NAME
------------------------------
ADDRESS CITY
-------------------------------------------------- --------------------
PINCODE STATE MOBILE_NUM
---------- -------------------- ----------
TECSE-26 Pradnya N
Dudam
Sakhar Peth Solapur
413005 Maharashtra 7745865343
DELETE Command
SQL> delete from student where roll_no='TECSE-26';
1 row deleted.
Database System Sunita M. Dol
Page 8
SQL> select * from student;
ROLL_NO FIRST_NAME MIDDLE_NAME
---------- ------------------------------ ------------------------------
LAST_NAME
------------------------------
ADDRESS CITY
-------------------------------------------------- --------------------
PINCODE STATE MOBILE_NUM
---------- -------------------- ----------
TECSE-16 Namrata Minesh
Bura
Bhadrawati peth Solapur
413005 Maharashtra 9421067511
Conclusion:
We have studied the various DML commands like
a. INSERT command
b. DELETE command
c. UPDATE command
References:
• Database system concepts by Abraham Silberschatz, Henry F. Korth, S. Sudarshan
(McGraw Hill International Edition) sixth edition.
• Database system concepts by Abraham Silberschatz, Henry F. Korth, S. Sudarshan
(McGraw Hill International Edition) fifth edition.
• http://codex.cs.yale.edu/avi/db-book/db4/slide-dir/
• http://codex.cs.yale.edu/avi/db-book/db5/slide-dir/
• http://codex.cs.yale.edu/avi/db-book/db6/slide-dir/

More Related Content

PPTX
Deterministic Finite Automata
DOCX
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...
PPTX
PPTX
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
PPTX
DATABASE MANAGMENT SYSTEM (DBMS) AND SQL
PPTX
MIS 301 RELATIONAL DATABASE MANAGEMENT SYSTEM 10,11&12.pptx
PDF
SQL for data scientist And data analysist Advanced
PDF
40483130 introduction-to-sql
Deterministic Finite Automata
Unit-1 SQL fundamentals.docx SQL commands used to create table, insert values...
hjkjlboiupoiuuouoiuoiuoiuoiuoiuoippt.pptx
DATABASE MANAGMENT SYSTEM (DBMS) AND SQL
MIS 301 RELATIONAL DATABASE MANAGEMENT SYSTEM 10,11&12.pptx
SQL for data scientist And data analysist Advanced
40483130 introduction-to-sql

Similar to Assignment#02 (20)

PDF
CS3481_Database Management Laboratory .pdf
PDF
Rdbms day3
PPTX
MS SQL - Database Programming Concepts by RSolutions
PPT
Database queries
PPT
PHP mysql Sql
PPT
Oracle Sql & PLSQL Complete guide
PDF
Dms 22319 micro project
PPTX
SQL commands in database managemant systems
PPT
Sql basics and DDL statements
PPTX
SQL _UNIT_DBMS_PRESENTSTATION_SQL _UNIT_DBMS_PRESENTSTATION
PPTX
Database COMPLETE
PPTX
SQL_all_commnads_aggregate_functions.pptx
PPT
Lecture-9-10-11-12(a-b).ppt modern database
PPT
Db1 lecture4
DOC
DOC
Module 3
PPT
ORACLE PL SQL
PDF
Introduction to SQL..pdf
PPTX
STUDENT DETAILS DATABASE.pptx
DOC
Oracle SQL AND PL/SQL
CS3481_Database Management Laboratory .pdf
Rdbms day3
MS SQL - Database Programming Concepts by RSolutions
Database queries
PHP mysql Sql
Oracle Sql & PLSQL Complete guide
Dms 22319 micro project
SQL commands in database managemant systems
Sql basics and DDL statements
SQL _UNIT_DBMS_PRESENTSTATION_SQL _UNIT_DBMS_PRESENTSTATION
Database COMPLETE
SQL_all_commnads_aggregate_functions.pptx
Lecture-9-10-11-12(a-b).ppt modern database
Db1 lecture4
Module 3
ORACLE PL SQL
Introduction to SQL..pdf
STUDENT DETAILS DATABASE.pptx
Oracle SQL AND PL/SQL
Ad

More from Sunita Milind Dol (20)

PDF
Assignment No. 10 on Unit-IV Set Theory, Relations and Function
PDF
Assignment No. 9 on Unit-IV Set Theory, Relations and Function
PDF
Assignment No. 8 on Unit-IV Set Theory, Relations and Function
PDF
Assignment No. 7 on Unit-IV - Set Theory, Relations and Function
PDF
Assignment No. 6 on Representation of Expression
PDF
Assignment No. 5 on Unit-III Representation of Expression
PDF
Assignment No. 4 on Unit-II Mathematical Logic
PDF
Assignment No. 3 on Unit-II Mathematical Logic
PDF
Assignment No. 2 on Unit-I Mathematical Induction
PDF
Assignment No. 1 on Unit-I Fundamental Principles of Counting
PDF
Unit Number 5 - Research Ethics, IPR and Publishing
PDF
Unit Number 4 - Research reports and Thesis writing
PDF
Unit Number 3 - Data collection and Statistical Analysis
PDF
Unit Number 2 - Research Problem Formulation and Methods
PDF
Unit Number 1 - Introduction to Research
PDF
Unit Number 5 - Research Ethics, IPR and Publishing
PDF
Unit Number 5 - Research reports and Thesis writing
PDF
Unit Number 3 - Data collection and Statistical Analysis
PDF
Unit Number 2 - Research Problem Formulation and Methods
PDF
Unit Number 1 : Introduction to Research
Assignment No. 10 on Unit-IV Set Theory, Relations and Function
Assignment No. 9 on Unit-IV Set Theory, Relations and Function
Assignment No. 8 on Unit-IV Set Theory, Relations and Function
Assignment No. 7 on Unit-IV - Set Theory, Relations and Function
Assignment No. 6 on Representation of Expression
Assignment No. 5 on Unit-III Representation of Expression
Assignment No. 4 on Unit-II Mathematical Logic
Assignment No. 3 on Unit-II Mathematical Logic
Assignment No. 2 on Unit-I Mathematical Induction
Assignment No. 1 on Unit-I Fundamental Principles of Counting
Unit Number 5 - Research Ethics, IPR and Publishing
Unit Number 4 - Research reports and Thesis writing
Unit Number 3 - Data collection and Statistical Analysis
Unit Number 2 - Research Problem Formulation and Methods
Unit Number 1 - Introduction to Research
Unit Number 5 - Research Ethics, IPR and Publishing
Unit Number 5 - Research reports and Thesis writing
Unit Number 3 - Data collection and Statistical Analysis
Unit Number 2 - Research Problem Formulation and Methods
Unit Number 1 : Introduction to Research
Ad

Recently uploaded (20)

PPTX
Glazing at Facade, functions, types of glazing
PPTX
AgentX UiPath Community Webinar series - Delhi
PPTX
ANIMAL INTERVENTION WARNING SYSTEM (4).pptx
PDF
Structs to JSON How Go Powers REST APIs.pdf
PDF
LEAP-1B presedntation xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PDF
International Journal of Information Technology Convergence and Services (IJI...
PDF
6th International Conference on Artificial Intelligence and Machine Learning ...
PDF
BRKDCN-2613.pdf Cisco AI DC NVIDIA presentation
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PDF
algorithms-16-00088-v2hghjjnjnhhhnnjhj.pdf
PDF
ETO & MEO Certificate of Competency Questions and Answers
PPT
Chapter 6 Design in software Engineeing.ppt
PPTX
Internship_Presentation_Final engineering.pptx
PDF
Top 10 read articles In Managing Information Technology.pdf
PPTX
Strings in CPP - Strings in C++ are sequences of characters used to store and...
PPTX
Soil science - sampling procedures for soil science lab
PPTX
Fluid Mechanics, Module 3: Basics of Fluid Mechanics
PDF
B.Tech (Electrical Engineering ) 2024 syllabus.pdf
Glazing at Facade, functions, types of glazing
AgentX UiPath Community Webinar series - Delhi
ANIMAL INTERVENTION WARNING SYSTEM (4).pptx
Structs to JSON How Go Powers REST APIs.pdf
LEAP-1B presedntation xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
International Journal of Information Technology Convergence and Services (IJI...
6th International Conference on Artificial Intelligence and Machine Learning ...
BRKDCN-2613.pdf Cisco AI DC NVIDIA presentation
Lesson 3_Tessellation.pptx finite Mathematics
algorithms-16-00088-v2hghjjnjnhhhnnjhj.pdf
ETO & MEO Certificate of Competency Questions and Answers
Chapter 6 Design in software Engineeing.ppt
Internship_Presentation_Final engineering.pptx
Top 10 read articles In Managing Information Technology.pdf
Strings in CPP - Strings in C++ are sequences of characters used to store and...
Soil science - sampling procedures for soil science lab
Fluid Mechanics, Module 3: Basics of Fluid Mechanics
B.Tech (Electrical Engineering ) 2024 syllabus.pdf

Assignment#02

  • 1. Database System Sunita M. Dol Page 1 HANDOUT#02 Aim: Implementation of SQL DML commands: Insert, Update, and Delete Theory: The SQL(Structured Query Language) Language has several parts: 1. Data-definition language (DDL). The SQL DDL provides commands for defining relation schemas, deleting relations, and modifying relation schemas. 2. Interactive data-manipulation language (DML). The SQL DML includes a query language based on both the relational algebra and the tuple relational calculus. It includes also commands to insert tuples into, delete tuples from, and modify tuples in the database. 3. View definition. The SQL DDL includes commands for defining views. 4. Transaction control. SQL includes commands for specifying the beginning and ending of transactions. 5. Embedded SQL and dynamic SQL. Embedded and dynamic SQL define how SQL statements can be embedded within general-purpose programming languages, such as C, C++, Java, PL/I, Cobol, Pascal, and Fortran. 6. Integrity. The SQL DDL includes commands for specifying integrity constraints that the data stored in the database must satisfy. Updates that violate integrity constraints are disallowed. 7. Authorization. The SQL DDL includes commands for specifying access rights to relations and views. Domain Types in SQL: char(n). Fixed length character string, with user-specified length n. varchar(n). Variable length character strings, with user-specified maximum length n. int. Integer (a finite subset of the integers that is machine-dependent). smallint. Small integer (a machine-dependent subset of the integer domain type). numeric(p,d). Fixed point number, with user-specified precision of p digits, with n digits to the right of decimal point. real, double precision. Floating point and double-precision floating point numbers, with machine-dependent precision. float(n). Floating point number, with user-specified precision of at least n digits.
  • 2. Database System Sunita M. Dol Page 2 DML The SQL DML includes a query language based on both the relational algebra and the tuple relational calculus. It includes also commands to insert tuples into, delete tuples from, and modify tuples in the database. INSERT Command It is possible to write the INSERT INTO statement in two ways. • Method 1: The first way specifies both the column names and the values to be inserted: INSERT INTO table_name (column1, column2, column3, ...) VALUES (value1, value2, value3, ...); • Method 2: If you are adding values for all the columns of the table, you do not need to specify the column names in the SQL query. However, make sure the order of the values is in the same order as the columns in the table. The INSERT INTO syntax would be as follows: INSERT INTO table_name VALUES (value1, value2, value3, ...); You can populate data into a table through select statement over another table provided another table has a set of fields, which are required to populate first table. Here is the syntax: INSERT INTO first_table_name [(column1, column2, ... columnN)] SELECT column1, column2, ...columnN FROM second_table_name [WHERE condition]; Insert multiple rows in relation: • Method 1:The syntax for the INSERT ALL statement: INSERT ALL INTO mytable (column1, column2,... column_n) VALUES (expr1, expr2,... expr_n) INTO mytable (column1, column2,... column_n) VALUES (expr1, expr2,... expr_n) INTO mytable (column1, column2,... column_n) VALUES (expr1, expr2,... expr_n) SELECT * FROM dual; • Method 2: The syntax for the INSERT statement is INSERT INTO table_name (column1, column2,...columnN.) VALUES (&column1, &column2, ... &columnN) If the type of attribute is CHAR or VARCHAR then use single quote in values e.g. ‘&column1’ else simple use &column1. For inserting remaining rows, simply used ‘/’.
  • 3. Database System Sunita M. Dol Page 3 UPDATE Command The syntax for the UPDATE statement when updating a table in SQL is: UPDATE table SET column1 = expression1, column2 = expression2, ... [WHERE conditions]; OR The syntax for the SQL UPDATE statement when updating a table with data from another table is: UPDATE table1 SET column1 = (SELECT expression1 FROM table2 WHERE conditions) [WHERE conditions]; OR The syntax for the SQL UPDATE statement when updating multiple tables (not permitted in Oracle) is: UPDATE table1, table2, ... SET column1 = expression1, column2 = expression2, ... WHERE table1.column = table2.column [AND conditions]; DELETE Command The syntax for the DELETE statement in SQL is: DELETE FROM table [WHERE conditions]; Queries and Output: CREATE Command and Adding Constraints on Relation SQL> create table branch 2 (branch_name char(15), 3 branch_city char(15), 4 assets numeric(16,2), 5 primary key(branch_name), 6 check(assets>=0)); Table created.
  • 4. Database System Sunita M. Dol Page 4 SQL> desc branch; Name Null? Type ----------------------------------------- -------- ---------------------------- BRANCH_NAME NOT NULL CHAR(15) BRANCH_CITY CHAR(15) ASSETS NUMBER(16,2) INSERT Command SQL> insert into branch(branch_name,branch_city,assets) values('&branch_name','&branch_city',&assets ); Enter value for branch_name: Brighton Enter value for branch_city: Brooklyn Enter value for assets: 7100000 old 1: insert into branch(branch_name,branch_city,assets) values('&branch_name','&branch_city',&assets) new 1: insert into branch(branch_name,branch_city,assets) values('Brighton','Brooklyn',7100000) 1 row created. . . SQL> select * from branch; BRANCH_NAME BRANCH_CITY ASSETS --------------- --------------- ---------- Brighton Brooklyn 7100000 Downtown Brooklyn 9000000 Mianus Horseneck 400000 North Town Rye 3700000 Perryridge Horseneck 1700000 Pownal Bennington 300000 Redwood Palo Alto 2100000 Round Hill Horseneck 8000000 8 rows selected. SQL> create table account 2 (account_number char(10), 3 branch_name char(15),
  • 5. Database System Sunita M. Dol Page 5 4 balance numeric(12,2), 5 primary key(account_number), 6 foreign key(branch_name)references branch, 7 check(balance>=0)); Table created. SQL> desc account; Name Null? Type ----------------------------------------- -------- ---------------------------- ACCOUNT_NUMBER NOT NULL CHAR(10) BRANCH_NAME CHAR(15) BALANCE NUMBER(12,2) SQL> insert into account(account_number,branch_name,balance) values('&account_number','&branch_name' ,&balance); Enter value for account_number: A-101 Enter value for branch_name: Downtown Enter value for balance: 500 old 1: insert into account(account_number,branch_name,balance) values('&account_number','&branch_name' ,&balance) new 1: insert into account(account_number,branch_name,balance) values('A- 101','Downtown',500) 1 row created. . . . SQL> select * from account; ACCOUNT_NU BRANCH_NAME BALANCE ---------- --------------- ---------- A-101 Downtown 500 A-102 Perryridge 400 A-201 Brighton 900 A-215 Mianus 700 A-217 Brighton 750 A-222 Redwood 700
  • 6. Database System Sunita M. Dol Page 6 A-305 Round Hill 350 7 rows selected. SQL> create table student(roll_no char(10),first_name char(30),middle_name char(30),last_name char(3 0),address char(50),city char(20),pincode numeric(6,0),state char(20),mobile_number integer); Table created. UPDATE Command SQL> select * from student; ROLL_NO FIRST_NAME MIDDLE_NAME ---------- ------------------------------ ------------------------------ LAST_NAME ------------------------------ ADDRESS CITY -------------------------------------------------- -------------------- PINCODE STATE MOBILE_NUM ---------- -------------------- ---------- TECSE-16 Namrata M Bura Bhadrawati peth Solapur 413005 Maharashtra 9421067511 ROLL_NO FIRST_NAME MIDDLE_NAME ---------- ------------------------------ ------------------------------ LAST_NAME ------------------------------ ADDRESS CITY -------------------------------------------------- -------------------- PINCODE STATE MOBILE_NUM ---------- -------------------- ---------- TECSE-26 Pradnya N Dudam Sakhar Peth Solapur 413005 Maharashtra 7745865343
  • 7. Database System Sunita M. Dol Page 7 SQL> update student set middle_name='Minesh' where roll_no='TECSE-16'; 1 row updated. SQL> select * from student; ROLL_NO FIRST_NAME MIDDLE_NAME ---------- ------------------------------ ------------------------------ LAST_NAME ------------------------------ ADDRESS CITY -------------------------------------------------- -------------------- PINCODE STATE MOBILE_NUM ---------- -------------------- ---------- TECSE-16 Namrata Minesh Bura Bhadrawati peth Solapur 413005 Maharashtra 9421067511 ROLL_NO FIRST_NAME MIDDLE_NAME ---------- ------------------------------ ------------------------------ LAST_NAME ------------------------------ ADDRESS CITY -------------------------------------------------- -------------------- PINCODE STATE MOBILE_NUM ---------- -------------------- ---------- TECSE-26 Pradnya N Dudam Sakhar Peth Solapur 413005 Maharashtra 7745865343 DELETE Command SQL> delete from student where roll_no='TECSE-26'; 1 row deleted.
  • 8. Database System Sunita M. Dol Page 8 SQL> select * from student; ROLL_NO FIRST_NAME MIDDLE_NAME ---------- ------------------------------ ------------------------------ LAST_NAME ------------------------------ ADDRESS CITY -------------------------------------------------- -------------------- PINCODE STATE MOBILE_NUM ---------- -------------------- ---------- TECSE-16 Namrata Minesh Bura Bhadrawati peth Solapur 413005 Maharashtra 9421067511 Conclusion: We have studied the various DML commands like a. INSERT command b. DELETE command c. UPDATE command References: • Database system concepts by Abraham Silberschatz, Henry F. Korth, S. Sudarshan (McGraw Hill International Edition) sixth edition. • Database system concepts by Abraham Silberschatz, Henry F. Korth, S. Sudarshan (McGraw Hill International Edition) fifth edition. • http://codex.cs.yale.edu/avi/db-book/db4/slide-dir/ • http://codex.cs.yale.edu/avi/db-book/db5/slide-dir/ • http://codex.cs.yale.edu/avi/db-book/db6/slide-dir/