Advanced DBMS
(Assignment –II)
Submitted in partial fulfilment of the requirements for the degree of
Master of Technology in Information Technology
by
Vijayananda D Mohire
(Enrolment No.921DMTE0113)
Information Technology Department
Karnataka State Open University
Manasagangotri, Mysore – 570006
Karnataka, India
(2009)
2
3
Advanced DBMS
4
CERTIFICATE
This is to certify that the Assignment-II entitled (Advanced DBMS,
subject code: MT14) submitted by Vijayananda D Mohire having Roll
Number 921DMTE0113 for the partial fulfilment of the requirements of
Master of Technology in Information Technology degree of Karnataka
State Open University, Mysore, embodies the bonafide work done by
him under my supervision.
Place: ________________ Signature of the Internal Supervisor
Name
Date: ________________ Designation
5
For Evaluation
Question
Number
Maximum Marks Marks
awarded
Comments, if any
1 5
2 5
TOTAL 10
Evaluator’s Name and Signature Date
6
Preface
This document has been prepared specially for the assignments of M.Tech – IT I
Semester. This is mainly intended for evaluation of assignment of the academic
M.Tech - IT, I semester. I have made a sincere attempt to gather and study the
best answers to the assignment questions and have attempted the responses to
the questions. I am confident that the evaluator’s will find this submission
informative and evaluate based on the provide content.
For clarity and ease of use there is a Table of contents and Evaluators section to
make easier navigation and recording of the marks. A list of references has been
provided in the last page – Bibliography that provides the source of information
both internal and external. Evaluator’s are welcome to provide the necessary
comments against each response, suitable space has been provided at the end of
each response.
I am grateful to the Infysys academy, Koramangala, Bangalore in making this a big
success. Many thanks for the timely help and attention in making this possible
within specified timeframe. Special thanks to Mr. Vivek and Mr. Prakash for their
timely help and guidance.
Candidate’s Name and Signature Date
7
TABLE OF CONTENTS
FOR EVALUATION................................................................................................................................................................5
PREFACE...............................................................................................................................................................................6
QUESTION 1...................................................................................................................................................................... 10
ANSWER 1......................................................................................................................................................................... 10
QUESTION 2...................................................................................................................................................................... 15
ANSWER 2......................................................................................................................................................................... 15
BIBLIOGRAPHY.................................................................................................................................................................. 19
8
Table of Figures
Figure 1 Student Table created (Oracle, 2009)................................................................................................................11
Figure 2 Student Table populated (Oracle, 2009).........................................................................................................12
Figure 3 Select Statement (Oracle, 2009) .........................................................................................................................12
Figure 4 DML Command : Update (Oracle, 2009)..........................................................................................................13
Figure 5 DML Command: Select (Oracle, 2009)............................................................................................................13
Figure 6 DDL Command: Alter (Oracle, 2009) ................................................................................................................13
Figure 7 TCL Command : SAVE and ROLLBACK (Oracle, 2009) ..........................................................................14
Figure 8 Sailor Table created and populated (Oracle, 2009)..................................................................................16
Figure 9 Boat Table created and populated (Oracle, 2009)....................................................................................17
Figure 10 Reservers table created and populated (Oracle, 2009)......................................................................18
Figure 11 Left Join condition for Sailor and Reservers (Oracle, 2009)..............................................................18
9
ADVANCED DBMS
RESPONSE TO ASSIGNMENT – II
10
Question 1 Make a table using Oracle, SQL and made five entries and run five different
commands.
Answer 1
CREATE TABLE "STUDENTS"
( "STUDENTID" NUMBER NOT NULL ENABLE,
"STUDENTNAME" VARCHAR2(4000) NOT NULL ENABLE,
"STUDENTAGE" NUMBER,
"STUDENTCLASS" VARCHAR2(4000),
"STUDENTGPA" FLOAT,
"STUDENTDOJ" DATE,
"STUDENTMOBILE" NUMBER,
CONSTRAINT "STUDENTS_PK" PRIMARY KEY ("STUDENTID", "STUDENTNAME")
ENABLE,
CONSTRAINT "STUDENTS_UK1" UNIQUE ("STUDENTID") ENABLE
)
/
Figure below shows Table structure( After running CREATE) as in Oracle 10g Express Edition
11
Figure 1 Student Table created (Oracle, 2009)
INSERT
INTO STUDENTS (STUDENTID,
STUDENTNAME,STUDENTAGE,STUDENTCLASS,STUDENTGPA,STUDENTDOJ,STUDENT
MOBILE)
VALUES (001, 'Maya', 24, 'B.Tech', 3, '15-JAN-2009', 9342567);
INSERT
INTO STUDENTS (STUDENTID,
STUDENTNAME,STUDENTAGE,STUDENTCLASS,STUDENTGPA,STUDENTDOJ,STUDENT
MOBILE)
VALUES (002, 'Sara', 25, 'B.Tech', 4, '15-JAN-2009', 1344567);
INSERT INTO STUDENTS (STUDENTID,
STUDENTNAME,STUDENTAGE,STUDENTCLASS,STUDENTGPA,STUDENTDOJ,STUDENT
MOBILE)
VALUES (003, 'Vijay', 29, 'B.Tech', 4, '10-JAN-2009', 98345678);
INSERT INTO STUDENTS (STUDENTID,
STUDENTNAME,STUDENTAGE,STUDENTCLASS,STUDENTGPA,STUDENTDOJ,STUDENT
MOBILE)
VALUES (004, 'Ajay', 24, 'B.Tech', 3, '20-JAN-2009', 23456788);
INSERT INTO STUDENTS (STUDENTID,
STUDENTNAME,STUDENTAGE,STUDENTCLASS,STUDENTGPA,STUDENTDOJ,STUDENT
12
MOBILE)
VALUES (005, 'William', 24, 'B.Tech', 3.5, '10-JAN-2009', 1123456);
Figure below shows Table data ( After running 5 INSERT statement) as in Oracle 10g Express
Edition Object Browser
Figure 2 Student Table populated (Oracle, 2009)
-----
SELECT STUDENTID, STUDENTNAME, STUDENTGPA FROM STUDENTS WHERE STUDENTGPA
> 3;
Figure 3 Select Statement (Oracle, 2009)
Five different commands:
Command 1) – DML type
UPDATE Students S
SET S.StudentMobile = 234561234
WHERE S.StudentID = 1
13
Figure 4 DML Command : Update (Oracle, 2009)
Command 2) – DML type
SELECT COUNT(*) FROM Students WHERE StudentDoj >= '15-JAN-09';
Figure 5 DML Command: Select (Oracle, 2009)
Command 3) DDL type
alter table
Students
add
ProjGuide varchar2(10);
Figure 6 DDL Command: Alter (Oracle, 2009)
Command 4) DCL type
grant select on Students to public;
14
Command 5) TCL type
DECLARE
v_mob Students.StudentMobile%TYPE;
BEGIN
SAVEPOINT A;
UPDATE STUDENTS SET STUDENTMOBILE= 12377760 WHERE STUDENTID= 2;
SELECT STUDENTMOBILE INTO v_mob FROM Students WHERE Studentid = 2;
DBMS_OUTPUT.PUT_LINE('Mobile updated to ' || v_mob);
SAVEPOINT B;
ROLLBACK TO A;
SELECT STUDENTMOBILE INTO v_mob FROM Students WHERE Studentid = 2;
DBMS_OUTPUT.PUT_LINE('Mobile rolled back to ' || v_mob);
COMMIT;
END
SELECT * FROM Students;
Output:
Mobile updated to 12377760
Mobile rolled back to 1344567
Statement processed.
Figure 7 TCL Command : SAVE and ROLLBACK (Oracle, 2009)
Evaluator’s Comments if any:
15
Question 2 Apply the join operation on the two different tables?
Answer 2
CREATE TABLE "SAILORS"
( "SAILORID" NUMBER NOT NULL ENABLE,
"SAILORNAME" CHAR(100),
"RATING" NUMBER,
"AGE" NUMBER
)
/
CREATE TABLE "BOATS"
( "BOATID" NUMBER,
"BOATNAME" VARCHAR2(4000),
"BOATCOLOR" VARCHAR2(4000)
)
/
CREATE TABLE "RESERVERS"
( "SAILORID" NUMBER NOT NULL ENABLE,
"BOATID" NUMBER NOT NULL ENABLE,
"BOOKINGDATE" DATE
)
/
INSERT
INTO Sailors (SAILORID, SAILORNAME, RATING, AGE)
VALUES (1, 'Smith', 1, 32);
INSERT
INTO Sailors (SAILORID, SAILORNAME, RATING, AGE)
VALUES (2, 'John', 2, 30);
16
INSERT
INTO Sailors (SAILORID, SAILORNAME, RATING, AGE)
VALUES (3, 'Joe', 1, 25);
INSERT
INTO Sailors (SAILORID, SAILORNAME, RATING, AGE)
VALUES (4, 'Vivek', 2, 30);
INSERT
INTO Sailors (SAILORID, SAILORNAME, RATING, AGE)
VALUES (5, 'Paul', 4,32);
select * from sailors order by sailorid;
Figure 8 Sailor Table created and populated (Oracle, 2009)
INSERT
INTO Boats (BOATID, BOATNAME, BOATCOLOR)
VALUES (1, 'Coaster', 'White');
INSERT
INTO Boats (BOATID, BOATNAME, BOATCOLOR)
VALUES (2, 'Lunar', 'Grey');
INSERT
INTO Boats (BOATID, BOATNAME, BOATCOLOR)
VALUES (3, 'Pitty', 'Green');
INSERT
INTO Boats (BOATID, BOATNAME, BOATCOLOR)
VALUES (4, 'Salmon', 'Blue');
INSERT
INTO Boats (BOATID, BOATNAME, BOATCOLOR)
VALUES (5, 'Hound', 'Black');
17
select * from Boats order by boatid;
Figure 9 Boat Table created and populated (Oracle, 2009)
INSERT
INTO reservers (SAILORID, BOATID, BOOKINGDATE)
VALUES (1, 1, '16-JAN-2009');
INSERT
INTO reservers (SAILORID, BOATID, BOOKINGDATE)
VALUES (2, 1, '16-JAN-2009');
INSERT
INTO reservers (SAILORID, BOATID, BOOKINGDATE)
VALUES (3, 2, '17-JAN-2009');
INSERT
INTO reservers (SAILORID, BOATID, BOOKINGDATE)
VALUES (4, 2, '17-JAN-2009');
INSERT
INTO reservers (SAILORID, BOATID, BOOKINGDATE)
VALUES (5, 3, '16-JAN-2009');
INSERT
INTO reservers (SAILORID, BOATID, BOOKINGDATE)
VALUES (5, 4, '17-JAN-2009');
INSERT
INTO reservers (SAILORID, BOATID, BOOKINGDATE)
VALUES (5, 3, '18-JAN-2009');
INSERT
INTO reservers (SAILORID, BOATID, BOOKINGDATE)
18
VALUES (1, 3, '18-JAN-2009');
select * from reservers order by sailorid;
Figure 10 Reservers table created and populated (Oracle, 2009)
SELECT sailorid, boatid
FROM Sailors NATURAL LEFT OUTER JOIN Reservers order by sailorid;
Figure 11 Left Join condition for Sailor and Reservers (Oracle, 2009)
NOTE: Sailor 3 is missing in above as it is a Left Outer Join and Sailors table is on the Left
side of the Join and it does not have sailor 3.
Evaluator’s Comments if any:
19
Bibliography
Oracle. (2009). Oracle Database 10g Express edition. California, USA.

