简体   繁体   English

SQL考试规范化问题

[英]SQL Exam Normalisation issue

Current studying towards a software engineering degree. 目前正在攻读软件工程学位。 One of the main topics I study under this umbrella is databases. 在此框架下,我研究的主要主题之一是数据库。 I just sat my mock exam for this module and I came up across this question about normalising a database to 3NF. 我刚刚参加了该模块的模拟考试,然后想到了有关将数据库标准化为3NF的问题。

The reason I ask this question is the marking for the mock exam states that the final total number of tables after normalisation is 5. However I got 4 and i'm curious where I went wrong 我问这个问题的原因是模拟考试的分数指出归一化后的最终表总数为5。但是我得到了4,我很好奇我错了

Image of the un-normalised data to be normalised 要归一化的未归一化数据的图像

The final tables i got are listed as below 我得到的决赛桌如下

Batch_id, Agent_id, Agent_name Batch_id,Agent_id,Agent_name

batch_id, holiday_code batch_id,假日代码

holiday_code, airport_id, price, quantity 假日代码,机场编号,价格,数量

airport_id, airport airport_id,机场

When I write it down, I come up with the following tables: 当我写下来时,我拿出下表:

Agent: agent_id, name
Holiday: holiday_code, price, airport_id
Airport: airport_id, airport_name
Batch: batch_id, agent_id
BatchLine: batch_id, holiday_code, quantity

Your answer: 你的答案:

Batch_id, Agent_id, Agent_name Batch_id,Agent_id,Agent_name

Agent_id, agent_name, otherwise you would repeat agent_name in your first table – Joakim Danielson Agent_id,agent_name,否则您将在第一个表中重复agent_name – Joakim Danielson

holiday_code, airport_id, price, quantity 假日代码,机场编号,价格,数量

Won't match up for code B563 (different quantities) 无法匹配代码B563(不同数量)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM