QUESTION : 1. Write a PL/SQL PROCEDURE that will list the project names given the course ID. 2. Call the procedure from an anonymous block. Allow the user to enter the course ID (courseno)
SQL
SQL stands for Structured Query Language, is a form of communication that uses queries structured in a specific format to store, manage & retrieve data from a relational database.
Queries
A query is a type of computer programming language that is used to retrieve data from a database. Databases are useful in a variety of ways. They enable the retrieval of records or parts of records, as well as the performance of various calculations prior to displaying the results. A search query is one type of query that many people perform several times per day. A search query is executed every time you use a search engine to find something. When you press the Enter key, the keywords are sent to the search engine, where they are processed by an algorithm that retrieves related results from the search index. Your query's results are displayed on a search engine results page, or SER.
Below is part of a Student
Student (studNo, studName, address, mobileNo)
Registration (studNo, courseNo, regDate, semester, session)
Course (courseNo, courseName, creditHour, level)
Project (projNo, projName, courseNo)
Assignment (projectNo, studNo, startDate, dueDate, hoursSpent)
INSERT INTO STUDENT VALUES (175,'Ali Ahmad','10 jalan Bukit Bintang','019-123');
INSERT INTO STUDENT VALUES (176,'Hanna Syamil','32A Jalan Danau Kota','012-234');
INSERT INTO STUDENT VALUES (182,'Ibnu Hassan','19 Jalan Kota Raya','011-345');
INSERT INTO STUDENT VALUES (183,'Aliya Hamidi','233 Jalan Matahari ','013-456');
INSERT INTO STUDENT VALUES (184,'Kayla Adila','98 Jalan Enau','018-567');
INSERT INTO REGISTRATION VALUES (175,1100,'5/SEP/19',1,'2019/2020');
INSERT INTO REGISTRATION VALUES (175,1103,'3/SEP/19',2,'2019/2020');
INSERT INTO REGISTRATION VALUES (176,1103,'7/SEP/19',2,'2019/2020');
INSERT INTO REGISTRATION VALUES (182,1100,'2/SEP/19',1,'2020/2021');
INSERT INTO REGISTRATION VALUES (182,1103,'6/SEP/19',2,'2020/2021');
INSERT INTO REGISTRATION VALUES (183,1102,'4/SEP/19',2,'2020/2021');
INSERT INTO COURSE VALUES (1100,'
INSERT INTO COURSE VALUES (1103,'DATABASE',3,1);
INSERT INTO COURSE VALUES (1707,'MATHEMATICS',3,1);
INSERT INTO COURSE VALUES (2302,'WEB TECHNOLOGIES',3,2);
INSERT INTO COURSE VALUES (3102,'DATA WAREHOUSING',3,3);
INSERT INTO PROJECT VALUES (11001,'Tic Tac Toe',1100);
INSERT INTO PROJECT VALUES (11002,'Word Generator',1100);
INSERT INTO PROJECT VALUES (11031,'eZakat',1103);
INSERT INTO PROJECT VALUES (17071,'Stochastic BioNet',1707);
INSERT INTO PROJECT VALUES (17072,'Ensemble Kalman Filter',1707);
INSERT INTO ASSIGNMENT VALUES (11001,175,'01/OCT/17','30/NOV/17',10);
INSERT INTO ASSIGNMENT VALUES (11001,182,'01/OCT/18','30/NOV/18',9.5);
INSERT INTO ASSIGNMENT VALUES (11031,175,'01/MAR/18','30/APR/18',8);
INSERT INTO ASSIGNMENT VALUES (11031,176,'01/MAR/18','30/APR/18',9);
INSERT INTO ASSIGNMENT VALUES (11031,182,'01/MAR/19','12/APR/19',8.5);
QUESTION :
1. Write a PL/SQL PROCEDURE that will list the project names given the course ID.
2. Call the procedure from an anonymous block. Allow the user to enter the course ID (courseno)
Step by step
Solved in 4 steps with 2 images