More Related Content

PDF
PDF
Numerical Analysis of Tuned Liquid Dampers - Kamalendu Ghosh (09CE3112)
PDF
Compressed ed k12-oap_fin
PDF
EDK12_OAP_FinalReport
PDF
Administrative professional curriculum
PDF
HRL: Learning Subgoals and State Abstraction
PDF
Administrative professional
DOC
rev of supply chain mgt dell 2
Numerical Analysis of Tuned Liquid Dampers - Kamalendu Ghosh (09CE3112)
Compressed ed k12-oap_fin
EDK12_OAP_FinalReport
Administrative professional curriculum
HRL: Learning Subgoals and State Abstraction
Administrative professional
rev of supply chain mgt dell 2

Viewers also liked (6)

PDF
Programmatic queries: things you can code with sql
PPT
Percona Lucid Db
PPT
Emerging database technology multimedia database
PPTX
Advanced DBMS presentation
PPTX
Distributed dbms
PDF
Advanced Database Lecture Notes
Programmatic queries: things you can code with sql
Percona Lucid Db
Emerging database technology multimedia database
Advanced DBMS presentation
Distributed dbms
Advanced Database Lecture Notes
Ad

Similar to MTech - Advanced_DBMS_Assignment (20)

PDF
MTech - Algorithm analysis and design assignment
PDF
M.Tech : Advanced DBMS Assignment I
PDF
M.Tech : Interactive Computer Graphics Assignment II
PDF
MTech - OOSE_Assignment
PDF
M.Tech : Interactive Computer Graphics Assignment I
PDF
Marine structures computations report
PDF
CSIR Brochure
PDF
MTech - AI_NeuralNetworks_Assignment
DOCX
Btp report final_lalit
PDF
jain university Project Report
DOCX
Project.12
PPT
Presentation on Best Faculty Award 2016 - R.D.Sivakumar
DOC
Sample Report Format
PPTX
Db presn(1)
PPT
Training_report23155.ppt
PDF
Gomadam Dissertation
PDF
Sri-PRJ702- Project Report
PDF
Training report_orginal
PDF
JAICOB- A DATA SCIENCE CHATBOT A DATA SCIENCE CHATBOT
DOCX
A internship report on artificial intelligence
MTech - Algorithm analysis and design assignment
M.Tech : Advanced DBMS Assignment I
M.Tech : Interactive Computer Graphics Assignment II
MTech - OOSE_Assignment
M.Tech : Interactive Computer Graphics Assignment I
Marine structures computations report
CSIR Brochure
MTech - AI_NeuralNetworks_Assignment
Btp report final_lalit
jain university Project Report
Project.12
Presentation on Best Faculty Award 2016 - R.D.Sivakumar
Sample Report Format
Db presn(1)
Training_report23155.ppt
Gomadam Dissertation
Sri-PRJ702- Project Report
Training report_orginal
JAICOB- A DATA SCIENCE CHATBOT A DATA SCIENCE CHATBOT
A internship report on artificial intelligence
Ad

