精通数据库系列之入门-基础篇2_MySQL
数据库系统的产生和发展
众所周知,数据库系统并不是在计算机产生的同时就出现的,而是随着计算机技术的不断发展,在特定的历史时期、特定的需求环境下出现的。人类在1946年发明了世界上的第一台计算机到20世纪60年代这漫长的20年里,计算机操作系统还主要局限于文件的操作,同样,对数据的管理也主要是通过文件系统来实现。进行计算所需要的各种数据存放在各自的文件里面。当要使用这些数据的时候,将文件打开,读取文件中的数据到内存中。当计算完毕后,将计算结果仍旧写入到文件中去。
虽然这种在文件中存放数据的方式目前在很多系统中还在使用,但是,这样的数据存放方式在三四十年前的当时,就已经显示出了非常明显的不足。这些不足主要集中在无法对数据进行有效的统一管理。具体表现在这样几个方面:
程序员编写应用程序非常不方便。应用程序的设计者需要对程序所使用的文件的逻辑结构和物理结构都了解的非常清楚。而计算机操作系统只提供将文件打开、关闭、保存等非常低级的操作,而对数据的修改、查询操作则需要应用程序来解决,如果程序所需要的数据存放在不同的文件里,而且这些文件的存储格式又迥然不同。这样就给应用程序的开发带来了巨大的麻烦,程序员要为程序中所用到的每一个文件都写好相应的接口,而且不同的文件格式相差很大,这样就大大的增加了编程的工作量,从而使得在文件级别上开发应用程序的效率非常低下,严重影响应用软件的发展。
文件结构的每一处修改都将导致应用程序的修改,从而使得应用程序的维护工作量特别大。编过程序的人都有这种体会,就是每当自己开发完毕的程序需要修改的时候,又不得不将源程序重新修改、编译、链接。其麻烦程度可想而知。因为有人戏称编程人员为“老改”人员,个中滋味,外人恐怕很难体会到的。
计算机操作系统中的文件系统一般不支持对文件的并发访问。而在现代计算机系统中,为了充分发挥计算机系统的资源使用效率,一般都允许多个程序“同时”运行,即并发性。对数据库系统同样有并发性的要求,现在比较大型的数据库都有非常强的并发访问机制,这样可以充分利用数据库服务器的软、硬件资源,避免浪费。
由于基于文件系统的数据管理缺乏整体性、统一性,在数据的结构、编码、表示格式等诸多方面不能做到标准化、规范化,不同的操作系统有风格迥异的表示方式,因此在一定程度上造成了数据管理的混乱。另外,基于文件系统的数据管理在数据的安全性和保密性发面难以采取有效的措施,在一些对安全性要求比较高的场合,这种安全上的缺陷是完全不允许的。
针对文件系统的这些重要缺点,人们逐步发展了以统一管理数据和共享数据为主要特征的系统,这就是数据库系统。数据库系统就是在这样的背景下发展起来了。1964年,美国通用电气公司开发成功了世界上的第一个数据库系统——IDS(Integrated Data Store)。IDS奠定了网状数据库的基础,并且得到了广泛的发行和应用,成为数据库系统发展史上的一座丰碑。1969年,美国国际商用机器公司(IBM)也推出世界上第一个层次数据库系统IMS(Information Management System),同样在数据库系统发展史上占有重要的地位。
七十年代初,E.F.Codd在总结前面的层次、网状数据库优缺点的基础上,提出了关系数据模型的概念。他提出了关系代数和关系演算(直到今天,在E.F.Codd的这些基本理论还在左右这数据库系统的发展,也依然是高校计算机专业课堂上所要讲述的重要内容)。在整个七十年代,关系数据库系统无论从理论上还是实践上都去的了丰硕的成果。在理论上,确立了完整的关系模型理论、数据依赖理论和关系数据库的设计理论(在后面将重点讲述这些关系数据库的基本理论);在实践上,世界上出现了很多著名的关系数据库系统,比较著名的如System R,INGRES,Oracle等。
和文件系统相比,数据库系统有一系列的特点,具体表现在以下几个方面:
数据库系统向用户提供高级的接口。在文件系统中,用户要访问数据,必须了解文件的存储格式、记录的结构等。而在数据库系统中,这一切都不需要了。数据库系统为用户处理了这些具体的细节,向用户提供非过程化的数据库语言(即通常所说的SQL语言),用户只要提出需要什么数据,而不必关心如何获得这些数据。对数据的管理完全由数据库管理系统(DBMS: Database Management System)来实现。
查询的处理和优化。查询通常指用户向数据库系统提交的一些对数据操作的请求。由于数据库系统向用户提供了非过程化的数据操纵语言,因此对于用户的查询请求就由DBMS来完成,查询的优化处理就成了DBMS的重要任务。
并发控制。前面曾经提到,文件系统一般不支持并发操作,这样大大的限制了系统资源的有效利用。在数据库系统中,情况就不一样了。现代的数据库系统都有很强的并发操作机制,多个用户可以同时访问数据库,甚至可以同时访问同一个表中的不同记录。这样极大的提高了计算机系统资源的使用效率。
数据的完整性约束。凡是数据都要遵守一定的约束,最简单的一个例子就是数据类型,例如定义成整型的数据就不能是浮点数。由于数据库中的数据是持久的和共享的,因此对于使用这些数据的单位来说,数据的正确行显得非常重要。在关系数据库系统中,比较重要的完整性约束有实体完整性、域完整性、参照完整性和用户自定义的完整性等,在后面的文章中将有重点讲述。
进入二十世纪八十年代之后,计算机硬件技术有了飞速的提高。计算机技术的提高促使计算机应用不断深入,产生了许多新的应用领域,例如计算机辅助设计、计算机辅助制造、计算机辅助教学、办公自动化、智能信息处理、决策支持等。这些新的领域对数据库系统提出了新的要求。但是由于应用的多元化,不能设计出一个统一的数据模型来表示这些新型的数据及其相互关系,因而出现了百家争鸣的局面,产生了演绎数据库、面向对象数据库、分布式数据库、工程数据库、时态数据库、模糊数据库等新型数据库的研究和应用。
不过到目前为止,在世界范围内得到主流应用的还是经典的关系数据库系统,比较知名的如Sybase,Oracle,Informix,SQL Server,DB2等。在本系列专题文章中,我们也将根据数据库系统的实际应用情况,重点介绍关系数据库系统。其他的数据库系统,也将作简单的介绍。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Kimi: In just one sentence, in just ten seconds, a PPT will be ready. PPT is so annoying! To hold a meeting, you need to have a PPT; to write a weekly report, you need to have a PPT; to make an investment, you need to show a PPT; even when you accuse someone of cheating, you have to send a PPT. College is more like studying a PPT major. You watch PPT in class and do PPT after class. Perhaps, when Dennis Austin invented PPT 37 years ago, he did not expect that one day PPT would become so widespread. Talking about our hard experience of making PPT brings tears to our eyes. "It took three months to make a PPT of more than 20 pages, and I revised it dozens of times. I felt like vomiting when I saw the PPT." "At my peak, I did five PPTs a day, and even my breathing was PPT." If you have an impromptu meeting, you should do it

