FALL 2020
USMAN INSTITUTE OF TECHNOLOGY Marks obtained:
DEPARTMENT OF COMPUTER SCIENCE
CS311 - Introduction to Database Systems
Pre-Assigned Final Lab Exam Task
Section A
Attempt all questions.
Student name: ________________________________________ Roll. No: _____________ Section: ____
Seat Number: _________________________________________________________________________
Marks:12
Submission Deadline: Friday 12th February 08:00 am
Deliverables:
1. An Evidence document (format: PDF)
2. Recorded video (format: mp4, max duration: 10 minutes)
Task: Design a normalized database for the given scenario.
J.K.Rowling (English and born on 31st July 1965) wrote seven parts for the famous Harry Potter series.
The first book of this series: Harry Potter and the Philosopher’s Stone was first published by Bloomsbury
Children’s Books in June 1997. The book was published in the US by Scholastic Publishers in 1998. Six
further best-selling books followed.
Hogwarts School of Witchcraft and Wizardry (Scotland) is one of the boarding schools of magic for
students and is the primary setting for the first six books in J. K. Rowling's Harry Potter series. Some
other wizarding schools are:
1. Beauxbatons Academy of Magic (France)
2. Castelobruxo (Central Brazil)
3. Durmstrang Institute (Northern Europe)
4. Ilvermorny (Eastern North America)
5. Mahoutokoro School of Magic (Japan)
FALL 2020
A wizarding school is described by its name, the number of houses that it has, current head and deputy
head, and the region it is situated in. There are many Characters in the HP series. A character can be
defined by at least his name and the books that it has appeared in. Being a school of magic, many
subjects are taught at Hogwarts such as Transfiguration, Defense Against the Dark
Arts, Charms, Potions, Astronomy, History of Magic, Herbology , Arithmancy, Muggle
Studies, Divination, Study of Ancient Runes and Care of Magical Creatures. There are Professors, each
specializing in a single subject. All professors are overseen by a school head (principle) who currently is
Dumbledore and the deputy head who is Minerva McGonagall. Some of the other professors at
Hogwarts, along with their specializations are mentioned below:
Professors Courses
Cuthbert Binns History of Magic
Filius Flitwick Charms
Rubeus Hagrid Care of Magical Creatures
Remus Lupin Defense Against the Dark Arts
Minerva McGonagall Transfiguration
Severus Snape Potions
Sybill Trelawney Divination
The OWL (Ordinary Wizarding Level) exams are taken at the end of a student's fifth year at the
Hogwarts School of Witchcraft and Wizardry. OWLs are offered in the subjects a student takes in
their first five years, and many consist of both written (theory) and practical tests. Courses in which
OWLS are offered are Ancient Runes, Arithmancy, History of Magic, Muggle Studies, all of which
have written sections only; Astronomy, Care of Magical Creatures, Charms, Defense Against the
Dark Arts, Herbology, Potions, Transfiguration, all of which have theory and practical exams;
and Divination, which has only a Practical section. Thus, for twelve available subjects, nineteen
examination slots are required.
OWLs are graded using the following system:
Passing Grades Failing Grades
O - Outstanding P - Poor
E - Exceeds Expectations D - Dreadful
A - Acceptable T - Troll
FALL 2020
The examiners for OWLs are not Hogwarts professors, but a group of independent examiners
referred to as Wizarding Examinations Authority, who work in the Ministry of Magic. The Ministry
of Magic is the government body of the wizarding world in Britain, headed by an official entitled
the Minister for Magic. Employment with the Ministry can be obtained right after completion of
a wizarding education, though different offices require different levels of education and sometimes
specific exam results. The Ministry has physical offices in London, deep underground. The Atrium,
which is a large, splendid area serves as primary point of entry and exit for wizard traffic in and out
of the Ministry Headquarters in London, as well as functioning as a reception area for visitors. The
lifts provide access to the other levels (floors) of the magical building, except the tenth level. Given
below are the details of different levels in the ministry building along with the departments that are
present on those levels.
1. Level 1: Office of Minister of Magic and Support Staff
2. Level 2: Department of Magical Law Enforcement
a. Improper Use of Magic Office
b. Auror Headquarters Office
c. Wizengamot Administration Services Office
3. Level 3: Department of Magical Accidents and Catastrophes
a. Accidental Magic Reversal Squad Office
b. Obliviator Headquarters Office
c. Muggle-Worthy Excuses Committee Office
4. Level 4: Department for the Regulation and Control of Magical Creatures
a. Beast, Being and Spirit Divisions Office
b. Pest Advisory Bureau Office
5. Level 5: Department of International Magical Cooperation
a. International Magical Trading Standards Body Office
b. International Magical Office of Law Office
c. International Confederation of Wizards, British Seats Office
6. Level 6: Department of Magical Transportation
a. Floo Network Authority Office
b. Broom Regulatory Control Office
c. Portkey Office
d. Apparition Test Center
7. Level 7: Department of Magical Games and Sports
a. British and Irish Quidditch League Headquarters Office
b. Official Gobstones Club Office
c. Ludicrous Patents Office
8. Level 8: Atrium
9. Level 9: Department of Mysteries
10. Level 10: Courtrooms
Each department is looked after by a single minister and every office within a single department is
headed by a single office in charge. A maximum of only three employees could be working at any
ministry office. A single employee may work in not more than two departments simultaneously.
FALL 2020
1. Identify the entities, attributes, and the relations between them.
2. Design an ERD for the scenario.
3. Implement the ERD on ORACLE Apex, by translating it into a relational model.
4. Populate the database tables with at least 15 records for each entity. If 15 rows are not possible
in some cases like that of the ‘level’ entity, then you may skip. (You may take reference for
authentic scenario-based names and details from any cited internet resource.)
5. Formulate queries for the given questions and attach their retrieved results.
a. Identify the characters who have only appeared in the first book and never again.
b. Create a trigger for maintaining a log in another backup-table for the deletion of any value
in the ministry’s departments table.
c. Identify the course with the lowest number of student enrollments.
d. List the names of all departmental ministers at the Ministry of Magic along with their ages.
e. Identify the course at Hogwarts that has got the maximum count of students receiving a
T grade in OWLs for the last three years.
f. Identify the offices in the ministry, who have a single employee working for them apart
from the office in-charge. (The department name and the employee name are to be
mentioned with the office as well)
g. Identify the total number of employees working on the third level of the ministry building,
having received an O in Transfiguration course in their OWLs.
h. Identify those departments where employees who are simultaneously working in another
department, are working.
i. Create a trigger that fires after a delete operation in student table and deletes all grades
of the student in the grades table that belong to the deleted student.
6. Design at least 5 advanced SQL Queries (document along with their results) serving to find some
meaningful insight from the database. Must include queries with creation of view, subquery,
complex joins, trigger, and stored procedure.
FALL 2020
Requirements:
You are instructed to turn in the evidence document which must include:
1. List of all the identified entities, their attributes, and the relations between them. Any
assumptions made should be documented explicitly and should not violate in any way the
given scenario’s specifications.
2. A visual representation of the scenario through an ERD (include the details of the tool you
have used to create this diagram e.g. Lucidchart) with list of all the functional dependencies.
3. Database schema and script with all the constraints.
4. The data set with which you have populated the tables.
5. Screenshots of all the queries that you have formulated for the given questions in Task-5 and
their complete results also indicating the total number of rows retrieved.
6. Design and document at least 5 advanced SQL Queries (along with their results) serving to
some purpose in the database.
Naming convention: Name_RollNumber_ED_CS311
Recorded video details:
You are instructed to record and turn-in a video of yourself narrating and explaining each
attempted task and the workflow. The video should not exceed 10 minutes time duration.
Naming convention: Name_RollNumber_V_CS311
Note:
• Viva shall be conducted on Friday 12th of February 2021, during the usual lab timings
from 08:15 am till 11:30 am. All students have already been added to the meeting
where you must ensure your presence at 08:15 am.
• This is strictly an individual task and hence collaborated efforts, buying, stealing,
borrowing any other’s work are all forbidden and would result in serious repercussions.
• +2 in viva for an additional designing of a web-app of the given scenario on ORACLE
APEX. (Only iff all other requirements specified in this document HAVE been fulfilled,
then you may redeem those bonus marks)