More from Vijayananda Mohire (20)

PDF
Bhadale QAI Hub - for multicloud, multitechnology platform
PDF
Practical_Introduction_to_Quantum_Safe_Cryptography
PDF
Progress Report- MIT Course 8.371.3x - VD-Mohire
PDF
Quantum Communications Q&A with Gemini LLM
PDF
Peer Review Certificate for Journal of Engg
PDF
Quantum Algorithms for Electronics - IEEE Certificate
PDF
NexGen Solutions for cloud platforms, powered by GenQAI
PDF
Certificate- Peer Review of Book Chapter on ML
PDF
Key projects Data Science and Engineering
PDF
Key projects Data Science and Engineering
PDF
Bhadale IT Hub-Multi Cloud and Multi QAI
PDF
My key hands-on projects in Quantum, and QAI
PDF
Azure Quantum Workspace for developing Q# based quantum circuits
PDF
Key projects in AI, ML and Generative AI
PDF
My Journey towards Artificial Intelligence
PDF
Bhadale IT Cloud Solutions for Agriculture
PDF
Bhadale IT Cloud Solutions for Agriculture
PDF
Bhadale IT Intel and Azure Cloud Offerings
PDF
GitHub Copilot-vijaymohire
PDF
Practical ChatGPT From Use Cases to Prompt Engineering & Ethical Implications
Bhadale QAI Hub - for multicloud, multitechnology platform
Practical_Introduction_to_Quantum_Safe_Cryptography
Progress Report- MIT Course 8.371.3x - VD-Mohire
Quantum Communications Q&A with Gemini LLM
Peer Review Certificate for Journal of Engg
Quantum Algorithms for Electronics - IEEE Certificate
NexGen Solutions for cloud platforms, powered by GenQAI
Certificate- Peer Review of Book Chapter on ML
Key projects Data Science and Engineering
Key projects Data Science and Engineering
Bhadale IT Hub-Multi Cloud and Multi QAI
My key hands-on projects in Quantum, and QAI
Azure Quantum Workspace for developing Q# based quantum circuits
Key projects in AI, ML and Generative AI
My Journey towards Artificial Intelligence
Bhadale IT Cloud Solutions for Agriculture
Bhadale IT Cloud Solutions for Agriculture
Bhadale IT Intel and Azure Cloud Offerings
GitHub Copilot-vijaymohire
Practical ChatGPT From Use Cases to Prompt Engineering & Ethical Implications

