Problem Bank for Post Test Problems¶
We use SQL to manage a vending machine. Our current table goods looks like this:
To help us refill goods that are low in stock,
please write a SELECT statement to retrieve the name and brand of all items
in the table goods that belongs to type of “chips” and has a quantity of
less than 15.
note: When you run the code, there will be several execution results. Please only refer to the last execution result for debugging purposes.
Aside from the goods table:
We have another table transactions that looks like this:
Where the goods_id in this table refers to the id in the goods table above.
To provide better service, we want to know when people purchased a type of item and how they paid.
Please write a statement using SELECT and JOIN to: select the type from the goods table
and method and date from the transactions table, where the goods_id in the
transactions table is the same as the id in the goods table.
note: When you run the code, there will be several execution results. Please only refer to the unittest and the last execution result for debugging purposes.
Thank You 🤗¶
🎉 We appreciate your participation in our study.
If you have questions or feedback, or want to know more, please contact Zihan Wu (ziwu@umich.edu).