G8 - Managing Data - L03 - Worksheet 6 (Answers)
G8 - Managing Data - L03 - Worksheet 6 (Answers)
Questions
Tablename: Products
Name Price (VND) Category ProductID
Rice Cooker 500,000 Kitchen 1
Electric Kettle 300,000 Kitchen 2
Fan 700,000 Appliances 3
Vacuum Cleaner 1,200,000 Appliances 4
Toaster 250,000 Kitchen 5
Blender 600,000 Kitchen 6
Chopsticks 30,000 Kitchen 7
Washing Machine 8,500,000 Appliances 8
(a) Add a primary key to the Products data table above. [1]
See table above. Any sensible name for the primary key is acceptable.
(b) The shop had three customers. This is what they purchased (bought):
1st February 2024, a fan and a toaster were purchased.
3rd February 2024, a washing machine was purchased.
4th February 2024, an electric kettle, a rice cooker and chopsticks were purchased.
Create a data table below, called Purchases, that has the information about what the customers purchased.
You should follow 'best practice' and make sure the Purchases table has a primary key.
Tablename: Purchases
Purchase Number Date ProductID Purchase ID
1 01/02/2024 3 1
1 01/02/2024 5 2
2 03/02/2024 8 3
3 04/02/2024 2 4
3 04/02/2024 1 5
3 04/02/2024 7 6
[3]
Purchase ID [1]
Your answer should match what you used in the table in part (b)
ProductID [1]
Your answer should match what you used in the table in part (b)
Name: ___________________________________________________________________ Class:___________
Name: ___________________________________________________________________ Class:___________
Tablename: Players
PlayerID Name Age JoinDate
1 An Nguyen 13 01/09/2023
2 Bao Tran 14 10/09/2023
3 Chi Le 14 15/09/2023
4 Danh Pham 13 20/09/2023
5 Minh Do 14 25/09/2023
6 Lan Pham 14 01/10/2023
(a) The basketball team has played against three other teams so far:
1st July 2024, against a team called Tigers
8th July 2024, against a team called Eagles
15th July 2024, against a team called Sharks
Create a data table below, called MatchSchedule, that has the information about the basketball matches.
Make sure your table has a primary key.
Tablename: MatchSchedule
GameID OpponentName GameDate
1 Tigers 01/07/2024
2 Eagles 08/07/2024
3 Sharks 15/07/2024
(1 mark for each column that is correct) [3]
Create a data table below, called GameInfo, that has the information about the players, what position (role)
they played and the number of points they scored. Make sure your table has a primary key.
Tablename: GameInfo
InfoID GameID PlayerID Role PointsScored
1 1 1 Power Forward 12
2 1 6 Substitute 3
3 1 3 Center 10
4 2 2 Power Forward 15
5 2 3 Center 7
6 3 6 Small Forward 9