database DBMS中数据模型和数据库模式之间的区别?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25093452/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Difference between Data Model and Database Schema in DBMS?
提问by Aditya
I know the Data Model is basically two types ER-Model and Relational Model & Database schema is also two type Physical and logical.
我知道数据模型基本上是两种类型的 ER 模型和关系模型和数据库模式也是两种类型的物理和逻辑。
But I can not understand what is the difference between them based on their operation in DBMS?
但是我不明白它们在 DBMS 中的操作有什么区别?
回答by richik jaiswal
A schema is a blueprint of the database which specifies what fields will be present and what would be their types. For example an employee
table will have an employee_ID
column represented by a string of 10 digits and an employee_Name
column with a string of 45 characters.
模式是数据库的蓝图,它指定将出现哪些字段以及它们的类型。例如,一个employee
表将有一个employee_ID
由 10 个数字的字符串表示的employee_Name
列和一个由 45 个字符的字符串表示的列。
Data model is a high level design which decides what can be present in the schema. It provides a database user with a conceptual framework in which we specify the database requirements of the database user and the structure of the database to fulfill these requirements.
数据模型是一种高级设计,它决定了模式中可以存在的内容。它为数据库用户提供了一个概念框架,在该框架中我们指定了数据库用户的数据库需求以及满足这些需求的数据库结构。
A data model can, for example, be a relational model where the data will be organised in tables whereas the schema for this model would be the set of attributes and their corresponding domains.
例如,数据模型可以是关系模型,其中数据将组织在表中,而该模型的模式将是属性集及其对应的域。
References: Understanding the schemaand Database System Concepts (H Korth and A Silberschatz)
参考资料:了解架构和数据库系统概念(H Korth 和 A Silberschatz)
回答by codematrix
As I understand it, a database schema is a physical entity, it describes the structure of exactly how the data is stored and is itself stored by DBMS for reference. Data model, on the other hand, is an abstract representation of database.
据我了解,数据库模式是一个物理实体,它描述了数据存储方式的确切结构,并且本身由 DBMS 存储以供参考。另一方面,数据模型是数据库的抽象表示。
回答by Balanced02
My Idea... A schema decides or describes the fields you will have in a document... while the model is the compilation of schema and ensures that any data moving in or out must conform to that schema
我的想法......模式决定或描述了你将在文档中拥有的字段......而模型是模式的编译并确保任何移入或移出的数据必须符合该模式
回答by rashedcs
The database schema is one that contains list of attributes and instructions to tell the database engine how data is organised whereas Data model is a collection of conceptional tools for describing data, data-relationship and consistency constraints.
数据库模式是一个包含属性列表和指令的列表,用于告诉数据库引擎如何组织数据,而数据模型是用于描述数据、数据关系和一致性约束的概念工具的集合。
回答by Rishabh
From what little i have understood, Data Model is a high level design which defines the kind of tables, the fields in those tables and the relations between different tables. Database schema describes the type(int, string etc) and constraints like length of field should be less than 20 characters. Database Schema refers to the Data model and specifies each table and field in detail.
据我所知,数据模型是一种高级设计,它定义了表的类型、这些表中的字段以及不同表之间的关系。数据库模式描述了类型(整数、字符串等)和字段长度等约束,应小于 20 个字符。Database Schema 是指数据模型,详细指定了每个表和字段。
回答by Abhishek Trivedi
In my view Database model is prepared first and Database schema is followed by that . Data model gives the overall logical view of database model specially in term of their entity relationship whereas Database model is more concentric on entity and their attribute.
在我看来,首先准备数据库模型,然后是数据库模式。数据模型给出了数据库模型的整体逻辑视图,特别是在它们的实体关系方面,而数据库模型更集中于实体及其属性。