SEHH2240 Database Systems Assignment 2

Hello, if you have any need, please feel free to consult us, this is my wechat: wx91due

SEHH2240 Database Systems Assignment 2 (30% of the coursework)

Due: 12 November 2024 (Tuesday) 18:00

Late submission is liable to a penalty of 10% of the available marks for each day late; Saturdays, Sundays and holidays are counted. Submission after 16 November 2024 at 18:00 will not be accepted.

Hand in ONLY softcopy in WORD format

Filename format: class_studentid.docx, e.g., 101_23334455A.docx

(Turnitin Plagiarism Check is applied in the submission link)

Attention:

Type all answers on the answer sheet provided. NO handwriting is accepted.

All personal particulars (including student name, student number) must be typed clearly at the top of the first page of each document, if NOT, 10% of marks will be deducted.

When submitting your assignment via Blackboard, the submission time will be recorded. There will be a sharp cut-off time at Blackboard, so late assignments will be recorded at Blackboard. Softcopies submitted via email or other means will NOT be accepted unless the Blackboard is not available. As many students will submit their assignments to Blackboard at around the deadline time, it normally takes longer for uploading your assignment, so it is strongly suggested that you start submitting earlier, say at least 45 minutes before the deadline. Marks will be deducted for late submission.

Plagiarism will be penalized severely. Marks will be deducted for assignments that are plagiarized in whole or in part, regardless of the sources.2

Question 1 (40 marks)

A college offers several courses to its students. Each course has one single offering, so that there is no distinction between courses and classes. The data are organized into the tables below.

COURSE(CourseCode, CourseName)
STUDENT(StudentID, StudentName, GPA)
ENROLLMENT(StudentID, CourseCode, Mark)
CONVERSION(Grade, LowerMark, HigherMark, GradePoint)
Primary keys are underlined. Foreign keys can be identified by names that are identical to the primary key of another relation. The CONVERSION table is given as follows.

Grade
LowerMark
HigherMark
GradePoint
A
80
100
4.0
B
65
79
3.0
C
50
64
2.0
D
40
49
1.0
F
0
39
0

(a) Make a Microsoft Access database file that implements the four tables above. Assign appropriate data types to the attributes. Populate the tables with four courses, five students, and two enrollments per student. You may leave the GPA column blank. The Mark column should (i) contain marks corresponding to each of the five grades; (ii) one mark is missing. Include SEHH2240 Database Systems and SEHH2239 Data Structures as two of the courses. There should be at least two students taking both SEHH2240 and SEHH2239.

Some sample records:

COURSE('SEHH2240', 'Database Systems')
STUDENT('23111111A', 'Chan Tai Man', NULL)
ENROLLMENT('23111111A', 'SEHH2240', 85)
ENROLLMENT('23222222A', 'SEHH2239', NULL)

You do NOT need to submit the database file, but you need to include in your submission the screen shots of the four tables in datasheet view. Make sure the screen shots are clearly readable (reasonable font size and no blurring of the images).

(b) Write a SQL statement in the Access database to create a table called ENROLLMENT2, which has the same structure as ENROLLMENT table. Provide a screen shot of the SQL statement.

(c) Write a SQL statement in the Access database to retrieve the ID and name of students who have taken both SEHH2240 and SEHH2239. Provide a screen shot of the SQL statement and a screen shot of the query result.

(d) Write a SQL statement in the Access database to return the ID, name, and GPA of each student. The statement should retrieve the marks, convert the marks to grade points, and calculate the GPAs by averaging the grade points of each student. Exclude the missing marks from the calculation of the GPAs. Provide a screen shot of the SQL statement and a screen shot of the query result.3

Question 2 (30 marks)

Create a fully developed Crow’s Foot notation ERD to support the following business operations. Use Lucidchart to produce the ERD. Copy-and-paste the ERD directly from Lucidchart onto WORD to produce a clear picture (refrain from screen capturing). The font size set in Lucidchart should be large enough to make the text clearly readable after pasting the ERD onto WORD.

  1. Mirror Tours (MT) provides guided tours to groups of visitors in Hong Kong. For each tour, the tour name, approximate length (in hours), and fee charged is needed. Guides are identified by an employee ID, but the system should also record a guide’s name, home address, and date of hire. Guides take a test to be qualified to lead specific tours. It is important to know which guides are qualified to lead which tours and the date that they completed the qualification test for each tour. A guide may be qualified to lead many different tours. A tour can have many different qualified guides. New guides may or may not be qualified to lead any tours, just as a new tour may or may not have any qualified guides.
  2. Every tour must be designed to visit at least three locations. For each location, a name, type, and official description are kept. Some locations (such as the Peak) are visited by more than one tour, while others (such as Ocean Park) are visited by a single tour. All locations are visited by at least one tour. The order in which the tour visits each location should be tracked as well.
  3. When a tour is actually given, that is referred to as an “outing.” MT schedules outings well in advance so they can be advertised, and so employees can understand their upcomingwork schedules. A tour can have many scheduled outings, although newly designed tours  may not have any outings scheduled. Each outing is for a single tour and is scheduled for a particular date and time. All outings must be associated with a tour and a guide qualified for that tour. Each outing has one and only one qualified guide. Newly hired guides may not have ever been scheduled to lead any outings.
  4. Tourists, called “clients” by MT, pay to join a scheduled outing. For each client, the name and telephone number are recorded. Clients may sign up to join many different outings, and each outing can have many clients. Information is kept only on clients who have signed up for at least one outing, although newly scheduled outings may not have any clients signed up yet.

The Crow’s Foot ERD should be fully attributed, including all entities, attributes, relationships (connectivities), and constraints (primary keys, foreign keys). Design all appropriate attributes, relationships, and constraints in the ERD. The diagram should include exactly the following entities:

• TOUR, QUALIFIED, GUIDE, STOP, LOCATION, OUTING, BOOKING, CLIENT
Here, STOP records the locations visited by the tours. QUALIFIED records the guides qualified to lead the tours. BOOKING records the clients joining the outings.4

Question 3 (30 marks)

The table below shows some sample data of a database in a restaurant. The OrderID and ItemNo form a composite primary key. The table stores data in one month, in which the prices do not change.

OrderID
ItemNo
TableNo
Date
InTime
DishID
DishName
UnitPrice
Qty
1321
1
17
7-8-2024
14:30
A4
Shrimp Cocktail
80
1
1321
2
17
7-8-2024
14:30
P3
Seafood Spaghetti
118
1
1328
1
8
7-8-2024
14:35
S2
Caesar Salad
108
1
1328
2
8
7-8-2024
14:35
M1
Lamb Shrank
168
2
1342
1
4
7-8-2024
15:00
M3
Sirloin Steak
188
1
1378
1
17
7-8-2024
17:00
M1
Lamb Shrank
168
1

(a) To which types of anomalies (insertion, deletion, modification) is the above table susceptible? Please provide an example for each type of anomaly.
(b) Draw the dependency diagram of the above table. Label all dependencies (full, partial, transitive).
(c) Normalize the above table to 3NF. Give your answer in the form of relational schemas: ENTITY(Attribute1, Attribute2, Attribute3, …) with the primary key attributes underlined.
- End of Assignment 2 -

发表评论

电子邮件地址不会被公开。 必填项已用*标注