On July 29, at the roll-off ceremony of AITO Wenjie's 400,000th new car, Yu Chengdong, Huawei's Managing Director, Chairman of Terminal BG, and Chairman of Smart Car Solutions BU, attended and delivered a speech and announced that Wenjie series models will be launched this year In August, Huawei Qiankun ADS 3.0 version was launched, and it is planned to successively push upgrades from August to September. The Xiangjie S9, which will be released on August 6, will debut Huawei’s ADS3.0 intelligent driving system. With the assistance of lidar, Huawei Qiankun ADS3.0 version will greatly improve its intelligent driving capabilities, have end-to-end integrated capabilities, and adopt a new end-to-end architecture of GOD (general obstacle identification)/PDP (predictive decision-making and control) , providing the NCA function of smart driving from parking space to parking space, and upgrading CAS3.0

In the early morning of June 20th, Beijing time, CVPR2024, the top international computer vision conference held in Seattle, officially announced the best paper and other awards. This year, a total of 10 papers won awards, including 2 best papers and 2 best student papers. In addition, there were 2 best paper nominations and 4 best student paper nominations. The top conference in the field of computer vision (CV) is CVPR, which attracts a large number of research institutions and universities every year. According to statistics, a total of 11,532 papers were submitted this year, and 2,719 were accepted, with an acceptance rate of 23.6%. According to Georgia Institute of Technology’s statistical analysis of CVPR2024 data, from the perspective of research topics, the largest number of papers is image and video synthesis and generation (Imageandvideosyn

On April 11, Huawei officially announced the HarmonyOS 4.2 100-machine upgrade plan for the first time. This time, more than 180 devices will participate in the upgrade, covering mobile phones, tablets, watches, headphones, smart screens and other devices. In the past month, with the steady progress of the HarmonyOS4.2 100-machine upgrade plan, many popular models including Huawei Pocket2, Huawei MateX5 series, nova12 series, Huawei Pura series, etc. have also started to upgrade and adapt, which means that there will be More Huawei model users can enjoy the common and often new experience brought by HarmonyOS. Judging from user feedback, the experience of Huawei Mate60 series models has improved in all aspects after upgrading HarmonyOS4.2. Especially Huawei M

We know that LLM is trained on large-scale computer clusters using massive data. This site has introduced many methods and technologies used to assist and improve the LLM training process. Today, what we want to share is an article that goes deep into the underlying technology and introduces how to turn a bunch of "bare metals" without even an operating system into a computer cluster for training LLM. This article comes from Imbue, an AI startup that strives to achieve general intelligence by understanding how machines think. Of course, turning a bunch of "bare metal" without an operating system into a computer cluster for training LLM is not an easy process, full of exploration and trial and error, but Imbue finally successfully trained an LLM with 70 billion parameters. and in the process accumulate

Retrieval-augmented generation (RAG) is a technique that uses retrieval to boost language models. Specifically, before a language model generates an answer, it retrieves relevant information from an extensive document database and then uses this information to guide the generation process. This technology can greatly improve the accuracy and relevance of content, effectively alleviate the problem of hallucinations, increase the speed of knowledge update, and enhance the traceability of content generation. RAG is undoubtedly one of the most exciting areas of artificial intelligence research. For more details about RAG, please refer to the column article on this site "What are the new developments in RAG, which specializes in making up for the shortcomings of large models?" This review explains it clearly." But RAG is not perfect, and users often encounter some "pain points" when using it. Recently, NVIDIA’s advanced generative AI solution

Editor of the Machine Power Report: Yang Wen The wave of artificial intelligence represented by large models and AIGC has been quietly changing the way we live and work, but most people still don’t know how to use it. Therefore, we have launched the "AI in Use" column to introduce in detail how to use AI through intuitive, interesting and concise artificial intelligence use cases and stimulate everyone's thinking. We also welcome readers to submit innovative, hands-on use cases. Video link: https://mp.weixin.qq.com/s/2hX_i7li3RqdE4u016yGhQ Recently, the life vlog of a girl living alone became popular on Xiaohongshu. An illustration-style animation, coupled with a few healing words, can be easily picked up in just a few days.

The Xiaomi Mi 15 series is expected to be officially released in October, and its full series codenames have been exposed in the foreign media MiCode code base. Among them, the flagship Xiaomi Mi 15 Ultra is codenamed "Xuanyuan" (meaning "Xuanyuan"). This name comes from the Yellow Emperor in Chinese mythology, which symbolizes nobility. Xiaomi 15 is codenamed "Dada", while Xiaomi 15Pro is named "Haotian" (meaning "Haotian"). The internal code name of Xiaomi Mi 15S Pro is "dijun", which alludes to Emperor Jun, the creator god of "The Classic of Mountains and Seas". Xiaomi 15Ultra series covers
