TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
Micro project project co 3i
1. MICRO PROJECT FOR COMPUTER ENGINEERING 3I
1. CREATE A SIMPLE INFORMATION SYSTEM TO STORE COURSE ENROLLMENT DATA FOR
A UNIVERSITY.
Requirements:-
2) CREATE A SIMPLE ORACLE DATABASE & PERFORM SOME COMMON DATABASE
OPERATIONS.
Step 1: Create the tables
The schema for the database is as follows:
1. STUDENT (*snum: number, sname: varchar, deptid: number, slevel: varchar, age: number)
2. CLASS (*cname: varchar, meets_at: date, room: varchar, fid: number)
3. ENROLLED (*snum:number, *cname: varchar)
4. FACULTY (*fid: number, fname: varchar, deptid: number)
5. DEPARTMENT (*deptid: number, dname: varchar, location: varchar)
The fields marked with '*' are primary key
Create all the key and referential integrity constraints necessary to model the application.
2. Step 2:- Insert data into tables
DEPARTMENT
insert into DEPARTMENT values (1,'Computer Sciences','West Lafayette');
insert into DEPARTMENT values (2,'Management','West Lafayette');
insert into DEPARTMENT values (3,'Medical Education','Purdue Calumet');
insert into DEPARTMENT values (4,'Education','Purdue North Central');
insert into DEPARTMENT values (5,'Pharmacal Sciences','Indianapolis');
STUDENT
insert into STUDENT values (0418,'S.Jack',1,'SO',19);
insert into STUDENT values (0671,'A.Smith',2,'FR',20);
insert into STUDENT values (1234,'T.Banks',3,'SR',18);
insert into STUDENT values (3726,'M.Lee',5,'SO',20);
insert into STUDENT values (4829,'J.Bale',3,'JR',22);
insert into STUDENT values (5765,'L.Lim',1,'SR',19);
insert into STUDENT values (0019,'D.Sharon',2,'FR',20);
insert into STUDENT values (7357,'G.Johnson',1,'JR',19);
insert into STUDENT values (8016,'E.Cho',5,'JR',22);
FACULTY
insert into FACULTY values (101,'S.Layton',1);
insert into FACULTY values (102,'B.Jungles',2);
insert into FACULTY values (103,'N.Guzaldo',5);
insert into FACULTY values (104,'S.Boling',4);
insert into FACULTY values (105,'G.Mason',1);
insert into FACULTY values (106,'S.Zwink',2);
insert into FACULTY values (107,'Y.Walton',5);
insert into FACULTY values (108,'I.Teach',5);
insert into FACULTY values (109,'C.Jason',5);
CLASS
insert into CLASS values ('ENG400',to_date('08:30','HH:MI'),'U003',104);
insert into CLASS values ('ENG320', to_date('09:30','HH:MI'),'R128',104);
insert into CLASS values ('COM100', to_date('11:30','HH:MI'),'L108',104);
insert into CLASS values ('ME308', to_date('10:30','HH:MI'),'R128',102);
insert into CLASS values ('CS448', to_date('09:30','HH:MI'),'R128',101);
insert into CLASS values ('HIS210', to_date('01:30','HH:MI'),'L108',104);
insert into CLASS values ('MATH275', to_date('02:30','HH:MI'),'L108',105);
3. insert into CLASS values ('STAT110', to_date('04:30','HH:MI'),'R128',105);
insert into CLASS values ('PHYS100', to_date('04:30','HH:MI'),'U003',101);
ENROLLED
insert into ENROLLED values (0418,'CS448');
insert into ENROLLED values (0418,'MATH275');
insert into ENROLLED values (1234,'ENG400');
insert into ENROLLED values (8016,'ENG400');
insert into ENROLLED values (8016,'ENG320');
insert into ENROLLED values (8016,'HIS210');
insert into ENROLLED values (8016,'STAT110');
insert into ENROLLED values (0418,'STAT110');
insert into ENROLLED values (1234,'COM100');
insert into ENROLLED values (0671,'ENG400');
insert into ENROLLED values (1234,'HIS210');
insert into ENROLLED values (5765,'PHYS100');
insert into ENROLLED values (5765,'ENG320');
Step 3: Query your database
Write SQL queries and run them on the Oracle system.
1. For each department, print the department id, department name and number of faculty affiliated with that
department. Print 0 as the number of faculty if a department has no faculty.
2. Print the faculty id, name and department id of the faculty teaching the maximum number of classes
3. Print the name, department id and age of the student enrolled in the maximum number of classes taught by
faculty affiliated with the Computer Sciences department (i.e. dname is Computer Sciences)
4. Print the name and department id of the student(s) who take classes in all rooms that a class is taught OR are
younger than 20.
5. Print the ids (snum) of the students who have more than 3 (distinct) classmates in total.
6. Print the names of (distinct) faculty who teach 2 or more classes in the same room
7. For each department except Management (i.e. dname = Management), print the department id and the average
age of students in that department. If a department has no students, print 0 for the average age.
8. Print the department id, name and age of the youngest student not enrolled in any classes
9. Print the ids (snum) of the students majoring in a department whose faculty do not teach any classes
10. What is the name of the faculty teaching the class with the greatest number of students enrolled? What is the
number of students in that class?
4. Step 4: Views
Create two views (Name them VIEWA and VIEWB) and print their contents.
A. A view that shows the faculty name followed by the number of classes taught by that faculty, ordered by
faculty name. Print 0 if the number of classes is 0.
B. A view that shows the names of people (students and faculty) that are expected to be present in a room each
time that a relevant class is taught there. This should be one view with both faculty and student names. A student
enrolled in a class is "expected" to be present for each session of the class, and a faculty member teaching a class
is "expected" to be present for each session of the class. Hence, the view should contain three fields: name,
room, and time.
3) Use PL/SQL (Oracle's procedural extension to SQL) to write a few functions and procedures to process
data.
Step1 : PL/SQL Create a file named procedures.sql.
The first line of this file should be:
set serveroutput on size 32000
Note: - Create and run five procedures: pro_department_report, pro_student_stats, pro_faculty_stats,
1) pro_department_report:
Generate a report that lists, for each department, the students in that department.
For each department, you should first print the department name on a line followed by the number of students in
that department on the next line and a numbered list of student names in that department.
The output should be modeled as follows:
Sort by the department name (ascending and sort by student name (ascending) for each department.
Sample output:
Department: Computer Sciences
Total number of students: 3
-------------
1. Alice
2. Bob
3. Joe Department
2) pro_student_stats:
Generate a report that contains statistics about students.
Print out the number of classes that each student is taking; omit students taking no classes. Sort by student name.
Sample output:
Student Name # Classes
--------------- ----------
5. Bob 3
Joe 2
3) pro_faculty_stats:
Generate a report about the total number of students each faculty teaches.
Sort results by faculty name. The number of students for each faculty.