Midterm_Assignment
Midterm_Assignment
ASSESSMENT INFORMATION
This assignment is designed to assess the following learning outcomes:
- CLO1: Provide basic knowledge about databases and SQL language
- CLO2: Perform relational algebra sentences to query data
- CLO3: Perform queries in the database
- CLO4: Design databases
- CLO5: Use objects in the SQL Server
- CLO6: Read English documents to learn new knowledge and technology
This assignment is a group assignment, each group would take 3 to 4 students.
1|Page
TASKS & REQUIREMENTS
(Student please carefully read the tasks’ requirements, and discuss further with your
teammates and decide what to do)
REQUIREMENTS:
- Each group must have these following documents:
o 01 microsoft-word document is for reporting, this is the main document
including introduction of the assignment, business flow… and the works,
the results of the group. The results can be both scripting sql and
screenshots. Please note, in this file, you must declare all the students’ info,
and how your team cooperate.
o 01 pdf document is the conversion of the above word document.
o SQL files include
1 SQL scripting file for DDL
1 SQL scripting file for DML
1 SQL scripting file for Stored Procedures (must)
1 SQL scripting file for Views (must)
1 SQL scripting file for Functions (must)
1 SQL scripting file for Triggers (must)
o 01 PPT file is for reporting, presenting to the teacher.
- Each table of the database, you must fulfill with these actions: INSERT, UPDATE,
DELETE. All tables must have index / keys. Must follow the ER Model.
- You must complete your assignment by using all these elements of database: view,
stored procedure, function, trigger.
- You must build some reports as requests with the above elements; besides, you
need to order the results with descending or ascending.
- Each group must complete at least 10 queries for your assignment and show why
and how you do them.
2|Page
CODE 1 – REAL ESTATE BUSINESS
Project requirements:
1. E-R Model
Analyze and construct an E-R diagram representing the conceptual design of
the database for the above business.
At minimum you must include all the entities and relationship sets implied by
this handout. You may go beyond the minimum. Remember that the manager
who defined the specifications is not computer literate so the specifications
should not be viewed as necessarily being precise and complete.
Be sure to identify primary keys, relationship cardinalities, etc.
You need to build the model with at least 5 entities.
2. Relational Model
After creating an initial relational design from your E-R design, refine it based
on the principles of relational model we have studied in the course.
Create and deploy the relations in SQL Server.
3|Page
4) Create a function to find entities who are both investors and customers,
possessing between 3 and 5 real estate properties.
5) Create a function to find agencies handling more than 15 real estate
properties.
6) Create a function to find the real estate property possessed by the greatest
number of investors.
7) Create a function to find all real estate properties possessed by two or more
investors.
8) Create a function to find investors with the greatest number of real estate
properties in the company’s portfolio.
9) Create a function to find the employee with the greatest sales amount.
10) Create a function to find the street with the greatest number of real estate
properties.
11) Create a procedure to input a customer's name and display all customer
information, including their owned real estate properties.
12) Create a procedure to input an agency office name and display all agency
offices with that name, including the number of customers and investors
involved.
13) Create a procedure to input an agency office name and display information
about the agency and the real estate properties it handles.
14) Create a procedure to input a customer's name and display their transactions
and real estate details.
15) Create a procedure to input a customer’s and an investor’s name, displaying
details of transactions between them, including property name, time, and
agency info.
16) Create a procedure to input square meters, location, and price, displaying all
matching real estate properties along with product, investor, constructor,
and agency info, sorted by descending price.
17) Create a procedure to input a customer’s name and display all real estate
properties they own.
18) Create a procedure to input an agency’s name and display customers,
number of properties owned, the customer with the most properties, and the
customer with the fewest properties, sorted by descending property count.
19) Create a procedure to input a date range and display the number of
transactions for all agency offices during that time.
20) Create a procedure to input a customer’s name and real estate ID, displaying
related employee, investor, and agency office info.
21) Create a procedure to input an investor’s name and display all properties
they own, including sold and unsold properties.
22) Create a procedure to input employee, investor, and customer information,
displaying transaction details related to the inputs.
23) Create a procedure to input employee information and display their
personnel and salary details.
24) Create a trigger to ensure that new customers are older than 16 years and all
fields are filled.
4|Page
25) Create a trigger to ensure that new real estate properties must have an
associated investor.
26) Create a trigger to ensure that new real estate transactions are handled by
one employee for sales and customer care and only involve properties not
owned or posted by their owners.
27) Create a trigger to ensure new employees belong to an agency office or
department and all fields are filled.
28) Create a trigger to automatically update real estate possession info upon
transaction completion.
29) Create a trigger to allow deletion of real estate properties only if there is no
associated investor, owner, or handling employee.
30) Create a trigger to prevent updating the info of employees who are retired,
suspended, or have quit.
31) Create a procedure to generate a report on daily transactions for each agency
office.
32) Create a procedure to generate a report on weekly transactions for each
agency office.
33) Create a procedure to generate a report on monthly transactions for each
agency office.
34) Create a procedure to generate a report on quarterly transactions for each
agency office.
35) Create a procedure to generate a report on yearly transactions for each
agency office.
36) Create a procedure to generate a report on employee statistics for each
agency office, including maximum, minimum, and other personnel details
over time.
37) Create a procedure to generate a report on sales statistics for each employee
in an agency office.
38) Create a procedure to generate a report on real estate property statistics for
each investor, including transaction counts and property types (buildings,
apartments, flats).
39) Create a procedure to generate a report on the place with the greatest number
of transactions.
40) Create a procedure to generate a report on the statistics of each customer,
investor, and owner..
5|Page
CODE 2 – THEATRE PERFORMANCE MANAGEMENT
Description:
A theatre center celebrates art performances like opera, comedy drama, music
performance, music concert, or any other events. The management board of this theatre
want to control and manage well all activities and events, to enhance management and
save time and cost. You can further study and research some theatre in your location and
build up a database for this theatre according to what you understand.
Project requirements:
1. E-R Model
Analyze and construct an E-R diagram representing the conceptual design of
the database for the above business.
At minimum you must include all the entities and relationship sets implied by
this handout. You may go beyond the minimum. Remember that the manager
who defined the specifications is not computer literate so the specifications
should not be viewed as necessarily being precise and complete.
Be sure to identify primary keys, relationship cardinalities, etc.
You need to build the model with at least 5 entities.
2. Relational Model
After creating an initial relational design from your E-R design, refine it based
on the principles of relational model we have studied in the course.
Create and deploy the relations in SQL Server.
6|Page
4) Create a function to find and display the most crowded performance
program of the month.
5) Create a function to find the performance program with the most sessions.
6) Create a function to find the artist who performs the most roles in a session
of a performance program.
7) Create a function to find the performance program with the most artists
participating.
8) Create a function to find the performance program with the longest duration.
9) Create a function to find the work or performance session performed the
most times.
10) Create a function to find the work or performance session with the longest
duration.
11) Create a view to display all ticket sales information for each performance
program.
12) Create a procedure to input a ticket serial number and display information
about the seat, location, ticket type, price, and performance program details.
13) Create a procedure to input a performance program name and time,
displaying detailed information about the program, including artists and
works involved.
14) Create a procedure to input a work or song name and display all
performance programs related to the work, along with detailed information.
15) Create a procedure to input an artist's name and display all performances
they participated in, including their role, song, or work details.
16) Create a procedure to input a month and display all performance programs
for that month.
17) Create a procedure to input a number and display all performance programs
with ticket sales greater than or equal to that number, sorted in descending
order.
18) Create a procedure to input a performance program and generate a ticket
sales statistic for that program.
19) Create a procedure to input artist and program information and display
details about the artists who joined these programs, including their salaries.
20) Create a procedure to input a date and display information about the
programs and ticket sales held on that date.
21) Create a trigger to ensure that a new ticket has complete information,
including serial number, seat, location, type, price, and program details.
22) Create a trigger to ensure that a new performance program includes at least
five performing sessions.
23) Create a trigger to ensure that a new artist has complete and clear
information, such as genre and specialization.
24) Create a trigger to prevent duplicate performing sessions when adding
performance details to a program.
25) Create a trigger to ensure that a new work or song is clearly declared and
belongs to an author or group of authors.
26) Create a trigger to ensure that a new performing session has a clearly
declared work, song, or play.
27) Create a trigger to prevent duplicate performing sessions when editing
7|Page
performance program details.
28) Create a procedure to generate a report on statistics for each performance
program.
29) Create a procedure to generate a report on daily, weekly, and monthly ticket
sales statistics.
30) Create a procedure to generate a report on quarterly ticket sales statistics.
31) Create a procedure to generate a report on yearly ticket sales statistics.
32) Create a procedure to generate a report on the best-performing sessions,
sorted in descending order of likes.
33) Create a procedure to generate a report on the best-performing artists, sorted
in descending order of likes.
34) Create a procedure to generate a report on artist earnings in a month, sorted
in descending order of likes.
35) Create a procedure to generate a report on performance programs of the
month, including most-liked and most-celebrated programs, sorted in
ascending order.
36) Create a procedure to generate a report on revenue, profit, and loss for each
performance program.
37) Create a procedure to generate a report on the most-liked performance
program of the year
8|Page
CODE 3 – ENTERPRISE HUMAN RESOURCE MANAGEMENT
Description:
An enterprise which is about the construction, trading, and services. The manager of this
enterprise wants to build up an information system of management and controlling all
projects and human resources with these projects. The projects of this enterprise may be
construction project, trading project or servicing project. Each project may involve many
people and need some resources. The manager wants to clarify and make everything easier
about projects including personnel, salaries, effectiveness, administration, and other
relevant issues. Build a database that can adapt the manager and his management requires.
You can further check and study about the actual business around you, the things
surrounding for your database design.
Project requirements:
1. E-R Model
Analyze and construct an E-R diagram representing the conceptual design of
the database for the above business.
At minimum you must include all the entities and relationship sets implied by
this handout. You may go beyond the minimum. Remember that the manager
who defined the specifications is not computer literate so the specifications
should not be viewed as necessarily being precise and complete.
Be sure to identify primary keys, relationship cardinalities, etc.
You need to build the model with at least 5 entities.
2. Relational Model
After creating an initial relational design from your E-R design, refine it based
on the principles of relational model we have studied in the course.
Create and deploy the relations in SQL Server.
9|Page
wants turned in. They may provide further hints for your database design.
1) Create a function to find all employees aged 25 to 30 years.
2) Create a function to find projects with the most involved employees.
3) Create a view to display all employees for each project.
4) Create a function to find employees participating in two or more projects
simultaneously.
5) Create a function to find employees working with their spouses in the
company.
6) Create a function to find employees working with their spouses on the same
project.
7) Create a function to find employees whose spouses are also company
employees.
8) Create a view to display customer information and the projects they require,
sorted by the number of projects.
9) Create a function to display the number of employees in each department.
10) Create a view to display projects that are paused or not continuing.
11) Create a view to display information about department heads.
12) Create a function to calculate and display the number of working days in a
month for each employee.
13) Create a procedure to input employee names and display information about
the employee, their department, branch, and projects they are participating
in.
14) Create a procedure to input a date and display information about projects
completed at that time.
15) Create a procedure to input a customer name and display information about
projects requested by that customer, including the number of completed,
postponed, and canceled projects.
16) Create a procedure to input department information and display details of
the department, head, and employees.
17) Create a procedure to input employee name and month to display employee
details, working days, completed projects, company spouse, and current
salary.
18) Create a procedure to input project name and display details about the
project, management department, staff, expiration date, and cost.
19) Create a procedure to input branch name and display branch manager
information, employee count, and branch projects.
20) Create a procedure to input time information and display a list of projects
expiring on that date.
21) Create a function to input monthly information and calculate the total
canceled or stopped projects and associated losses.
22) Create a function to input monthly information and calculate the total
10 | P a g e
completed projects and profits.
23) Create a trigger to add a new project, ensuring it has at least one customer,
a clear cost, and a minimum of five employees, managed by one branch,
with a cost above $1000.
24) Create a trigger to add a new department, ensuring it has a head and at least
10 employees, including the department head.
25) Create a trigger to add a new branch, ensuring it has at least five departments
and one branch head.
26) Create a trigger to add an employee, ensuring the employee belongs to one
branch, is over 18 years old, and has no missing information.
27) Create a trigger to add customer information, ensuring all personal and
contact information is completed.
28) Create a procedure to edit employee salary information, ensuring salary
increases by $100 for employees completing at least five projects in a
month.
29) Create a procedure to edit monthly allowances, awarding $50 for each
international certification and $100 for maternity support.
30) Create a trigger to edit project status, transitioning from in-progress to on-
hold when overdue and to aborted if six months past the deadline while on-
hold.
31) Create a trigger to edit project timing, ensuring only in-progress or on-hold
projects can be timed.
32) Create a procedure to generate a report of the number of projects per day for
each branch.
33) Create a procedure to generate quarterly project quantity reports for each
branch.
34) Create a procedure to generate yearly project quantity reports for each
branch.
35) Create a procedure to generate monthly revenue reports for each branch.
36) Create a procedure to generate quarterly revenue reports for each branch.
37) Create a procedure to generate annual revenue reports for each branch.
38) Create a function to generate a report on the number of employees in each
branch, projects handled by each employee per month, and identify the
employee with the most and least completed projects.
39) Create a function to generate statistical reports for completed, in-progress,
postponed, and canceled projects.
40) Create a function to generate statistical reports for each client's projects,
identifying the client with the highest and lowest number of projects.
41) Create a function to generate statistical reports for branch projects,
identifying the branch with the most completed and most
canceled/postponed projects.
42) Create a procedure to generate reports about the company’s potential
11 | P a g e
customers.
12 | P a g e
CODE 4 – UNIVERSITY MANAGEMENT
Description:
A university needs to build a database about the school management. The school needs to
manage, control, and handle the information of students, instructors, faculties,
departments, buildings, offices, campus, etc.… Please refer to HUTECH or other school
to study and understand about this management business, and then build the database
according to what you get.
Project requirements:
1. E-R Model
Analyze and construct an E-R diagram representing the conceptual design of
the database for the above business.
At minimum you must include all the entities and relationship sets implied by
this handout. You may go beyond the minimum. Remember that the manager
who defined the specifications is not computer literate so the specifications
should not be viewed as necessarily being precise and complete.
Be sure to identify primary keys, relationship cardinalities, etc.
You need to build the model with at least 5 entities.
2. Relational Model
After creating an initial relational design from your E-R design, refine it based
on the principles of relational model we have studied in the course.
Create and deploy the relations in SQL Server.
You should run several testing queries to see that you have loaded your database in the
way you intended. The queries listed below are those that the director of the company
wants turned in. They may provide further hints for your database design.
1) Create a view to display student information in a class.
2) Create a view to display information about courses open in the current
semester.
13 | P a g e
3) Create a view to display information about branches of the school.
4) Create a function to calculate and display the number of teachers in each
subject.
5) Create a function to find teachers who teach more than 3 subjects during the
semester.
6) Create a procedure to display information about all students in any class.
7) Create a view to display a student's timetable.
8) Create a function to identify and display classes with sufficient numbers of
students.
9) Create a function to find instructors who only teach one subject.
10) Create a function to display information about students with the highest
scores in each period.
11) Create a procedure to input subject information and display subject details,
lecturers' details, and the number of students in each class.
12) Create a procedure to input branch name and display information about the
subjects taught there.
13) Create a procedure to input exam name and time to display the subjects in
the exam list, along with exam time, date, and instructors administering the
exam.
14) Create a procedure to input student name or number and exam name,
displaying the student's exam schedule for the semester, number of attempts,
and scores for each subject.
15) Create a procedure to input a student ID and display information about the
subjects the student participates in.
16) Create a procedure to input a student number and display aggregated
transcripts for all semesters.
17) Create a procedure to input student code and semester code, displaying
transcript information for all periods.
18) Create a procedure to input teacher code and semester code to display
information about classes taught by that teacher and the number of students
in each class.
19) Create a procedure to input course code and display information such as
subject name, number of students, subject type (theory, practice, or both),
and credits.
20) Create a function to input branch name and display customer information,
total real estate owned, and sort customers by descending number of
14 | P a g e
properties.
21) Create a function to input faculty information and semester code to calculate
the amount received by the instructor.
22) Create a function to input student code and semester to calculate the amount
to be paid by the student.
23) Create a procedure to display the number of credits students have completed
during their studies.
24) Create a trigger to ensure a student belongs to only one class, cannot be re-
imported if already assigned, and can study in up to three faculties.
25) Create a trigger to ensure scores for students cannot be blank, must follow
a 10-point scale, and cannot be negative.
26) Create a trigger to add an instructor, ensuring correct salary differentiation
between permanent and visiting faculty.
27) Create a trigger to add subject information, ensuring each subject can have
multiple students, multiple teachers, and follow proper management by the
basic or specialized boards.
28) Create a trigger to add a student exam schedule, ensuring each subject has
one exam schedule per semester.
29) Create a procedure to edit scores, ensuring scores cannot be blank or
negative.
30) Create a procedure to edit students' timetables, exam dates, schedules, and
times, ensuring no conflicts with other exam schedules.
31) Create a trigger to close a subject if it does not meet the minimum
requirement of 30 students per class.
32) Create a procedure to generate the annual number of new students for the
school.
33) Create a procedure to generate the school's annual graduation report.
34) Create a procedure to generate a report on the school's annual scientific
research achievements.
35) Create a procedure to generate semester revenue reports for the school.
36) Create a procedure to generate annual revenue reports for the school.
37) Create a procedure to generate salary reports for each faculty member.
38) Create a function to generate statistical reports on subject pass rates,
identifying the subject with the most failures and the highest pass rate.
39) Create a procedure to generate statistical reports of students with excellent
15 | P a g e
academic performance.
40) Create a procedure to generate a report of each student's training score.
16 | P a g e
CODE 5 – SECONDARY SCHOOL MANAGEMENT
Description:
A secondary school wants to digitalize all the management information. Build a database
for this school. A secondary school may need to manage pupils, teachers, teaching
materials, subjects, parents, … Let find a secondary that you know, refer it to define the
business and build it up.
Project requirements:
1. E-R Model
Analyze and construct an E-R diagram representing the conceptual design of
the database for the above business.
At minimum you must include all the entities and relationship sets implied by
this handout. You may go beyond the minimum. Remember that the manager
who defined the specifications is not computer literate so the specifications
should not be viewed as necessarily being precise and complete.
Be sure to identify primary keys, relationship cardinalities, etc.
You need to build the model with at least 5 entities.
2. Relational Model
After creating an initial relational design from your E-R design, refine it based
on the principles of relational model we have studied in the course.
Create and deploy the relations in SQL Server.
You should run several testing queries to see that you have loaded your database in the
way you intended. The queries listed below are those that the director of the company
wants turned in. They may provide further hints for your database design.
1) Create a view to list students for each class.
2) Create a view to display the timetable for each grade.
3) Create a function to retrieve the best students in each class.
4) Create a view to display a list of 7th and 9th grade math teachers.
17 | P a g e
5) Create a function to show teachers who teach more than 2 school subjects.
6) Create a view to display information about homeroom teachers of classes.
7) Create a view to display tuition information for the current semester.
8) Create a procedure to display a list of students who have completed tuition
fees.
9) Create a function to display the test scores of any class.
10) Create a procedure to input a date of birth and display a list of students with
the same birthday.
11) Create a procedure to input class information and display details of the
homeroom teacher and students in that class.
12) Create a procedure to input class and semester information and display the
exam schedule of the class for that semester.
13) Create a procedure to input customer name and time, displaying purchase
information for that time.
14) Create a procedure to input customer and investor names, displaying
transaction details including customer name, investor name, real estate
name, time, and branch.
15) Create a procedure to input desired area, location, and price to display real
estate information, sorted by ascending and descending price.
16) Create a procedure to input customer name and display co-owned properties
for that customer.
17) Create a function to input branch name and display customer details, total
real estate owned, and customers with the most and least real estate, sorted
by descending number of properties.
18) Create a function to input transaction time and display the number of
transactions across all branches during that time.
19) Create a procedure to input customer name and real estate code, displaying
details of employees, investors, and branches involved in the transaction.
20) Create a procedure to input investor information and display the number of
unsold properties owned by the investor.
21) Create a trigger to ensure a teacher cannot teach in two classes at the same
time when adding a timetable.
22) Create a trigger to ensure a student belongs to only one class when adding
a new student.
23) Create a trigger to ensure a class does not exceed 45 students and has a
homeroom teacher when adding a new class.
24) Create a trigger to ensure a teacher teaches at least one subject when adding
a new teacher.
25) Create a trigger to ensure a subject has at least three teachers when adding
a new subject.
26) Create a trigger to ensure each exam is held in a different room when adding
an exam schedule.
27) Create a procedure to edit student information for those born between the
10th and 20th of any month.
28) Create a procedure to edit timetable and exam schedule information.
29) Create a procedure to delete a student's information.
30) Create a procedure to delete timetable information.
18 | P a g e
31) Create a procedure to generate monthly school revenue reports.
32) Create a procedure to generate a report of teachers' salary statistics.
33) Create a function to generate a statistical report on achievements across all
grades (proportion of students promoted, good students, excellent students).
34) Create a procedure to generate a report on achievement statistics.
35) Create a procedure to generate quarterly revenue reports.
36) Create a procedure to generate annual revenue reports.
37) Create a function to generate a report on the number of school teachers,
including the number of subjects taught, total lessons, workdays, and days
off.
38) Create a procedure to generate salary statistics for teachers and staff in the
school.
39) Create a function to generate subject performance reports for teachers with
the best results.
40) Create a procedure to generate an annual report of graduates, including the
number of graduates and graduation scores for each student.
19 | P a g e
CODE 6 – LIBRARY MANAGEMENT
Description:
A library center wants to manage books, magazines, CDs, … and other materials,
employees, facilities, audiences… Build a database that can help the library running better
and more efficiency.
Project requirements:
1. E-R Model
Analyze and construct an E-R diagram representing the conceptual design of
the database for the above business.
At minimum you must include all the entities and relationship sets implied by
this handout. You may go beyond the minimum. Remember that the manager
who defined the specifications is not computer literate so the specifications
should not be viewed as necessarily being precise and complete.
Be sure to identify primary keys, relationship cardinalities, etc.
You need to build the model with at least 5 entities.
2. Relational Model
After creating an initial relational design from your E-R design, refine it based
on the principles of relational model we have studied in the course.
Create and deploy the relations in SQL Server.
You should run several testing queries to see that you have loaded your database in the
way you intended. The queries listed below are those that the director of the company
wants turned in. They may provide further hints for your database design.
1) Create a view to display titles of books, magazines, and newspapers with
the author's name Jack.
2) Create a view to show titles of publications released after 2012.
3) Create a view to display titles of books, magazines, and newspapers with
page numbers between 80 and 160.
20 | P a g e
4) Create a procedure to generate a list of overdue customers.
5) Create a function to retrieve information about customers who borrow 3 to
5 books.
6) Create a function to find employees whose shifts are on Mondays,
Wednesdays, and Fridays, starting from 7 a.m. to 12 noon.
7) Create a procedure to retrieve information about customers borrowing
books managed by an employee named Mike.
8) Create a view to display all employee details.
9) Create a view to display information about books still available in the
library.
10) Create a function to find and return the most borrowed CDs.
11) Create a procedure to display detailed employee information, including
shifts and salaries.
12) Create a procedure to display information about customers who have not yet
returned borrowed publications.
13) Create a procedure to display customer information, including borrowed
publications, borrowed time, return time, and status.
14) Create a procedure to input the title and year of publication and display
similar publications with the same title and year.
15) Create a function to input the publication name and output its current
quantity and estimated borrowing time.
16) Create a procedure to input employee information and display details about
customers borrowing publications managed by that employee, along with
publication details and return times.
17) Create a view to display overall library communication details.
18) Create a procedure to input author, year of publication, and price to display
information about publications that match the input criteria and can be
borrowed.
19) Create a function to input a category and display information about
borrowable publications and their prices.
20) Create a function to input a shift and display employees working in that
shift.
21) Create a procedure to input employee information and display their
workdays, tardiness, and leave records for the month.
22) Create a trigger to add a new customer. The customer must be over 15 years
old, and no field can be empty.
23) Create a trigger to add workdays for an employee and track lateness and
absence based on the duration of the delay.
24) Create a trigger to add data for a publication. The publication must have
non-blank details, and its quantity must be at least 5.
21 | P a g e
25) Create a trigger to add a new employee. Each employee must work a
maximum of 3 days per week.
26) Create a trigger to add a new shift. Each shift must last at least 5 hours and
have at least one employee assigned.
27) Create a procedure to edit publication information, ensuring all fields except
quantity have at least one update.
28) Create a procedure to edit customer information, reducing the maximum
borrowable books for customers with more than 5 late returns.
29) Create a trigger to delete publication information, allowing deletion only
when all publications are returned.
30) Create a procedure to generate a report on the most borrowed publications.
31) Create a procedure to generate a report on lead counts.
32) Create a procedure to generate a report on loan amounts for each day in a
given month.
33) Create a procedure to generate monthly revenue reports.
34) Create a procedure to generate quarterly revenue reports.
35) Create a procedure to generate annual revenue reports.
36) Create a procedure to generate employee transaction reports, including the
highest and lowest number of transactions handled by employees each
month.
37) Create a function to generate a report of customers frequently failing to pay
on time.
38) Create a function to generate a report on the most popular publication
categories.
39) Create a procedure to generate a report on employees, including workdays,
lateness, and absences for each month.
40) Create a procedure to generate salary statistics for employees.
22 | P a g e
CODE 7 – CHAMPION LEAGUE MANAGEMENT
Description:
Project requirements:
1. E-R Model
Analyze and construct an E-R diagram representing the conceptual design of
the database for the above business.
At minimum you must include all the entities and relationship sets implied by
this handout. You may go beyond the minimum. Remember that the manager
who defined the specifications is not computer literate so the specifications
should not be viewed as necessarily being precise and complete.
Be sure to identify primary keys, relationship cardinalities, etc.
You need to build the model with at least 5 entities.
2. Relational Model
After creating an initial relational design from your E-R design, refine it based
on the principles of relational model we have studied in the course.
Create and deploy the relations in SQL Server.
You should run several testing queries to see that you have loaded your database in the
way you intended. The queries listed below are those that the director of the company
wants turned in. They may provide further hints for your database design.
1) Create a view to display information about players aged 18-25.
2) Create a view to display information about players under the age of 30.
23 | P a g e
3) Create a procedure to retrieve and display information about sponsors.
4) Create a function to find and return the team with the most achievements.
5) Create a view to display information about teams that have won the
championship in the last 5 years.
6) Create a function to find and return the team with the most impressive
results after 5 rounds.
7) Create a view to display information about first leg match pairs.
8) Create a view to display information about second leg match pairs.
9) Create a view to show the complete fixtures of the entire season.
10) Create a view to display a list of referees.
11) Create a procedure to input team information and display the list of players
and coaches.
12) Create a procedure to input team information and display the team’s
schedule.
13) Create a procedure to transmit match information and display schedule
details, results, and referee information.
14) Create a procedure to transmit team information and time, and display the
official match lineup and reserve lineup.
15) Create a procedure to handle player data and display team information,
playing position, and the number of goals scored.
16) Create a procedure to transmit match and round information, showing
results, referee details, and card statistics (red and yellow cards).
17) Create a procedure to display a list of matches participated in by each
referee.
18) Create a view to broadcast information about each round, displaying a list
of matches.
19) Create a view to broadcast season time information and display the list of
team standings.
20) Create a view to broadcast stadium information and display details of
matches taking place.
21) Create a trigger to ensure that adding a player associates them with only one
team.
22) Create a trigger to ensure that a newly added stadium is assigned as the home
ground of a football team.
23) Create a trigger to ensure that adding a match enforces that each team meets
twice and assigns at least four referees to the match.
24) Create a trigger to ensure that each added round has at least three match
pairs.
25) Create a trigger to ensure that each added season consists of at least ten
rounds.
26) Create a trigger to validate that sponsors contribute at least $1,000 per
24 | P a g e
season and sponsor the entire tournament.
27) Create a trigger to validate that each ticket is assigned to one match in one
stadium.
28) Create a trigger to validate that each team has at least five players.
29) Create a trigger to prevent match timings from overlapping with other
matches.
30) Create a trigger to automatically apply a two-match ban for players
receiving more than one red card and convert two yellow cards to one red
card.
31) Create a procedure to generate a report of the number of tickets sold for any
match.
32) Create a procedure to generate a report on the number of tickets sold for a
specific round.
33) Create a procedure to generate revenue reports for each match.
34) Create a procedure to generate revenue reports for each round.
35) Create a procedure to generate revenue reports for each season.
36) Create a function to generate a statistical report listing players who received
the most yellow and red cards.
37) Create a function to generate a statistical report of the most popular matches
later in the season.
38) Create a function to generate a statistical report listing the tournament's top
scorers.
39) Create a procedure to generate a statistical report on sponsorships received
by the tournament.
40) Create a function to generate a statistical report of matches with the most
goals..
25 | P a g e
CODE 8 – CHAMPION LEAGUE MANAGEMENT
Description:
A real estate company needs to store information about:
The company has many offices located in many cities. Information about each office
is the office code (identifier) and location.
Each office has one or more employees. The employee has an employee code and
employee name. An employee only works in one office.
An office always has a manager. The manager must be one of the employees working
in that office.
The company needs to save a list of real estate. The information about real estate is the
real estate code (identifier) and location. Information about the location including
street name, city, area code.
Each real estate only stores information at one office. An office may not have a real
estate list yet.
Each real estate has one or more owners. Owner information includes code and name.
A person can be the owner of many real estates.
Project requirements:
1. E-R Model
Analyze and construct an E-R diagram representing the conceptual design of
the database for the above business.
At minimum you must include all the entities and relationship sets implied by
this handout. You may go beyond the minimum. Remember that the manager
who defined the specifications is not computer literate so the specifications
should not be viewed as necessarily being precise and complete.
Be sure to identify primary keys, relationship cardinalities, etc.
You need to build the model with at least 5 entities.
2. Relational Model
After creating an initial relational design from your E-R design, refine it based
on the principles of relational model we have studied in the course.
Create and deploy the relations in SQL Server.
You should run several testing queries to see that you have loaded your database in the
26 | P a g e
way you intended. The queries listed below are those that the director of the company
wants turned in. They may provide further hints for your database design.
1) Display information of all employees working in a specific office.
2) Find the manager of a particular office.
3) List all real estate managed by an office.
4) Display details of owners of a specific real estate property.
5) Show a list of all real estate along with their respective offices and managers.
6) Find offices located in a specific city.
7) Generate a report of all employees grouped by their offices.
8) Generate a report of all real estate grouped by their owners.
9) Display real estate properties and their locations in a specific city.
10) Count the number of employees working in each office.
11) Find the owner(s) with the most real estate properties.
12) Generate a report on the total number of real estate properties managed by each
office.
13) Update the location of a specific real estate property.
14) Add a new employee to an office.
15) Assign a new owner to an existing real estate property.
16) Delete an office and ensure all related employees and real estate properties are
updated accordingly.
17) Display all real estate properties with their corresponding owners and office
locations.
18) Display all employees grouped by their offices and managers.
19) Ensure a new office cannot be added without at least one employee assigned as a
manager.
20) Prevent the deletion of an office if it still has real estate assigned.
21) Procedure to add a new real estate property and assign it to an office and owners.
22) Procedure to transfer an employee from one office to another.
23) Procedure to find all offices in a specific city and generate a report of their managed
real estate.
24) Function to calculate the total number of real estate properties managed by an
office.
27 | P a g e
CRITERIA FOR ASSESSMENT
Please refer the rubrics for detail assessment.
WORD COUNT
Font Times New Roman size 13.
The project must be in a PDF format, a file power point. The file name must be as
follows:
All work submitted after the submission deadline without a valid and approved reason
(see below) will be given a mark of zero.
Students MUST keep a copy and/or an electronic file of their assignment and print
screen/ capture the screen to prove that they have uploaded the assignment successfully
on time.
THE END
28 | P a g e