Recently uploaded (20)

PPTX
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
PDF
EaseUS PDF Editor Pro 6.2.0.2 Crack with License Key 2025
DOCX
Modern SharePoint Intranet Templates That Boost Employee Engagement in 2025.docx
PDF
Salesforce Agentforce AI Implementation.pdf
PPTX
Weekly report ppt - harsh dattuprasad patel.pptx
PDF
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
PPTX
Tech Workshop Escape Room Tech Workshop
PDF
BoxLang Dynamic AWS Lambda - Japan Edition
PDF
E-Commerce Website Development Companyin india
PDF
DuckDuckGo Private Browser Premium APK for Android Crack Latest 2025
PDF
CCleaner 6.39.11548 Crack 2025 License Key
PDF
How Tridens DevSecOps Ensures Compliance, Security, and Agility
PDF
Introduction to Ragic - #1 No Code Tool For Digitalizing Your Business Proces...
DOCX
How to Use SharePoint as an ISO-Compliant Document Management System
PPTX
Cybersecurity: Protecting the Digital World
PPTX
Advanced SystemCare Ultimate Crack + Portable (2025)
PPTX
Trending Python Topics for Data Visualization in 2025
PDF
Wondershare Recoverit Full Crack New Version (Latest 2025)
PDF
Autodesk AutoCAD Crack Free Download 2025
PDF
AI/ML Infra Meetup | Beyond S3's Basics: Architecting for AI-Native Data Access
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
EaseUS PDF Editor Pro 6.2.0.2 Crack with License Key 2025
Modern SharePoint Intranet Templates That Boost Employee Engagement in 2025.docx
Salesforce Agentforce AI Implementation.pdf
Weekly report ppt - harsh dattuprasad patel.pptx
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
Tech Workshop Escape Room Tech Workshop
BoxLang Dynamic AWS Lambda - Japan Edition
E-Commerce Website Development Companyin india
DuckDuckGo Private Browser Premium APK for Android Crack Latest 2025
CCleaner 6.39.11548 Crack 2025 License Key
How Tridens DevSecOps Ensures Compliance, Security, and Agility
Introduction to Ragic - #1 No Code Tool For Digitalizing Your Business Proces...
How to Use SharePoint as an ISO-Compliant Document Management System
Cybersecurity: Protecting the Digital World
Advanced SystemCare Ultimate Crack + Portable (2025)
Trending Python Topics for Data Visualization in 2025
Wondershare Recoverit Full Crack New Version (Latest 2025)
Autodesk AutoCAD Crack Free Download 2025
AI/ML Infra Meetup | Beyond S3's Basics: Architecting for AI-Native Data Access

