Đang tải... (xem toàn văn)
PROBLEM: A game center has 6 different game areas, including areas, each game area is cared for and managed by a staff member.. Each staff is responsible for selling game cards and check
Trang 1
VIETNAM NATIONAL UNIVERSITY
UNIVERSITY OF SOCIAL SCIENCES AND HUMANITIES
FINAL EXAM
TOPIC: CREATE A DATABASE TO MANAGE A GAME CENTER
Lecturer: TS NGUYEN HOANG LONG Student: Nguyen Thi Kim Ly
Student code: 20032748
Class: K65 Information Management Email: kimlynguyen2312@gmail.com
Hanoi – 2023
Trang 2VIETNAM NATIONAL UNIVERSITY
UNIVERSITY OF SOCIAL SCIENCES AND HUMANITIES
FINAL EXAM
TOPIC: CREATE A DATABASE TO MANAGE A GAME CENTER
Lecturer: TS NGUYEN HOANG LONG Student: Nguyen Thi Kim Ly
Student code: 20032748
Class: K65 Information Management Email: kimlynguyen2312@gmail.com
Hanoi – 2023
Trang 3PROBLEM: 4
Step 1: Analyze requirements 4
Step 2: ERD relational model 7
Step 3: Design the logic diagram 7
Step 4: Create Table/ Insert data/ Queries 10
Trang 4PROBLEM:
A game center has 6 different game areas, including areas, each game area is cared for and managed by a staff member
Each staff is responsible for selling game cards and checking customer cards
Customers need a card to enter the game area
Promotion of 50% off card price for customers who are students Card prices are only reduced when customers bring a valid student card when purchasing the card
Many game cards can have the same bill One game card can be played in all 6 areas
The game areas are open from 9.am to 6.pm every day of the week, with no limit on how long a customer can play during the day and no limit on the number of cards a customer can purchase in the event of a customer lost card
Each game card can be used for a period of 3 months from the date of purchase
After 3 months from the date of card purchase, customers need to go to the gaming area to get another card and must pay a fee to get the card
Step 1: Analyze requirements
• Gaming_area: gaming_area_id, gaming_area_name, start_time, end_time
• Staff: staff_id, staff_name, phone_number, gaming_area_id • Customer: customer_id, customer_name, phone_number,
student_card_id staff_, id
• Game_card: game_card_id , expiration_date, price, staff_id, customer_id
• Bill: bill_id, customer_id, game_card_id, is_apply_voucher, total_price • Each staff will belong to one gaming area
• Staffs will sell many game cards to many different customers
Trang 5• A customer can purchase game cards multiple times • One game card can be used in all 6 game areas in the center
Request v The center has 6 game areas v An area maintained by 1 staff v Staff is responsible for selling
game cards to customers and give a bill for customer (include check valid student_card_id if customer request a voucher for game card)
What types of events should the
Trang 6Request v One game card can be played in 6 areas
v A customer can buy game cards multiple times (lose card) v Customer receive bill when buy
Trang 7Step 2: ERD relational model
Step 3: Design the logic diagram
Gaming_area
Field name Data types Constraints Description
Trang 8Staff
Field name Data types Constraints Description
(225)
Not null The name of staff
Phone_number VARCHAR (20) Unique The phone number of staff
Customer
Field name Data types Constraints Description
Trang 9Game_card
Field name Data type Constraints Description
Experition_date DATE Not Null,
Bill
Field name Data type Constraints Description
Is_apply_voucher BOOLEAN Check Indicates if a bill
Trang 10Step 4: Create Table/ Insert data/ Queries
• Create Table
Trang 11• Insert Data
Trang 14• Queries