What is the difference between schema and data dictionary?

偶尔善良 提交于 2020-01-02 03:40:20

问题


The definition of schema is logical structure of data in database. It is owned by a user and has the same name as the database user. The schema contains name of table, what is it's column type etc. And the data dictionary also contains metadata only (offcourse it is at database level and not at user level). What is the exact difference between schema and data dictionary?


回答1:


These definitions are from my experience (programmer for 20+ years, 7 years in consulting, some time as an independent contractor). YMMV.

"Schema" describes structure. It might include metadata that describes aspects of the structure.

A "data dictionary" associates context with elements of the structure. It also might include metadata that describes aspects of relationships.

For example, A 'person' might be described by the usual fields - last_name, first_name, honorific, etc. If there is a relationship to another person - father, husband, etc - those values might be considered "schema data" because the relationships are constrained by specific values.

That the 'person' is a 'student' or a 'teacher' or a 'prisoner' etc - that is defined by the data dictionary for the particular system.




回答2:


Usually "schema" means "inside the RDBMS". This generally means some technical minimum. Perhaps supplemented with one "comment" field.

Data Dictionary usually means "outside the RDBMS". This generally means some larger and more complex structure that is not limited to RDBMS table/column technology.

If you had two specific examples of a specific schema (e.g. Oracle) and a specific data dictionary against which to compare, you'd have an "exact" difference.



来源:https://stackoverflow.com/questions/3115112/what-is-the-difference-between-schema-and-data-dictionary

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!