Home Database Mysql Tutorial 1、关系数据库介绍_MySQL

1、关系数据库介绍_MySQL

Jun 01, 2016 pm 01:34 PM
oracle relational database Model

bitsCN.com

目前经常使用的数据库的包括Oracle数据库、MySQL数据库、Microsoft SQL Server数据库、DB2数据库等。
数据模型是对现实世界数据特征的一种抽象。一个完整的数据模型包括数据结构、数据操作和完整性约束三部分在数据模型多级描述中,主要包括概念模型、逻辑数据模型和物理数据模型。概念模型是以客户的观点和想法为基础,对现实世界事物的抽象;逻辑数据模型是指用户看到的数据库中的数据模型,常用的是关系数据模型;物理数据模型是用来表示数据的存储结构的。
1.概念模型
在关系数据库的设计中,概念模型通常是通过E-R图来描述的。其中,E表示实体的意思;R表示关系的意思。因此E—R图也叫做实体—关系图。
在E-R图中,关系是用来表示实体与实体之间相互联系的。关系可以分为一对一,一对多和多对多三种类型。
一对一(1:1):例如,校长和学校的关系
一对多(1:n):例如,院系和学生之间的关系。
多对多(n:m):例如,课程与授课教师之间关系。
2.关系数据模型 
在数据库管理系统的实现中,关系数据模型是通过二维表的形式描述实体与属性之间的关系。
关系数据模型中的表与一般的二维表相比,还是有些不同的。
a.关系是一种规范化的二维表格,每一个属性值都是不可再分的。
b.关系数据模型的二维表中,不会有重复的行。即关系数据模型的二维表中每一行的数据都应该是不同的。
关系数据模型中,常用的关系操作主要包括查询、连接、交、并、差、数据插入、修改和删除的操作。这些操作需要满足一定的关系完整性约束条件。关系的完整性约束包括实体完整性、参照完整性和用户定义完整性。
3.关系模式
关系模式是用来表示对关系的描述。关系数据库中共有3种关系模式,概念模式、外模式和内模式。
模式(Schema):也叫做逻辑模式或者概念模式,用来描述数据库中的数据逻辑结构。可以把概念模式理解为现实世界中的实体在数据库系统中的具体实现。例如,一个关系逻辑结构对应的一个二维数据表,就可以理解为关系数据库中的模式。概念模式与应用程序和计算机硬件等环境无关。
外模式(External Schema):外模式也可以也叫做用户模式,它是概念模式的一部分。在外模式中定义了允许用户操作的数据,例如,在数据库中用户看到的视图就可以理解为关系数据库中的外模式。当然,在关系数据库中由于用户的需求、存储数据的不同,不同数据的外模式也不是完全相同的。
内模式(Internal Schema):内模式也叫做存储模式,它是用来描述数据的物理结构和数据的存储方式的。例如,关系数据库中索引的组织方式、数据记录的存储方式等就可以理解为关系数据库的内模式。
4.常用关系数据库
a.Oracle数据库
Oracle数据库是美国Oracle公司(甲骨文)推出的关系数据库系统,它是目前主流的广泛使用的数据库系统之一。作为大型的数据库系统,Oracle数据库提供了完整的数据管理功能,主要作用与大、中型应用系统、C/S(客户端/服务器)、B/S(浏览器/服务器)系统中的服务器端。对于数据量大、并发操作多,实时性要求高的系统,服务器端的数据库一般都选择Oracle数据库。
b.Microsoft SQL Server数据库
Microsoft SQL Server数据库是Microsoft公司(微软)推出的关系数据库系。也是目前主流的广泛使用的数据库系统之一。SQL Server数据库具有高性能、可扩展、先进的系统管理、支持WINDOWS图形化管理工具、很好的事务处理功能等特点。
c.MySQL数据库
MySQL是瑞典的MySQL AB公司开发的一款功能强大、使用灵活、多用户、多线程SQL的数据库管理系统。为用户提供了丰富的应用程序接口和非常有用的功能集,是互联网中流行的数据库服务器,很多软件开发人员和商业用户也都在使用MySQL数据库。

bitsCN.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1664
14
PHP Tutorial
1268
29
C# Tutorial
1248
24
What to do if the oracle can't be opened What to do if the oracle can't be opened Apr 11, 2025 pm 10:06 PM

Solutions to Oracle cannot be opened include: 1. Start the database service; 2. Start the listener; 3. Check port conflicts; 4. Set environment variables correctly; 5. Make sure the firewall or antivirus software does not block the connection; 6. Check whether the server is closed; 7. Use RMAN to recover corrupt files; 8. Check whether the TNS service name is correct; 9. Check network connection; 10. Reinstall Oracle software.

How to solve the problem of closing oracle cursor How to solve the problem of closing oracle cursor Apr 11, 2025 pm 10:18 PM

The method to solve the Oracle cursor closure problem includes: explicitly closing the cursor using the CLOSE statement. Declare the cursor in the FOR UPDATE clause so that it automatically closes after the scope is ended. Declare the cursor in the USING clause so that it automatically closes when the associated PL/SQL variable is closed. Use exception handling to ensure that the cursor is closed in any exception situation. Use the connection pool to automatically close the cursor. Disable automatic submission and delay cursor closing.

How to create cursors in oracle loop How to create cursors in oracle loop Apr 12, 2025 am 06:18 AM

In Oracle, the FOR LOOP loop can create cursors dynamically. The steps are: 1. Define the cursor type; 2. Create the loop; 3. Create the cursor dynamically; 4. Execute the cursor; 5. Close the cursor. Example: A cursor can be created cycle-by-circuit to display the names and salaries of the top 10 employees.

What steps are required to configure CentOS in HDFS What steps are required to configure CentOS in HDFS Apr 14, 2025 pm 06:42 PM

Building a Hadoop Distributed File System (HDFS) on a CentOS system requires multiple steps. This article provides a brief configuration guide. 1. Prepare to install JDK in the early stage: Install JavaDevelopmentKit (JDK) on all nodes, and the version must be compatible with Hadoop. The installation package can be downloaded from the Oracle official website. Environment variable configuration: Edit /etc/profile file, set Java and Hadoop environment variables, so that the system can find the installation path of JDK and Hadoop. 2. Security configuration: SSH password-free login to generate SSH key: Use the ssh-keygen command on each node

What to do if the oracle log is full What to do if the oracle log is full Apr 12, 2025 am 06:09 AM

When Oracle log files are full, the following solutions can be adopted: 1) Clean old log files; 2) Increase the log file size; 3) Increase the log file group; 4) Set up automatic log management; 5) Reinitialize the database. Before implementing any solution, it is recommended to back up the database to prevent data loss.

Oracle's Role in the Business World Oracle's Role in the Business World Apr 23, 2025 am 12:01 AM

Oracle is not only a database company, but also a leader in cloud computing and ERP systems. 1. Oracle provides comprehensive solutions from database to cloud services and ERP systems. 2. OracleCloud challenges AWS and Azure, providing IaaS, PaaS and SaaS services. 3. Oracle's ERP systems such as E-BusinessSuite and FusionApplications help enterprises optimize operations.

How to stop oracle database How to stop oracle database Apr 12, 2025 am 06:12 AM

To stop an Oracle database, perform the following steps: 1. Connect to the database; 2. Shutdown immediately; 3. Shutdown abort completely.

How to export oracle view How to export oracle view Apr 12, 2025 am 06:15 AM

Oracle views can be exported through the EXP utility: Log in to the Oracle database. Start the EXP utility, specifying the view name and export directory. Enter export parameters, including target mode, file format, and tablespace. Start exporting. Verify the export using the impdp utility.

See all articles