测试的数据库结构
好吧,我对 mysql 很陌生,我不知道该怎么做,或者至少不是有效的方法。
我必须建立一个数据库来保存人们的信息
其中每个人都有3门课程要通过(教育课程中的课程)可以说在第 1、2 和 3 阶段,如果没有完成第 1 门课程,他们就无法开始课程 2
每门课程有 10 个测试,它们具有相同的名称(例如,课程 1 中有一个名为 example1 的测试,课程 2 中有一个名为 example1 的测试,但难度更大)
没有成绩,只是通过或失败
最后,他们被允许参加每个测试 3 次,我想存储日期(每次尝试)以及谁是考试的申请者(每次尝试)、姓名“老师”在桌子上
well, im really new to mysql, and i have no idea to do what i am intending to, or atleast not the efficient way.
i have to make a database that will hold people's information
within it every person has 3 courses to pass(courses as in educational courses) lets say its stage 1, 2 and 3, they cannot start course 2 without completing course 1
every course has 10 tests, they have the same name (eg. there is a test called example1 in course1 and also a test called example1 in course2, but its more difficult)
there aren't grades, just passed or failed
and lastly they are permitted into taking each test 3 times, i want to store the date(every try) and also who was the applier of the exam(every try), the names of the "teachers" are on a table
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这不是mysql或php的问题。
您应该了解数据库建模。
然后使用这些工具中的任何一个(我喜欢DB Designer 用于建模)
那么您应该学习如何集成 PHP 和 MySQL
It is not a matter of mysql or php.
You should learn about Database Modelling.
And then use any of these tools (I like DB Designer for modelling)
Then you should learn how to integrate PHP and MySQL
尝试使用 mySql 创建的 Sakila 数据库,这是用于训练的示例数据库。您将从那里学到一些技巧,在创建自己的数据库之前,甚至在阅读一些书籍或主题之前,这些技巧非常有用。
Try Sakila database created by mySql, this is an example database used for training. You'll learn a few tricks from there, quite useful before creating your own database or maybe even before reading some books or the theme.
除了帕特里西奥的回答(我认为这是有价值和好的指示)。把你上面写的内容进行扩展。在你的描述中找到关键作品(我希望这将包括人物、课程、测试......)。对于每个关键词,确定您需要保留的所有详细信息。
例如“我必须建立一个数据库来保存人们的信息”对于我需要认识的人......也许是名字,姓氏,出生数据,员工编号等。一个人的哪些详细信息与您相关。将它们列在电子表格或文档中。对每个关键词重复此操作。
然后考虑运行系统所需了解的项目,最后一个要点就是朝着这个方向发展。从中找出任何新的关键词,然后详细说明您需要了解这些关键词的信息。
获取您的详细信息列表并将其标准化。作为一般经验法则,目标是第三范式。在大多数情况下,这似乎是更高水平的标准化与不进行标准化之间的可行折衷方案。也许 80/20 规则之一是,通过 20% 的努力达到目标(而不是标准化为第六范式),您可以获得标准化的 80% 的好处。
提出一个提案,如果您愿意,请随时回来接受我们的批评。
In additon to patricio's answer (which I consider valuable and good pointers). Take what you have written above and extend it. Find the key works in your description (i expect this will include people, course, test ...). For each key word identify all details you need to hold.
E.g. "I have to make a database that will hold peoples information" And for people I need to know ... maybe first name, last name, data of birth, employee number, etc. What ever details of a person is relevant to you. List them in a spreedsheet or document. Repeat this for each key word.
Then consider items you need to know to run the system, your last bullet point heads in this direction. Identify any new key words from that and then details you need to know about those key words.
Take your list of details and normalise it. As a general rule of thumb aim for 3rd normal form. In most cases it appears to be a workable compromise between higher levels of normalisation and not doing it. Maybe one of those 80/20 rules where by with 20% of the effort it takes to get there (as opposed to normalising to 6th normal form) you get 80% of the benefit of normalising.
Put together a proposal and feel free to come back for us to critique it if you want.