Database schema(From Wikipedia)

2024-01-27 09:48
文章标签 schema database wikipedia

本文主要是介绍Database schema(From Wikipedia),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

Database schema

From Wikipedia, the free encyclopedia

A depiction of  MediaWiki database schema.

A database schema (pronounced skee-ma, /ˈski.mə/) of a database system is its structure described in a formal language

 supported by the database management system (DBMS) and refers to the organization of data to create a blueprint of how

 a database will be constructed (divided into database tables). The formal definition of database schema is a set of formulas

 (sentences) called integrity constraints imposed on a database. These integrity constraints ensure compatibility between

 parts of the schema. All constraints are expressible in the same language. A database can be considered a structure in 

realization of thedatabase language.[1] The states of a created conceptual schema are transformed into an explicit mapping,

 the database schema. This describes how real world entities are modeled in the database.


"A database schema specifies, based on the database administrator's knowledge of possible applications, the facts that

 can enter the database, or those of interest to the possible end-users."[2] The notion of a database schema plays the same

 role as the notion of theory in predicate calculus. A model of this “theory” closely corresponds to a database, which can be

 seen at any instant of time as a mathematical object. Thus a schema can contain formulas representing integrity constraints 

specifically for an application and the constraints specifically for a type of database, all expressed in the same database

 language.[1] In a relational database, the schema defines the tablesfieldsrelationshipsviewsindexes,packages

proceduresfunctionsqueuestriggerstypessequencesmaterialized viewssynonymsdatabase linksdirectories

JavaXML schemas, and other elements.


Schemata are generally stored in a data dictionary. Although a schema is defined in text database language, the term is

 often used to refer to a graphical depiction of the database structure. In other words, schema is the structure of the database

 that defines the objects in the database.


In an Oracle Database system, the term "schema" has a slightly different connotation. For the interpretation used in an Oracle

 Database, seeschema object.


Contents

  • 1 Levels of database schema
  • 2 Ideal requirements for schema integration
    • 2.1 Completeness
    • 2.2 Overlap preservation
    • 2.3 Extended overlap preservation
    • 2.4 Normalization
    • 2.5 Minimality
  • 3 Example of two schema integrations
  • 4 See also
  • 5 References
  • 6 External links


Levels of database schema

  • Conceptual schema, a map of concepts and their relationships.
  • Logical schema, a map of entities and their attributes and relations
  • Physical schema, a particular implementation of a logical schema
  • Schema object, Oracle database object


Ideal requirements for schema integration


Completeness

All information in the source data should be included in the database schema.[3]


Overlap preservation

Each of the overlapping elements specified in the input mapping is also in a database schema relation.[3]


Extended overlap preservation

Source-specific elements that are associated with a source’s overlapping elements are passed through to the database schema.[3]


Normalization

Main article: Database normalization

Independent entities and relationships in the source data should not be grouped together in the same relation in the database schema. 

In particular, source specific schema elements should not be grouped with overlapping schema elements, if the grouping co-locates

 independent entities or relationships.[3]


Minimality

If any elements of the database schema are dropped then the database schema is not ideal.[3]

These requirements influence the detailed structure of schemas that are produced. Certain applications will not require that all

 of these conditions are met, but these five requirements are the most ideal.


Example of two schema integrations

Example: Suppose we want a mediated (database) schema to integrate two travel databases, Go-travel and Ok-travel.

Go-travel has three relations:

Go-flight(f-num, time, meal)
Go-price(f-num, date, price)
Go-airline(airline, phone)

The attribute f-num is the flight number and meal is a boolean. The other attributes are self-explanatory.

Ok-travel has just one relation:

Ok-flight(f-num, date, time, price, nonstop)

'nonstop' is a boolean.

The overlapping information in Ok-travel’s and Go-travel’s schemas could be represented in a mediated schema:

Flight(f-num, date, time, price)[3]


See also

  • Core Architecture Data Model
  • Data Definition Language
  • Data Design
  • Data dictionary
  • Data model
  • Data modeling
  • Data mapping
  • Database
  • Database integrity
  • entity-relationship model
  • Knowledge Representation
  • Object-Role Modeling
  • Relational algebra
  • Schema Matching
  • SQL
  • Three schema approach


