SlideShare a Scribd company logo
1 of 17
Download to read offline
Mrs. Sunita M Dol, CSE Department
WIT, Solapur Page 1
4. 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.
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
simply use &column1. For inserting remaining rows, use ‘/’.
The department relation
SQL> insert into department values('Biology','Watson',90000);
Mrs. Sunita M Dol, CSE Department
WIT, Solapur Page 2
1 row created.
SQL> insert into department values('Comp.Sci.','Taylor',100000);
1 row created.
SQL> insert into department values('Elec.Eng.','Taylor',85000);
1 row created.
SQL> insert into department values('Finance','Painter',120000);
1 row created.
SQL> insert into department values('History','Painter',50000);
1 row created.
SQL> insert into department values('Music','Packard',80000);
1 row created.
SQL> insert into department values('Physics','Watson',70000);
1 row created.
SQL> select * from department;
DEPT_NAME BUILDING BUDGET
-------------------- -------------------- ----------
Biology Watson 90000
Comp.Sci. Taylor 100000
Elec.Eng. Taylor 85000
Finance Painter 120000
History Painter 50000
Music Packard 80000
Physics Watson 70000
7 rows selected.
The course relation
SQL> insert into course values ('BIO-101','Intro. to Biology','Biology',4 );
Mrs. Sunita M Dol, CSE Department
WIT, Solapur Page 3
1 row created.
SQL> insert into course values ('BIO-301','Genetics','Biology',4 );
1 row created.
SQL> insert into course values ('BIO-399','Computational Biology','Biology', 3);
1 row created.
SQL> insert into course values ('CS-101','Intro. to Computer Science','Comp.Sci.',4 );
1 row created.
SQL> insert into course values ('CS-190','Game Design','Comp.Sci.',4 );
1 row created.
SQL> insert into course values ('CS-315','Robotics','Comp.Sci.', 3);
1 row created.
SQL> insert into course values ('CS-319','Image Processing','Comp.Sci.', 3);
1 row created.
SQL> insert into course values ('CS-347','Database System Concepts','Comp.Sci.',3 );
1 row created.
SQL> insert into course values ('EE-181','Intro. to Digital Systems','Elec.Eng.',3 );
1 row created.
SQL> insert into course values ('FIN-201','Investment Banking','Finance',3 );
1 row created.
SQL> insert into course values ('HIS-351','World History','History', 3);
1 row created.
SQL> insert into course values ('MU-199','Music Video Production','Music',3 );
Mrs. Sunita M Dol, CSE Department
WIT, Solapur Page 4
1 row created.
SQL> insert into course values ('PHY-101','Physical Principles','Physics',4 );
1 row created.
SQL> select * from course;
COURSE_ TITLE DEPT_NAME
------- -------------------------------------------------- --------------------
CREDITS
----------
BIO-101 Intro. to Biology Biology
4
BIO-301 Genetics Biology
4
BIO-399 Computational Biology Biology
3
COURSE_ TITLE DEPT_NAME
------- -------------------------------------------------- --------------------
CREDITS
----------
CS-101 Intro. to Computer Science Comp.Sci.
4
CS-190 Game Design Comp.Sci.
4
CS-315 Robotics Comp.Sci.
3
COURSE_ TITLE DEPT_NAME
------- -------------------------------------------------- --------------------
CREDITS
----------
CS-319 Image Processing Comp.Sci.
3
Mrs. Sunita M Dol, CSE Department
WIT, Solapur Page 5
CS-347 Database System Concepts Comp.Sci.
3
EE-181 Intro. to Digital Systems Elec.Eng.
3
COURSE_ TITLE DEPT_NAME
------- -------------------------------------------------- --------------------
CREDITS
----------
FIN-201 Investment Banking Finance
3
HIS-351 World History History
3
MU-199 Music Video Production Music
3
COURSE_ TITLE DEPT_NAME
------- -------------------------------------------------- --------------------
CREDITS
----------
PHY-101 Physical Principles Physics
4
13 rows selected.
The instructor relation
SQL> insert into instructor values(10101 ,'Srinivasan','Comp.Sci.',65000);
1 row created.
SQL> insert into instructor values(12121,'Wu','Finance',90000);
1 row created.
SQL> insert into instructor values(15151,'Mozart','Music',40000);
1 row created.
Mrs. Sunita M Dol, CSE Department
WIT, Solapur Page 6
SQL> insert into instructor values(22222,'Einstein','Physics',95000);
1 row created.
SQL> insert into instructor values(32343,'El Said','History',60000);
1 row created.
SQL> insert into instructor values(33456,'Gold','Physics',87000);
1 row created.
SQL> insert into instructor values(45565,'Katz','Comp.Sci.',75000);
1 row created.
SQL> insert into instructor values(58583,'Califieri','History',62000);
1 row created.
SQL> insert into instructor values(76543,'Singh','Finance',80000);
1 row created.
SQL> insert into instructor values(76766,'Crick','Biology',72000);
1 row created.
SQL> insert into instructor values(83821,'Brandt','Comp.Sci.',92000);
1 row created.
SQL> insert into instructor values(98345,'Kim','Elec.Eng.',80000);
1 row created.
SQL> select * from instructor;
ID NAME DEPT_NAME SALARY
----- -------------------- -------------------- ----------
10101 Srinivasan Comp.Sci. 65000
12121 Wu Finance 90000
15151 Mozart Music 40000
Mrs. Sunita M Dol, CSE Department
WIT, Solapur Page 7
22222 Einstein Physics 95000
32343 El Said History 60000
33456 Gold Physics 87000
45565 Katz Comp.Sci. 75000
58583 Califieri History 62000
76543 Singh Finance 80000
76766 Crick Biology 72000
83821 Brandt Comp.Sci. 92000
ID NAME DEPT_NAME SALARY
----- -------------------- -------------------- ----------
98345 Kim Elec.Eng. 80000
12 rows selected.
The section relation
SQL> insert into section values('BIO-101',1,'Summer',2009,'Painter',514,'B');
1 row created.
SQL> insert into section values('BIO-301',1,'Summer',2010,'Painter',514,'A');
1 row created.
SQL> insert into section values('CS-101',1,'Fall',2009,'Packard',101,'H');
1 row created.
SQL> insert into section values('CS-101',1,'Spring',2010,'Packard',101,'F');
1 row created.
SQL> insert into section values('CS-190',1,'Spring',2009,'Taylor',3128,'E');
1 row created.
SQL> insert into section values('CS-190',2,'Spring',2009,'Taylor',3128,'A');
1 row created.
SQL> insert into section values('CS-315',1,'Spring',2010,'Watson',120,'D');
1 row created.
Mrs. Sunita M Dol, CSE Department
WIT, Solapur Page 8
SQL> insert into section values('CS-319',1,'Spring',2010,'Watson',100,'B');
1 row created.
SQL> insert into section values('CS-319',2,'Spring',2010,'Taylor',3128,'C');
1 row created.
SQL> insert into section values('CS-347',1,'Fall',2009,'Taylor',3128,'A');
1 row created.
SQL> insert into section values('EE-181',1,'Spring',2009,'Taylor',3128,'C');
1 row created.
SQL> insert into section values('FIN-201',1,'Spring',2010,'Packard',101,'B');
1 row created.
SQL> insert into section values('HIS-351',1,'Spring',2010,'Painter',514,'C');
1 row created.
SQL> insert into section values('MU-199',1,'Spring',2010,'Packard',101,'D');
1 row created.
SQL> insert into section values('PHY-101',1,'Fall',2009,'Watson',100,'A');
1 row created.
SQL> select * from section;
COURSE_I SEC_ID SEMEST YEAR BUILDING ROOM_NU TIME
-------- -------- ------ ---------- --------------- ------- ----
BIO-101 1 Summer 2009 Painter 514 B
BIO-301 1 Summer 2010 Painter 514 A
CS-101 1 Fall 2009 Packard 101 H
CS-101 1 Spring 2010 Packard 101 F
CS-190 1 Spring 2009 Taylor 3128 E
CS-190 2 Spring 2009 Taylor 3128 A
CS-315 1 Spring 2010 Watson 120 D
Mrs. Sunita M Dol, CSE Department
WIT, Solapur Page 9
CS-319 1 Spring 2010 Watson 100 B
CS-319 2 Spring 2010 Taylor 3128 C
CS-347 1 Fall 2009 Taylor 3128 A
EE-181 1 Spring 2009 Taylor 3128 C
COURSE_I SEC_ID SEMEST YEAR BUILDING ROOM_NU TIME
-------- -------- ------ ---------- --------------- ------- ----
FIN-201 1 Spring 2010 Packard 101 B
HIS-351 1 Spring 2010 Painter 514 C
MU-199 1 Spring 2010 Packard 101 D
PHY-101 1 Fall 2009 Watson 100 A
15 rows selected.
The teaches relation
SQL> insert into teaches values(10101,'CS-101',1,'Fall',2009);
1 row created.
SQL> insert into teaches values(10101,'CS-315',1,'Spring',2010);
1 row created.
SQL> insert into teaches values(10101,'CS-347',1,'Fall',2009);
1 row created.
SQL> insert into teaches values(12121,'FIN-201',1,'Spring',2010);
1 row created.
SQL> insert into teaches values(15151,'MU-199',1,'Spring',2010);
1 row created.
SQL> insert into teaches values(22222,'PHY-101',1,'Fall',2009);
1 row created.
SQL> insert into teaches values(32343,'HIS-351',1,'Spring',2010);
1 row created.
Mrs. Sunita M Dol, CSE Department
WIT, Solapur Page 10
SQL> insert into teaches values(45565,'CS-101',1,'Spring',2010);
1 row created.
SQL> insert into teaches values(45565,'CS-319',1,'Spring',2010);
1 row created.
SQL> insert into teaches values(76766,'BIO-101',1,'Summer',2009);
1 row created.
SQL> insert into teaches values(76766,'BIO-301',1,'Summer',2010);
1 row created.
SQL> insert into teaches values(83821,'CS-190',1,'Spring',2009);
1 row created.
SQL> insert into teaches values(83821,'CS-190',2,'Spring',2009);
1 row created.
SQL> insert into teaches values(83821,'CS-319',2,'Spring',2010);
1 row created.
SQL> insert into teaches values(98345,'EE-181',1,'Spring',2009);
1 row created.
SQL> select * from teaches;
ID COURSE_I SEC_ID SEMEST YEAR
----- -------- -------- ------ ----------
10101 CS-101 1 Fall 2009
10101 CS-315 1 Spring 2010
10101 CS-347 1 Fall 2009
12121 FIN-201 1 Spring 2010
15151 MU-199 1 Spring 2010
22222 PHY-101 1 Fall 2009
32343 HIS-351 1 Spring 2010
45565 CS-101 1 Spring 2010
Mrs. Sunita M Dol, CSE Department
WIT, Solapur Page 11
45565 CS-319 1 Spring 2010
76766 BIO-101 1 Summer 2009
76766 BIO-301 1 Summer 2010
ID COURSE_I SEC_ID SEMEST YEAR
----- -------- -------- ------ ----------
83821 CS-190 1 Spring 2009
83821 CS-190 2 Spring 2009
83821 CS-319 2 Spring 2010
98345 EE-181 1 Spring 2009
15 rows selected.
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];
SQL> desc student
Name Null? Type
----------------------------------------- -------- ----------------------------
ROLL_NO CHAR(10)
FIRST_NAME CHAR(30)
MIDDLE_NAME CHAR(30)
LAST_NAME CHAR(30)
Mrs. Sunita M Dol, CSE Department
WIT, Solapur Page 12
ADDRESS CHAR(50)
CITY CHAR(20)
PINCODE NUMBER(6)
STATE CHAR(20)
MOBILE_NUMBER CHAR(10)
SQL> insert into student (roll_no,first_name,middle_name,last_name,address,city,pincode,state,mobil
e_number) values('&roll_no','&first_name','&middle_name','&last_name','&address','&city',&pincode,'&
state',&mobile_number);
Enter value for roll_no: TECSE-16
Enter value for first_name: Namrata
Enter value for middle_name: M
Enter value for last_name: Bura
Enter value for address: Bhadrawati peth
Enter value for city: Solapur
Enter value for pincode: 413005
Enter value for state: Maharashtra
Enter value for mobile_number: 9421067511
old 1: insert into student (roll_no,first_name,middle_name,last_name,address,city,pincode,state,m
new 1: insert into student (roll_no,first_name,middle_name,last_name,address,city,pincode,state,m
1 row created.
SQL> /
Enter value for roll_no: TECSE-26
Enter value for first_name: Pradnya
Enter value for middle_name: N
Enter value for last_name: Dudam
Enter value for address: Sakhar Peth
Enter value for city: Solapur
Enter value for pincode: 413005
Enter value for state: Maharashtra
Enter value for mobile_number: 7745865343
old 1: insert into student (roll_no,first_name,middle_name,last_name,address,city,pincode,state,m
new 1: insert into student (roll_no,first_name,middle_name,last_name,address,city,pincode,state,m
1 row created.
SQL> select * from student;
ROLL_NO FIRST_NAME MIDDLE_NAME
---------- ------------------------------ ------------------------------
LAST_NAME
------------------------------
Mrs. Sunita M Dol, CSE Department
WIT, Solapur Page 13
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
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
Mrs. Sunita M Dol, CSE Department
WIT, Solapur Page 14
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
The syntax for the DELETE statement in SQL is:
DELETE FROM table
[WHERE conditions];
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
Mrs. Sunita M Dol, CSE Department
WIT, Solapur Page 15
Dudam
Sakhar Peth Solapur
413005 Maharashtra 7745865343
SQL> delete from student where roll_no='TECSE-26';
1 row deleted.
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
Mrs. Sunita M Dol, CSE Department
WIT, Solapur Page 16
Practice Problem Statement
The patient relation
The doctors relation
The department relation
The worker relation
Mrs. Sunita M Dol, CSE Department
WIT, Solapur Page 17
The emergency relation
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/
 MOOCs: Database Management System:
https://onlinecourses.nptel.ac.in/noc18_cs15

More Related Content

Similar to 4. DML.pdf

Best sql plsql_material for B.TECH
Best sql plsql_material for B.TECH Best sql plsql_material for B.TECH
Best sql plsql_material for B.TECH
AmIt Prasad
 
SQL-Tutorial.P1241112567Pczwq.powerpoint.pptx
SQL-Tutorial.P1241112567Pczwq.powerpoint.pptxSQL-Tutorial.P1241112567Pczwq.powerpoint.pptx
SQL-Tutorial.P1241112567Pczwq.powerpoint.pptx
SaiMiryala1
 
Most useful queries
Most useful queriesMost useful queries
Most useful queries
Sam Depp
 
Database management system file
Database management system fileDatabase management system file
Database management system file
Ankit Dixit
 
2. DBMS Experiment - Lab 2 Made in SQL Used
2. DBMS Experiment - Lab 2 Made in SQL Used2. DBMS Experiment - Lab 2 Made in SQL Used
2. DBMS Experiment - Lab 2 Made in SQL Used
TheVerse1
 
Sql insert statement
Sql insert statementSql insert statement
Sql insert statement
Vivek Singh
 

Similar to 4. DML.pdf (20)

MySql slides (ppt)
MySql slides (ppt)MySql slides (ppt)
MySql slides (ppt)
 
SQL Notes
SQL NotesSQL Notes
SQL Notes
 
6. Aggregate Functions.pdf
6. Aggregate Functions.pdf6. Aggregate Functions.pdf
6. Aggregate Functions.pdf
 
Sql 
statements , functions & joins
Sql 
statements , functions  &  joinsSql 
statements , functions  &  joins
Sql 
statements , functions & joins
 
SQL Query
SQL QuerySQL Query
SQL Query
 
Sql
SqlSql
Sql
 
Best sql plsql_material for B.TECH
Best sql plsql_material for B.TECH Best sql plsql_material for B.TECH
Best sql plsql_material for B.TECH
 
SQL-Tutorial.P1241112567Pczwq.powerpoint.pptx
SQL-Tutorial.P1241112567Pczwq.powerpoint.pptxSQL-Tutorial.P1241112567Pczwq.powerpoint.pptx
SQL-Tutorial.P1241112567Pczwq.powerpoint.pptx
 
3. DDL.pdf
3. DDL.pdf3. DDL.pdf
3. DDL.pdf
 
SQL-Tutorial.P1241112567Pczwq.powerpoint.pptx
SQL-Tutorial.P1241112567Pczwq.powerpoint.pptxSQL-Tutorial.P1241112567Pczwq.powerpoint.pptx
SQL-Tutorial.P1241112567Pczwq.powerpoint.pptx
 
SQL-Tutorial.P1241112567Pczwq.powerpoint.pptx
SQL-Tutorial.P1241112567Pczwq.powerpoint.pptxSQL-Tutorial.P1241112567Pczwq.powerpoint.pptx
SQL-Tutorial.P1241112567Pczwq.powerpoint.pptx
 
Oracle Material.pdf
Oracle Material.pdfOracle Material.pdf
Oracle Material.pdf
 
Best sql plsql material
Best sql plsql materialBest sql plsql material
Best sql plsql material
 
Most useful queries
Most useful queriesMost useful queries
Most useful queries
 
SQL Overview
SQL OverviewSQL Overview
SQL Overview
 
Database Programming using SQL
Database Programming using SQLDatabase Programming using SQL
Database Programming using SQL
 
Database management system file
Database management system fileDatabase management system file
Database management system file
 
2. DBMS Experiment - Lab 2 Made in SQL Used
2. DBMS Experiment - Lab 2 Made in SQL Used2. DBMS Experiment - Lab 2 Made in SQL Used
2. DBMS Experiment - Lab 2 Made in SQL Used
 
SQL - DML and DDL Commands
SQL - DML and DDL CommandsSQL - DML and DDL Commands
SQL - DML and DDL Commands
 
Sql insert statement
Sql insert statementSql insert statement
Sql insert statement
 

More from Sunita Milind Dol

More from Sunita Milind Dol (20)

Unit Number 5 - Research Ethics, IPR and Publishing
Unit Number 5 - Research Ethics, IPR and PublishingUnit Number 5 - Research Ethics, IPR and Publishing
Unit Number 5 - Research Ethics, IPR and Publishing
 
Unit Number 4 - Research reports and Thesis writing
Unit Number 4 - Research reports and Thesis writingUnit Number 4 - Research reports and Thesis writing
Unit Number 4 - Research reports and Thesis writing
 
Unit Number 3 - Data collection and Statistical Analysis
Unit Number 3 - Data collection and Statistical AnalysisUnit Number 3 - Data collection and Statistical Analysis
Unit Number 3 - Data collection and Statistical Analysis
 
Unit Number 2 - Research Problem Formulation and Methods
Unit Number 2 - Research Problem Formulation and MethodsUnit Number 2 - Research Problem Formulation and Methods
Unit Number 2 - Research Problem Formulation and Methods
 
Unit Number 1 - Introduction to Research
Unit Number 1 - Introduction to ResearchUnit Number 1 - Introduction to Research
Unit Number 1 - Introduction to Research
 
Unit Number 5 - Research Ethics, IPR and Publishing
Unit Number 5 - Research Ethics, IPR and PublishingUnit Number 5 - Research Ethics, IPR and Publishing
Unit Number 5 - Research Ethics, IPR and Publishing
 
Unit Number 5 - Research reports and Thesis writing
Unit Number 5 - Research reports and Thesis writingUnit Number 5 - Research reports and Thesis writing
Unit Number 5 - Research reports and Thesis writing
 
Unit Number 3 - Data collection and Statistical Analysis
Unit Number 3 - Data collection and Statistical AnalysisUnit Number 3 - Data collection and Statistical Analysis
Unit Number 3 - Data collection and Statistical Analysis
 
Unit Number 2 - Research Problem Formulation and Methods
Unit Number 2 - Research Problem Formulation and MethodsUnit Number 2 - Research Problem Formulation and Methods
Unit Number 2 - Research Problem Formulation and Methods
 
Unit Number 1 : Introduction to Research
Unit Number 1 : Introduction to ResearchUnit Number 1 : Introduction to Research
Unit Number 1 : Introduction to Research
 
9.Joins.pdf
9.Joins.pdf9.Joins.pdf
9.Joins.pdf
 
8.Views.pdf
8.Views.pdf8.Views.pdf
8.Views.pdf
 
5. Basic Structure of SQL Queries.pdf
5. Basic Structure of SQL Queries.pdf5. Basic Structure of SQL Queries.pdf
5. Basic Structure of SQL Queries.pdf
 
2. SQL Introduction.pdf
2. SQL Introduction.pdf2. SQL Introduction.pdf
2. SQL Introduction.pdf
 
1. University Example.pdf
1. University Example.pdf1. University Example.pdf
1. University Example.pdf
 
Assignment12
Assignment12Assignment12
Assignment12
 
Assignment11
Assignment11Assignment11
Assignment11
 
Assignment10
Assignment10Assignment10
Assignment10
 
Assignment9
Assignment9Assignment9
Assignment9
 
Assignment8
Assignment8Assignment8
Assignment8
 

Recently uploaded

Recently uploaded (20)

ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 

4. DML.pdf

  • 1. Mrs. Sunita M Dol, CSE Department WIT, Solapur Page 1 4. 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. 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 simply use &column1. For inserting remaining rows, use ‘/’. The department relation SQL> insert into department values('Biology','Watson',90000);
  • 2. Mrs. Sunita M Dol, CSE Department WIT, Solapur Page 2 1 row created. SQL> insert into department values('Comp.Sci.','Taylor',100000); 1 row created. SQL> insert into department values('Elec.Eng.','Taylor',85000); 1 row created. SQL> insert into department values('Finance','Painter',120000); 1 row created. SQL> insert into department values('History','Painter',50000); 1 row created. SQL> insert into department values('Music','Packard',80000); 1 row created. SQL> insert into department values('Physics','Watson',70000); 1 row created. SQL> select * from department; DEPT_NAME BUILDING BUDGET -------------------- -------------------- ---------- Biology Watson 90000 Comp.Sci. Taylor 100000 Elec.Eng. Taylor 85000 Finance Painter 120000 History Painter 50000 Music Packard 80000 Physics Watson 70000 7 rows selected. The course relation SQL> insert into course values ('BIO-101','Intro. to Biology','Biology',4 );
  • 3. Mrs. Sunita M Dol, CSE Department WIT, Solapur Page 3 1 row created. SQL> insert into course values ('BIO-301','Genetics','Biology',4 ); 1 row created. SQL> insert into course values ('BIO-399','Computational Biology','Biology', 3); 1 row created. SQL> insert into course values ('CS-101','Intro. to Computer Science','Comp.Sci.',4 ); 1 row created. SQL> insert into course values ('CS-190','Game Design','Comp.Sci.',4 ); 1 row created. SQL> insert into course values ('CS-315','Robotics','Comp.Sci.', 3); 1 row created. SQL> insert into course values ('CS-319','Image Processing','Comp.Sci.', 3); 1 row created. SQL> insert into course values ('CS-347','Database System Concepts','Comp.Sci.',3 ); 1 row created. SQL> insert into course values ('EE-181','Intro. to Digital Systems','Elec.Eng.',3 ); 1 row created. SQL> insert into course values ('FIN-201','Investment Banking','Finance',3 ); 1 row created. SQL> insert into course values ('HIS-351','World History','History', 3); 1 row created. SQL> insert into course values ('MU-199','Music Video Production','Music',3 );
  • 4. Mrs. Sunita M Dol, CSE Department WIT, Solapur Page 4 1 row created. SQL> insert into course values ('PHY-101','Physical Principles','Physics',4 ); 1 row created. SQL> select * from course; COURSE_ TITLE DEPT_NAME ------- -------------------------------------------------- -------------------- CREDITS ---------- BIO-101 Intro. to Biology Biology 4 BIO-301 Genetics Biology 4 BIO-399 Computational Biology Biology 3 COURSE_ TITLE DEPT_NAME ------- -------------------------------------------------- -------------------- CREDITS ---------- CS-101 Intro. to Computer Science Comp.Sci. 4 CS-190 Game Design Comp.Sci. 4 CS-315 Robotics Comp.Sci. 3 COURSE_ TITLE DEPT_NAME ------- -------------------------------------------------- -------------------- CREDITS ---------- CS-319 Image Processing Comp.Sci. 3
  • 5. Mrs. Sunita M Dol, CSE Department WIT, Solapur Page 5 CS-347 Database System Concepts Comp.Sci. 3 EE-181 Intro. to Digital Systems Elec.Eng. 3 COURSE_ TITLE DEPT_NAME ------- -------------------------------------------------- -------------------- CREDITS ---------- FIN-201 Investment Banking Finance 3 HIS-351 World History History 3 MU-199 Music Video Production Music 3 COURSE_ TITLE DEPT_NAME ------- -------------------------------------------------- -------------------- CREDITS ---------- PHY-101 Physical Principles Physics 4 13 rows selected. The instructor relation SQL> insert into instructor values(10101 ,'Srinivasan','Comp.Sci.',65000); 1 row created. SQL> insert into instructor values(12121,'Wu','Finance',90000); 1 row created. SQL> insert into instructor values(15151,'Mozart','Music',40000); 1 row created.
  • 6. Mrs. Sunita M Dol, CSE Department WIT, Solapur Page 6 SQL> insert into instructor values(22222,'Einstein','Physics',95000); 1 row created. SQL> insert into instructor values(32343,'El Said','History',60000); 1 row created. SQL> insert into instructor values(33456,'Gold','Physics',87000); 1 row created. SQL> insert into instructor values(45565,'Katz','Comp.Sci.',75000); 1 row created. SQL> insert into instructor values(58583,'Califieri','History',62000); 1 row created. SQL> insert into instructor values(76543,'Singh','Finance',80000); 1 row created. SQL> insert into instructor values(76766,'Crick','Biology',72000); 1 row created. SQL> insert into instructor values(83821,'Brandt','Comp.Sci.',92000); 1 row created. SQL> insert into instructor values(98345,'Kim','Elec.Eng.',80000); 1 row created. SQL> select * from instructor; ID NAME DEPT_NAME SALARY ----- -------------------- -------------------- ---------- 10101 Srinivasan Comp.Sci. 65000 12121 Wu Finance 90000 15151 Mozart Music 40000
  • 7. Mrs. Sunita M Dol, CSE Department WIT, Solapur Page 7 22222 Einstein Physics 95000 32343 El Said History 60000 33456 Gold Physics 87000 45565 Katz Comp.Sci. 75000 58583 Califieri History 62000 76543 Singh Finance 80000 76766 Crick Biology 72000 83821 Brandt Comp.Sci. 92000 ID NAME DEPT_NAME SALARY ----- -------------------- -------------------- ---------- 98345 Kim Elec.Eng. 80000 12 rows selected. The section relation SQL> insert into section values('BIO-101',1,'Summer',2009,'Painter',514,'B'); 1 row created. SQL> insert into section values('BIO-301',1,'Summer',2010,'Painter',514,'A'); 1 row created. SQL> insert into section values('CS-101',1,'Fall',2009,'Packard',101,'H'); 1 row created. SQL> insert into section values('CS-101',1,'Spring',2010,'Packard',101,'F'); 1 row created. SQL> insert into section values('CS-190',1,'Spring',2009,'Taylor',3128,'E'); 1 row created. SQL> insert into section values('CS-190',2,'Spring',2009,'Taylor',3128,'A'); 1 row created. SQL> insert into section values('CS-315',1,'Spring',2010,'Watson',120,'D'); 1 row created.
  • 8. Mrs. Sunita M Dol, CSE Department WIT, Solapur Page 8 SQL> insert into section values('CS-319',1,'Spring',2010,'Watson',100,'B'); 1 row created. SQL> insert into section values('CS-319',2,'Spring',2010,'Taylor',3128,'C'); 1 row created. SQL> insert into section values('CS-347',1,'Fall',2009,'Taylor',3128,'A'); 1 row created. SQL> insert into section values('EE-181',1,'Spring',2009,'Taylor',3128,'C'); 1 row created. SQL> insert into section values('FIN-201',1,'Spring',2010,'Packard',101,'B'); 1 row created. SQL> insert into section values('HIS-351',1,'Spring',2010,'Painter',514,'C'); 1 row created. SQL> insert into section values('MU-199',1,'Spring',2010,'Packard',101,'D'); 1 row created. SQL> insert into section values('PHY-101',1,'Fall',2009,'Watson',100,'A'); 1 row created. SQL> select * from section; COURSE_I SEC_ID SEMEST YEAR BUILDING ROOM_NU TIME -------- -------- ------ ---------- --------------- ------- ---- BIO-101 1 Summer 2009 Painter 514 B BIO-301 1 Summer 2010 Painter 514 A CS-101 1 Fall 2009 Packard 101 H CS-101 1 Spring 2010 Packard 101 F CS-190 1 Spring 2009 Taylor 3128 E CS-190 2 Spring 2009 Taylor 3128 A CS-315 1 Spring 2010 Watson 120 D
  • 9. Mrs. Sunita M Dol, CSE Department WIT, Solapur Page 9 CS-319 1 Spring 2010 Watson 100 B CS-319 2 Spring 2010 Taylor 3128 C CS-347 1 Fall 2009 Taylor 3128 A EE-181 1 Spring 2009 Taylor 3128 C COURSE_I SEC_ID SEMEST YEAR BUILDING ROOM_NU TIME -------- -------- ------ ---------- --------------- ------- ---- FIN-201 1 Spring 2010 Packard 101 B HIS-351 1 Spring 2010 Painter 514 C MU-199 1 Spring 2010 Packard 101 D PHY-101 1 Fall 2009 Watson 100 A 15 rows selected. The teaches relation SQL> insert into teaches values(10101,'CS-101',1,'Fall',2009); 1 row created. SQL> insert into teaches values(10101,'CS-315',1,'Spring',2010); 1 row created. SQL> insert into teaches values(10101,'CS-347',1,'Fall',2009); 1 row created. SQL> insert into teaches values(12121,'FIN-201',1,'Spring',2010); 1 row created. SQL> insert into teaches values(15151,'MU-199',1,'Spring',2010); 1 row created. SQL> insert into teaches values(22222,'PHY-101',1,'Fall',2009); 1 row created. SQL> insert into teaches values(32343,'HIS-351',1,'Spring',2010); 1 row created.
  • 10. Mrs. Sunita M Dol, CSE Department WIT, Solapur Page 10 SQL> insert into teaches values(45565,'CS-101',1,'Spring',2010); 1 row created. SQL> insert into teaches values(45565,'CS-319',1,'Spring',2010); 1 row created. SQL> insert into teaches values(76766,'BIO-101',1,'Summer',2009); 1 row created. SQL> insert into teaches values(76766,'BIO-301',1,'Summer',2010); 1 row created. SQL> insert into teaches values(83821,'CS-190',1,'Spring',2009); 1 row created. SQL> insert into teaches values(83821,'CS-190',2,'Spring',2009); 1 row created. SQL> insert into teaches values(83821,'CS-319',2,'Spring',2010); 1 row created. SQL> insert into teaches values(98345,'EE-181',1,'Spring',2009); 1 row created. SQL> select * from teaches; ID COURSE_I SEC_ID SEMEST YEAR ----- -------- -------- ------ ---------- 10101 CS-101 1 Fall 2009 10101 CS-315 1 Spring 2010 10101 CS-347 1 Fall 2009 12121 FIN-201 1 Spring 2010 15151 MU-199 1 Spring 2010 22222 PHY-101 1 Fall 2009 32343 HIS-351 1 Spring 2010 45565 CS-101 1 Spring 2010
  • 11. Mrs. Sunita M Dol, CSE Department WIT, Solapur Page 11 45565 CS-319 1 Spring 2010 76766 BIO-101 1 Summer 2009 76766 BIO-301 1 Summer 2010 ID COURSE_I SEC_ID SEMEST YEAR ----- -------- -------- ------ ---------- 83821 CS-190 1 Spring 2009 83821 CS-190 2 Spring 2009 83821 CS-319 2 Spring 2010 98345 EE-181 1 Spring 2009 15 rows selected. 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]; SQL> desc student Name Null? Type ----------------------------------------- -------- ---------------------------- ROLL_NO CHAR(10) FIRST_NAME CHAR(30) MIDDLE_NAME CHAR(30) LAST_NAME CHAR(30)
  • 12. Mrs. Sunita M Dol, CSE Department WIT, Solapur Page 12 ADDRESS CHAR(50) CITY CHAR(20) PINCODE NUMBER(6) STATE CHAR(20) MOBILE_NUMBER CHAR(10) SQL> insert into student (roll_no,first_name,middle_name,last_name,address,city,pincode,state,mobil e_number) values('&roll_no','&first_name','&middle_name','&last_name','&address','&city',&pincode,'& state',&mobile_number); Enter value for roll_no: TECSE-16 Enter value for first_name: Namrata Enter value for middle_name: M Enter value for last_name: Bura Enter value for address: Bhadrawati peth Enter value for city: Solapur Enter value for pincode: 413005 Enter value for state: Maharashtra Enter value for mobile_number: 9421067511 old 1: insert into student (roll_no,first_name,middle_name,last_name,address,city,pincode,state,m new 1: insert into student (roll_no,first_name,middle_name,last_name,address,city,pincode,state,m 1 row created. SQL> / Enter value for roll_no: TECSE-26 Enter value for first_name: Pradnya Enter value for middle_name: N Enter value for last_name: Dudam Enter value for address: Sakhar Peth Enter value for city: Solapur Enter value for pincode: 413005 Enter value for state: Maharashtra Enter value for mobile_number: 7745865343 old 1: insert into student (roll_no,first_name,middle_name,last_name,address,city,pincode,state,m new 1: insert into student (roll_no,first_name,middle_name,last_name,address,city,pincode,state,m 1 row created. SQL> select * from student; ROLL_NO FIRST_NAME MIDDLE_NAME ---------- ------------------------------ ------------------------------ LAST_NAME ------------------------------
  • 13. Mrs. Sunita M Dol, CSE Department WIT, Solapur Page 13 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 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
  • 14. Mrs. Sunita M Dol, CSE Department WIT, Solapur Page 14 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 The syntax for the DELETE statement in SQL is: DELETE FROM table [WHERE conditions]; 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
  • 15. Mrs. Sunita M Dol, CSE Department WIT, Solapur Page 15 Dudam Sakhar Peth Solapur 413005 Maharashtra 7745865343 SQL> delete from student where roll_no='TECSE-26'; 1 row deleted. 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
  • 16. Mrs. Sunita M Dol, CSE Department WIT, Solapur Page 16 Practice Problem Statement The patient relation The doctors relation The department relation The worker relation
  • 17. Mrs. Sunita M Dol, CSE Department WIT, Solapur Page 17 The emergency relation 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/  MOOCs: Database Management System: https://onlinecourses.nptel.ac.in/noc18_cs15