数据库数据源概念
Web designers and developers who have worked their way through HTML, CSS and PHP tend to regard databases as rather esoteric and ethereal things. But databases exist as a very real core component of the modern web, and are the final component of the (W|M|L)AMP stack that we will learn to create a complete web site.
通过HTML , CSS和PHP进行工作的Web设计人员和开发人员倾向于将数据库视为深奥而空灵的事物。 但是数据库作为现代Web的非常真实的核心组件存在,并且是(W | M | L)AMP堆栈的最终组件,我们将学习该数据库来创建完整的网站。
Databases are used to record website data that is either:
数据库用于记录以下网站数据:
- open to addition, removal or modification, such as customer information (mailing and eMail addresses of users, for example) or a limited amount of text that you might want to have the client/site owner change, without having to worry about ruining anything in your HTML or CSS, as in a CMS.
CMS - Available for the user to sort or search, such as product information or entries in a blog.
At their root, databases are nothing more than related tables of data. They are, at a simple conceptual level, very similar to the spreadsheets that you may be familiar with in Excel or similar applications: columns defining what kind of data is placed in them (in MySQL, referred to as fields), and rows containing different records, each row being defined by a sequence of data across multiple fields, read in a single horizontal line.
从根本上讲,数据库不过是相关的数据表 。 从概念上讲,它们与您可能在Excel或类似应用程序中熟悉的电子表格非常相似:用于定义在其中放置哪种数据的列(在MySQL中称为字段 ),以及包含不同数据的行记录 ,每一行由跨多个字段的数据序列定义,并在一条水平线上读取。
It is a frequent mistake of learners to try to make a single database table that attempts to record every single bit of data for your site. Instead, it is usually much more efficient to make several database tables, each recording different aspects of a site (comments, user details, etc., each in a separate table) that share a common unique key, such as a user ID. Using a language such as MySQL you can then query from multiple tables to get the information you require. Most modern databases are relational: that is, they organize data based on principles (known as a schema) by which data in different tables can relate to each other.
学习者经常犯一个错误,他们试图创建一个数据库表来尝试为您的站点记录每一个数据位。 取而代之的是,制作几个数据库表通常效率更高,每个数据库表都记录一个站点的不同方面(注释,用户详细信息等,每个都在单独的表中),它们共享一个共同的唯一键 (例如用户ID)。 然后,使用MySQL之类的语言,您可以从多个表中查询以获取所需的信息。 大多数现代数据库都是关系数据库:也就是说,它们基于原则(称为架构 )来组织数据,通过这些原则,不同表中的数据可以相互关联。
Despite this, it is fairly common to use the terms “database” and “table” interchangeably, much as people confuse “web” and “Internet”.
尽管如此,在人们混淆“ Web”和“ Internet”的情况下 ,互换使用术语“数据库”和“表”还是很普遍的。
翻译自: https://thenewcode.com/419/Introduction-to-Database-Concepts
数据库数据源概念