简体   繁体   English

EER图中实体的定义

[英]Definition of entity in EER Diagram

I have to write the conceptual diagram of a DBMS.我必须写一个 DBMS 的概念图。

I have a very simple, maybe banal question, but I found no answers on the internet.我有一个非常简单,也许是平庸的问题,但我在互联网上没有找到答案。

This DBMS will be used by the secretaries of a school.该 DBMS 将由学校的秘书使用。 In this schema there are entities like students, courses, exams and so on.在这个模式中,有学生、课程、考试等实体。

Can I also add the entity " secretary ", even if the secretaries will be the ones who will use the DBMS?我是否也可以添加实体“秘书”,即使秘书是使用 DBMS 的人?

Sure your can.当然可以。 You can, and in fact, you should throw everything on your conceptual design whiteboard that has any relevance to your system.你可以,事实上,你应该把所有与你的系统相关的东西都放在你的概念设计白板上。 And do some contemplation of where the chips might fall.并考虑一下筹码可能落在哪里。

Usually you would have a "User" in your system, and that "User" might be a "Secretary" but very quickly you have other "Users", which would include the "Students" and possibly "Managers" and "Advisors".通常你的系统中有一个“用户”,这个“用户”可能是一个“秘书”,但很快你就会有其他“用户”,其中包括“学生”,可能还有“经理”和“顾问”。

The whole point about a word as general as "Entity" in an Entity-Relationship Model is that it is general and anything whatsoever of interest to your problem can be an "Entity" in that sense.在实体关系 Model 中,与“实体”一样通用的词的全部意义在于它是通用的,任何对您的问题感兴趣的东西都可以是这个意义上的“实体”。

An entity is a type of thing to store in your database system.实体是一种存储在数据库系统中的事物。

Each different entity type has an identifying key, and a distinct set of attributes.每个不同的实体类型都有一个标识键和一组不同的属性。 For example, a user entity might have some identification number, and perhaps attributes for login name, password, creation date, email, real name, etc.例如,一个用户实体可能有一些标识号,可能还有登录名、密码、创建日期、email、真实姓名等属性。

Then you have to ask if a secretary is just one of the users, or is it a distinct entity?那么你要问一个秘书是只是其中的一个用户,还是一个独立的实体?

The answer is driven by whether a secretary has unique attributes.答案取决于秘书是否具有独特的属性。 Is there some fact about each secretary that needs to be stored in the database, that no other user has?是否有一些关于每个秘书需要存储在数据库中的事实,而其他用户没有?

If not, then perhaps secretary is just an example of a user entity.如果不是,那么可能秘书只是用户实体的一个示例。 Maybe it would be helpful to make the user entity have an attribute column to note the type of user (secretary, administrator, faculty, parent, etc.), but not create a separate entity unless the category of secretary needs their own attributes.也许让用户实体有一个属性列来记录用户类型(秘书、管理员、教师、家长等)会有所帮助,但除非秘书类别需要自己的属性,否则不要创建单独的实体。

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

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