References

  1.  Rybinski, H. (1987). On First-Order-Logic Databases. ACM Transactions on Database Systems, 12( 3), 325-349.
  2. Imielinski T., & Lipski W.(1982). A systematic approach to relational database theory. In Proceedings of the 1982 ACM SIGMOD international conference on Management of data (SIGMOD '82). ACM, New York, NY, USA, 8-14. DOI=10.1145/582353.582356
  3.  Pottinger P., & Berstein P.(2008). Schema merging and mapping creation for relational sources. In Proceedings of the 11th international conference on Extending database technology: Advances in database technology (EDBT '08). ACM, New York, NY, USA, 73-84. DOI=10.1145/1353343.1353357


External links

  • http://www.databaseanswers.org/data_models/
  • http://weblogs.asp.net/scottgu/archive/2006/07/12/Tip_2F00_Trick_3A00_-Online-Database-Schema-Samples-Library.aspx
  • http://msdn.microsoft.com/en-us/library/bb187299%28SQL.80%29.aspx
  • http://www.ciobriefings.com/Publications/WhitePapers/DesigningtheStarSchemaDatabase/tabid/101/Default.aspx

这篇关于Database schema(From Wikipedia)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/649869

相关文章

数据库面试必备之MySQL中的乐观锁与悲观锁

《数据库面试必备之MySQL中的乐观锁与悲观锁》:本文主要介绍数据库面试必备之MySQL中乐观锁与悲观锁的相关资料,乐观锁适用于读多写少的场景,通过版本号检查避免冲突,而悲观锁适用于写多读少且对数... 目录一、引言二、乐观锁(一)原理(二)应用场景(三)示例代码三、悲观锁(一)原理(二)应用场景(三)示例

SQL表间关联查询实例详解

《SQL表间关联查询实例详解》本文主要讲解SQL语句中常用的表间关联查询方式,包括:左连接(leftjoin)、右连接(rightjoin)、全连接(fulljoin)、内连接(innerjoin)、... 目录简介样例准备左外连接右外连接全外连接内连接交叉连接自然连接简介本文主要讲解SQL语句中常用的表

SQL server配置管理器找不到如何打开它

《SQLserver配置管理器找不到如何打开它》最近遇到了SQLserver配置管理器打不开的问题,尝试在开始菜单栏搜SQLServerManager无果,于是将自己找到的方法总结分享给大家,对SQ... 目录方法一:桌面图标进入方法二:运行窗口进入方法三:查找文件路径方法四:检查 SQL Server 安

MySQL 中的 LIMIT 语句及基本用法

《MySQL中的LIMIT语句及基本用法》LIMIT语句用于限制查询返回的行数,常用于分页查询或取部分数据,提高查询效率,:本文主要介绍MySQL中的LIMIT语句,需要的朋友可以参考下... 目录mysql 中的 LIMIT 语句1. LIMIT 语法2. LIMIT 基本用法(1) 获取前 N 行数据(

MySQL 分区与分库分表策略应用小结

《MySQL分区与分库分表策略应用小结》在大数据量、复杂查询和高并发的应用场景下,单一数据库往往难以满足性能和扩展性的要求,本文将详细介绍这两种策略的基本概念、实现方法及优缺点,并通过实际案例展示如... 目录mysql 分区与分库分表策略1. 数据库水平拆分的背景2. MySQL 分区策略2.1 分区概念

MySQL高级查询之JOIN、子查询、窗口函数实际案例

《MySQL高级查询之JOIN、子查询、窗口函数实际案例》:本文主要介绍MySQL高级查询之JOIN、子查询、窗口函数实际案例的相关资料,JOIN用于多表关联查询,子查询用于数据筛选和过滤,窗口函... 目录前言1. JOIN(连接查询)1.1 内连接(INNER JOIN)1.2 左连接(LEFT JOI

MySQL 中查询 VARCHAR 类型 JSON 数据的问题记录

《MySQL中查询VARCHAR类型JSON数据的问题记录》在数据库设计中,有时我们会将JSON数据存储在VARCHAR或TEXT类型字段中,本文将详细介绍如何在MySQL中有效查询存储为V... 目录一、问题背景二、mysql jsON 函数2.1 常用 JSON 函数三、查询示例3.1 基本查询3.2

MySQL中动态生成SQL语句去掉所有字段的空格的操作方法

《MySQL中动态生成SQL语句去掉所有字段的空格的操作方法》在数据库管理过程中,我们常常会遇到需要对表中字段进行清洗和整理的情况,本文将详细介绍如何在MySQL中动态生成SQL语句来去掉所有字段的空... 目录在mysql中动态生成SQL语句去掉所有字段的空格准备工作原理分析动态生成SQL语句在MySQL

MySQL中FIND_IN_SET函数与INSTR函数用法解析

《MySQL中FIND_IN_SET函数与INSTR函数用法解析》:本文主要介绍MySQL中FIND_IN_SET函数与INSTR函数用法解析,本文通过实例代码给大家介绍的非常详细,感兴趣的朋友一... 目录一、功能定义与语法1、FIND_IN_SET函数2、INSTR函数二、本质区别对比三、实际场景案例分

MySQL中的交叉连接、自然连接和内连接查询详解

《MySQL中的交叉连接、自然连接和内连接查询详解》:本文主要介绍MySQL中的交叉连接、自然连接和内连接查询,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录一、引入二、交php叉连接(cross join)三、自然连接(naturalandroid join)四