Professional Documents
Culture Documents
2015
Semester: 4
Course: Database Management System
and
Team Members:
Kavi Pandya (131020): pandyakavi31@gmail.com
Mayank Jobanputra (131026): mayankjobanputra@gmail.com
Urvika Sonar (131060): urvikasonar@gmail.com
Preksha Chavda (121036): prekshachavda99@gmail.com
Problem Statement
Project Description
List of Entities
Normalization of forms
Relational Database Schema
List of Queries
Database Programming:
a. Stored Procedure
b. Triggers
c. Java Connectivity
8. References
1. Problem Statement:
University Database Management System creates, manages and
performs all the activities related to the database of a given
university. The database consists of information about the
university, colleges, students, faculties, academic and research
programs. The main aim of this project is to manage the
database in such a way that information about academic and
research activities can be retrieved easily, efficiently and
accurately.
2. Project Description:
A university has different institutes affiliated with it. These
institutes have various programs that offer degrees in different
departments. Students and faculties of these institutes are
associated with different academic and research programs.
Student enrolls for a particular program in a particular
department. This program consists of various courses.
Experienced faculties teach these courses. Some of these faculty
members are permanent while some are visiting. These courses
have predefined course structure that includes lectures, projects,
assignments, quizzes and exams for which students have to
appear and are evaluated throughout the semester. Teaching
assistants and associates are appointed for various courses that
work under the guidance of the respective faculties teaching that
particular course.
As the institute follows unique project based approach student
takes various research projects apart from the academic projects
and are mentored by the faculties. Seminars, talks and
workshops are held for academic and research purposes.
Faculties are also associated with different research projects.
Research staff accompanies these faculties that consists of
students, teaching assistants and associates and other faculty
members if any. Different organizations and the university itself
fund these research projects. Such research projects have
defined time frame. Many papers are published for these
research projects. Successful projects are further applied for
patents.
3. List of Entities:
Seminars_has_Mentor
Status
Structure_Course
Structure_Course_has_Topics
Student
Student_has_Assignments
Student_has_Exams
Student_has_Quizzes
Student_has_Section_has_course_structures
TA_has_Offerings_Semester
Teaching_Assistants
Teaching_Associates
Time_Schedule
Topics
Visiting_mentor
Workshops
Workshops_has_Class
Workshops_has_Mentor
Workshops_has_Research_Topics
4. Normalization of forms:
It may be possible that in database there are tables created
which has repetitive data and several anomalies, which can
cause inconsistency of data. Normalization is applied to solve
this problem. It helps in solving below listed points:
1. Removing Redundancy:
For example,
a. Funding table containsinformation only about the
funding organizations. It does not include the research
projects that are funded by these organizations.
Information, about which organization is funding which
project, is kept in a separate table. It is done so because
it may be possible that an organization may be funding
more than one research projects and keeping both these
columns in the same table would have resulted in
redundant data, so to avoid this problem normalization
is applied and tables are separated.
b. Department table contains information about the
departments of the institute. Program table contains
information regarding the programs offered in different
departments. Both of these tables are kept separate
because many departments have same programs being
offered and keeping them in the same table would have
I.
II.
List of all the course_structure_id and name that are being offered currently.
III.
Average marks of students within given quiz_id. Here given quiz_id is taken as 1
IV.
set @highest_marks=(select marks from student_assignments where assignment_id=1 order by marks desc limit 1,1);
select first_name, middle_name, last_name, student_id from student where student_id in(
select student_id from student_assignments where assignment_id=1 and marks=@highest_marks);
V.
VI.
VII.
VIII.
10
IX.
Average Attendance(in %age) of the Student in all the courses he has taken so far
set @average_attendance=@gained_attendance*100/@total_attendance;
select @average_attendance as 'Average Attendance(%age)';
X.
XI.
11
XII.
select course_structure_id,courses.course_id,course_name,credits,lecture_no,Attendence
from courses,course_structure where courses.course_ID=course_structure.course_ID
order by credits desc,lecture_no desc,Attendence desc;
XIII.
Average Attendance of students of Students for same course in two different section
12
13
XIV.
XV.
XVI.
XVII.
14
XVIII.
XIX.
XX.
15
XXII.
XXIII.
XXIV.
XXV.
XXVI.
Getting details about all the firms funding various research projects and their
details
16
XXVII.
XXVIII.
XXIX.
17
XXX.
XXXI.
XXXII.
query for retrieving details of faculty taking workshops and also being part of the project
query for finding all the students, faculty and TAs in particular research topics and all the
faculties mentoring the workshops in that particular research topics
XXXIII.
Students as student_author
XXXIV.
Faculty as faculty_author
18
XXXV.
19
XXXVI.
XXXVII.
XXXVIII.
XXXIX.
Core courses
select courses.Course_ID from courses,courses_has_course_type where
courses.Course_ID=courses_has_course_type.Course_ID and
courses_has_course_type.Course_type_ID='C';
XL.
XLI.
Information about a particular student attending current courses, faculties those teaching those
courses, attendence of student in all those courses:
Research projects that are completed, funding organizations that funded them, faculties associated with those
projects, T.As associated with those projects, faculties that are associated are teaching which courses and
student attending those course:
XLII.
XLIII.
List of assignments and its link given for currently taught courses by faculties.
20
XLIV.
XLV.
list of quizzes associated with different courses and TAs associated with them:
XLVI.
21
22
XLVII.
XLVIII.
XLIX.
L.
LI.
select count(*) as No_of_Assignments from assignments natural join assignment_course_structure where Course_Section_ID
in (select Course_Section_ID from section_course_structure natural join course_structure where Course_ID = 'CS101'
and Section_ID = '1' );
LII.
select count(*) as No_of_Quizzes from quizzes natural join course_quiz where Course_Section_ID
in (select Course_Section_ID from section_course_structure natural join course_structure where
Course_ID = 'CS101' and Section_ID = '1' );
LIII.
LIV.
LV.
7. Database Programming:
a. Stored Procedures
i. Stored procedure 1, for finding out all the quizzes, assignments and exams on a particular date
-- --------------------------------------------------------------------------------- Routine DDL
-- Note: comments before and after the routine body will not be stored by the server
-- -------------------------------------------------------------------------------DELIMITER $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `reviews_today`(in given_date date)
BEGIN
select
R.Section_ID,
R.Course_ID,
S.Quiz_ID as review_ID,
S.Date,
'QUIZ' as type,
null as exam_type
from
(select
section_course_structure.Section_ID,
course_structure.Course_ID,
section_course_structure.Course_Section_ID
from
course_structure, section_course_structure
where
section_course_structure.Course_Structure_ID = course_structure.Course_Structure_ID) as R,
(select
quizzes.Quiz_ID, quizzes.Date, course_quiz.Course_Section_ID
from
quizzes, course_quiz
where
course_quiz.Quiz_ID = quizzes.Quiz_ID
and quizzes.Date = given_date) as S
where
R.Course_Section_ID = S.Course_Section_ID
union select
R.Section_ID,
R.Course_ID,
S.Exam_ID as review_ID,
S.Date,
'EXAM' as type,
S.exam_type as exam_type
from
(select
section_course_structure.Section_ID,
23
call reviews_today('2013-09-25');
24
25
call future_quiz('CS101',1,2013-01-01);
Output:
Output:
b. Triggers:
i.New Attendance should be greater than the old otherwise the old value is retained:
CREATE DEFINER=`root`@`localhost` TRIGGER `mydb`.`student_section_course_struct_BEFORE_UPDATE` BEFORE
UPDATE ON `student_section_course_struct` FOR EACH ROW
IF NEW.Attendence < OLD.Attendence THEN
26
27
8. References
a. http://stackoverflow.com/
b. http://dba.stackexchange.com/
c. http://www.w3schools.com/sql/
28