我有一个具有以下关系的数据库:
Transaction->Purchase->Item->Schedule
Transaction - self explanitory
Purchase - any purchase info that relates to the item being purchased (quantity, if the user purchases more than one item). A given Transaction can have more than one Purchase_ID tied to it.
Item - Stores Item info and relates it to individual clients.
Schedule - determines the price of an item at a given time of day.
Transaction.TimeStamp
我需要执行一个查询,该查询必须根据是否在提供的日期范围内从 Schedule 中选择一系列值。查询需要根据其主键从 Schedule 中选择一个值。主键无法从事务中追踪。
为了解决这个问题,我决定创建一个表来将 Transaction DIRECTLY 链接到 Schedule 的主表。
最近我发现了表格视图——这是否适合制作表格“视图”?还是我应该只创建一个“实际”表TransactionSchedule
?
transactionSchedule
Transaction_ID Schedule_ID
我的问题是我不了解表格视图何时有用/有什么好处的细节。
是否有一个单独的表来跟踪事务->计划过度杀伤?
真的,任何有关此问题的一般指导将不胜感激。
编辑:此查询仅用于检索已输入的数据
- 谢谢