Comp115 Assignment 3: Designing a database
Designing a database代写 ou are encouraged to work in groups of up to 6 people. These assignments are designed to be done in groups. Working alone is ···
On this assignment Designing a database代写
You are encouraged to work in groups of up to 6 people. These assignments are designed to be done in groups. Working alone is permissible but not recommended. GradeScope will ask you for the identifies of group members when you submit your work.
Every group should appoint a scribe who fills out this form under group supervision. Please paste your solutions to the problems below into the provided regions on the subsequent pages.
Keep in mind that you will be quizzed on this assignment after it is due, so all members of the group should strive to understand the solution.
When you have finished this form, please assign one group member to upload it to GradeScope.
To login to GradeScope, use your Tufts UTLN and password. Accepting assignments in this format is a bold experiment for us, and we would appreciate your comments on difficulties you might have in submitting assignments, understanding your grade, or any other aspects of this grading system.
Problem 1: Designing a database代写
You have a drink machine to monitor via a database. Drinks are stocked periodically, purchased, and sometimes run out. You want to track:
– Individual sales of drinks, including time of day.
– Times at which each drink sold out.
– Times at which each drink was restocked.
Give the SQL statements that will create tables to track this information. Utilize relationships where possible to avoid storing redundant information. Hint: use psql to test your statements for correct function and syntax.
Solution 1 Designing a database代写
Problem 2: In English, describe the model operations (database changes) that would be necessary in order to track the drink machine data in this database.
Solution 2
Problem 3: Give SQL templates for each operation above, where $1, $2… denote variables. And define the meanings of those variables. Hint: you might want to look up CURRENT_TIME() and CURRENT_DATE() PostgreSQL functions. Also, see Lectures 1-2 for details on these variables.
Solution 3 Designing a database代写