MTech - Advanced_DBMS_Assignment

  • 1. Advanced DBMS (Assignment –II) Submitted in partial fulfilment of the requirements for the degree of Master of Technology in Information Technology by Vijayananda D Mohire (Enrolment No.921DMTE0113) Information Technology Department Karnataka State Open University Manasagangotri, Mysore – 570006 Karnataka, India (2009)
  • 2. 2
  • 4. 4 CERTIFICATE This is to certify that the Assignment-II entitled (Advanced DBMS, subject code: MT14) submitted by Vijayananda D Mohire having Roll Number 921DMTE0113 for the partial fulfilment of the requirements of Master of Technology in Information Technology degree of Karnataka State Open University, Mysore, embodies the bonafide work done by him under my supervision. Place: ________________ Signature of the Internal Supervisor Name Date: ________________ Designation
  • 5. 5 For Evaluation Question Number Maximum Marks Marks awarded Comments, if any 1 5 2 5 TOTAL 10 Evaluator’s Name and Signature Date
  • 6. 6 Preface This document has been prepared specially for the assignments of M.Tech – IT I Semester. This is mainly intended for evaluation of assignment of the academic M.Tech - IT, I semester. I have made a sincere attempt to gather and study the best answers to the assignment questions and have attempted the responses to the questions. I am confident that the evaluator’s will find this submission informative and evaluate based on the provide content. For clarity and ease of use there is a Table of contents and Evaluators section to make easier navigation and recording of the marks. A list of references has been provided in the last page – Bibliography that provides the source of information both internal and external. Evaluator’s are welcome to provide the necessary comments against each response, suitable space has been provided at the end of each response. I am grateful to the Infysys academy, Koramangala, Bangalore in making this a big success. Many thanks for the timely help and attention in making this possible within specified timeframe. Special thanks to Mr. Vivek and Mr. Prakash for their timely help and guidance. Candidate’s Name and Signature Date
  • 7. 7 TABLE OF CONTENTS FOR EVALUATION................................................................................................................................................................5 PREFACE...............................................................................................................................................................................6 QUESTION 1...................................................................................................................................................................... 10 ANSWER 1......................................................................................................................................................................... 10 QUESTION 2...................................................................................................................................................................... 15 ANSWER 2......................................................................................................................................................................... 15 BIBLIOGRAPHY.................................................................................................................................................................. 19
  • 8. 8 Table of Figures Figure 1 Student Table created (Oracle, 2009)................................................................................................................11 Figure 2 Student Table populated (Oracle, 2009).........................................................................................................12 Figure 3 Select Statement (Oracle, 2009) .........................................................................................................................12 Figure 4 DML Command : Update (Oracle, 2009)..........................................................................................................13 Figure 5 DML Command: Select (Oracle, 2009)............................................................................................................13 Figure 6 DDL Command: Alter (Oracle, 2009) ................................................................................................................13 Figure 7 TCL Command : SAVE and ROLLBACK (Oracle, 2009) ..........................................................................14 Figure 8 Sailor Table created and populated (Oracle, 2009)..................................................................................16 Figure 9 Boat Table created and populated (Oracle, 2009)....................................................................................17 Figure 10 Reservers table created and populated (Oracle, 2009)......................................................................18 Figure 11 Left Join condition for Sailor and Reservers (Oracle, 2009)..............................................................18
  • 9. 9 ADVANCED DBMS RESPONSE TO ASSIGNMENT – II
  • 10. 10 Question 1 Make a table using Oracle, SQL and made five entries and run five different commands. Answer 1 CREATE TABLE "STUDENTS" ( "STUDENTID" NUMBER NOT NULL ENABLE, "STUDENTNAME" VARCHAR2(4000) NOT NULL ENABLE, "STUDENTAGE" NUMBER, "STUDENTCLASS" VARCHAR2(4000), "STUDENTGPA" FLOAT, "STUDENTDOJ" DATE, "STUDENTMOBILE" NUMBER, CONSTRAINT "STUDENTS_PK" PRIMARY KEY ("STUDENTID", "STUDENTNAME") ENABLE, CONSTRAINT "STUDENTS_UK1" UNIQUE ("STUDENTID") ENABLE ) / Figure below shows Table structure( After running CREATE) as in Oracle 10g Express Edition
  • 11. 11 Figure 1 Student Table created (Oracle, 2009) INSERT INTO STUDENTS (STUDENTID, STUDENTNAME,STUDENTAGE,STUDENTCLASS,STUDENTGPA,STUDENTDOJ,STUDENT MOBILE) VALUES (001, 'Maya', 24, 'B.Tech', 3, '15-JAN-2009', 9342567); INSERT INTO STUDENTS (STUDENTID, STUDENTNAME,STUDENTAGE,STUDENTCLASS,STUDENTGPA,STUDENTDOJ,STUDENT MOBILE) VALUES (002, 'Sara', 25, 'B.Tech', 4, '15-JAN-2009', 1344567); INSERT INTO STUDENTS (STUDENTID, STUDENTNAME,STUDENTAGE,STUDENTCLASS,STUDENTGPA,STUDENTDOJ,STUDENT MOBILE) VALUES (003, 'Vijay', 29, 'B.Tech', 4, '10-JAN-2009', 98345678); INSERT INTO STUDENTS (STUDENTID, STUDENTNAME,STUDENTAGE,STUDENTCLASS,STUDENTGPA,STUDENTDOJ,STUDENT MOBILE) VALUES (004, 'Ajay', 24, 'B.Tech', 3, '20-JAN-2009', 23456788); INSERT INTO STUDENTS (STUDENTID, STUDENTNAME,STUDENTAGE,STUDENTCLASS,STUDENTGPA,STUDENTDOJ,STUDENT
  • 12. 12 MOBILE) VALUES (005, 'William', 24, 'B.Tech', 3.5, '10-JAN-2009', 1123456); Figure below shows Table data ( After running 5 INSERT statement) as in Oracle 10g Express Edition Object Browser Figure 2 Student Table populated (Oracle, 2009) ----- SELECT STUDENTID, STUDENTNAME, STUDENTGPA FROM STUDENTS WHERE STUDENTGPA > 3; Figure 3 Select Statement (Oracle, 2009) Five different commands: Command 1) – DML type UPDATE Students S SET S.StudentMobile = 234561234 WHERE S.StudentID = 1
  • 13. 13 Figure 4 DML Command : Update (Oracle, 2009) Command 2) – DML type SELECT COUNT(*) FROM Students WHERE StudentDoj >= '15-JAN-09'; Figure 5 DML Command: Select (Oracle, 2009) Command 3) DDL type alter table Students add ProjGuide varchar2(10); Figure 6 DDL Command: Alter (Oracle, 2009) Command 4) DCL type grant select on Students to public;
  • 14. 14 Command 5) TCL type DECLARE v_mob Students.StudentMobile%TYPE; BEGIN SAVEPOINT A; UPDATE STUDENTS SET STUDENTMOBILE= 12377760 WHERE STUDENTID= 2; SELECT STUDENTMOBILE INTO v_mob FROM Students WHERE Studentid = 2; DBMS_OUTPUT.PUT_LINE('Mobile updated to ' || v_mob); SAVEPOINT B; ROLLBACK TO A; SELECT STUDENTMOBILE INTO v_mob FROM Students WHERE Studentid = 2; DBMS_OUTPUT.PUT_LINE('Mobile rolled back to ' || v_mob); COMMIT; END SELECT * FROM Students; Output: Mobile updated to 12377760 Mobile rolled back to 1344567 Statement processed. Figure 7 TCL Command : SAVE and ROLLBACK (Oracle, 2009) Evaluator’s Comments if any:
  • 15. 15 Question 2 Apply the join operation on the two different tables? Answer 2 CREATE TABLE "SAILORS" ( "SAILORID" NUMBER NOT NULL ENABLE, "SAILORNAME" CHAR(100), "RATING" NUMBER, "AGE" NUMBER ) / CREATE TABLE "BOATS" ( "BOATID" NUMBER, "BOATNAME" VARCHAR2(4000), "BOATCOLOR" VARCHAR2(4000) ) / CREATE TABLE "RESERVERS" ( "SAILORID" NUMBER NOT NULL ENABLE, "BOATID" NUMBER NOT NULL ENABLE, "BOOKINGDATE" DATE ) / INSERT INTO Sailors (SAILORID, SAILORNAME, RATING, AGE) VALUES (1, 'Smith', 1, 32); INSERT INTO Sailors (SAILORID, SAILORNAME, RATING, AGE) VALUES (2, 'John', 2, 30);
  • 16. 16 INSERT INTO Sailors (SAILORID, SAILORNAME, RATING, AGE) VALUES (3, 'Joe', 1, 25); INSERT INTO Sailors (SAILORID, SAILORNAME, RATING, AGE) VALUES (4, 'Vivek', 2, 30); INSERT INTO Sailors (SAILORID, SAILORNAME, RATING, AGE) VALUES (5, 'Paul', 4,32); select * from sailors order by sailorid; Figure 8 Sailor Table created and populated (Oracle, 2009) INSERT INTO Boats (BOATID, BOATNAME, BOATCOLOR) VALUES (1, 'Coaster', 'White'); INSERT INTO Boats (BOATID, BOATNAME, BOATCOLOR) VALUES (2, 'Lunar', 'Grey'); INSERT INTO Boats (BOATID, BOATNAME, BOATCOLOR) VALUES (3, 'Pitty', 'Green'); INSERT INTO Boats (BOATID, BOATNAME, BOATCOLOR) VALUES (4, 'Salmon', 'Blue'); INSERT INTO Boats (BOATID, BOATNAME, BOATCOLOR) VALUES (5, 'Hound', 'Black');
  • 17. 17 select * from Boats order by boatid; Figure 9 Boat Table created and populated (Oracle, 2009) INSERT INTO reservers (SAILORID, BOATID, BOOKINGDATE) VALUES (1, 1, '16-JAN-2009'); INSERT INTO reservers (SAILORID, BOATID, BOOKINGDATE) VALUES (2, 1, '16-JAN-2009'); INSERT INTO reservers (SAILORID, BOATID, BOOKINGDATE) VALUES (3, 2, '17-JAN-2009'); INSERT INTO reservers (SAILORID, BOATID, BOOKINGDATE) VALUES (4, 2, '17-JAN-2009'); INSERT INTO reservers (SAILORID, BOATID, BOOKINGDATE) VALUES (5, 3, '16-JAN-2009'); INSERT INTO reservers (SAILORID, BOATID, BOOKINGDATE) VALUES (5, 4, '17-JAN-2009'); INSERT INTO reservers (SAILORID, BOATID, BOOKINGDATE) VALUES (5, 3, '18-JAN-2009'); INSERT INTO reservers (SAILORID, BOATID, BOOKINGDATE)
  • 18. 18 VALUES (1, 3, '18-JAN-2009'); select * from reservers order by sailorid; Figure 10 Reservers table created and populated (Oracle, 2009) SELECT sailorid, boatid FROM Sailors NATURAL LEFT OUTER JOIN Reservers order by sailorid; Figure 11 Left Join condition for Sailor and Reservers (Oracle, 2009) NOTE: Sailor 3 is missing in above as it is a Left Outer Join and Sailors table is on the Left side of the Join and it does not have sailor 3. Evaluator’s Comments if any:
  • 19. 19 Bibliography Oracle. (2009). Oracle Database 10g Express edition. California, USA.