|
| |||||||||||||||||||
|
|||||||||||||
SQL is a standard computer language for accessing and manipulating databases.
SQL是一种标准的计算机语言,它可以用来访问和操作数据库
SQL is an ANSI (American National Standards Institute) standard computer language for accessing and manipulating database systems. SQL statements are used to retrieve and update data in a database. SQL works with database programs like MS Access, DB2, Informix, MS SQL Server, Oracle, Sybase, etc.
SQL是ANSI体系中标准的数据库访问以及处理语言。SQL可以使用在像MS Access,DB2,Informix,MS SQL Server,Oracle,Sybase,等等一些数据库上。
Unfortunately, there are many different versions of the SQL language, but to be in compliance with the ANSI standard, they must support the same major keywords in a similar manner (such as SELECT, UPDATE, DELETE, INSERT, WHERE, and others).
但它依然有多种版本,不过他们在关键字的使用上还是遵循了ANSI所规定的(比如SELECT,UPDATE,DELETE,INSERT,WHERE以及其他的一些)
Note: Most of the SQL database programs also have their own proprietary extensions in addition to the SQL standard!
注意:大多数数据库程序都带有属于他们自身特色的扩展属性。
A database most often contains one or more tables. Each table is identified by a name (e.g. "Customers" or "Orders"). Tables contain records (rows) with data.
一份数据库通常会含有一张或是多张表。每张表都有自己的名称以做区分(比如:"客户"或是"定单")。数据库表内可以记录相关的数据。
Below is an example of a table called "Persons":
下面就是一个名为"Persons"的数据库表格:
| LastName | FirstName | Address | City |
|---|---|---|---|
| Hansen | Ola | Timoteivn 10 | Sandnes |
| Svendson | Tove | Borgvn 23 | Sandnes |
| Pettersen | Kari | Storgt 20 | Stavanger |
The table above contains three records (one for each person) and four columns (LastName, FirstName, Address, and City).
With SQL, we can query a database and have a result set returned.
利用SQL我们可以通过查询语句来对已有数据进行筛选并找到我们所需要的准确结果
A query like this:
这就是一句查询语句
SELECT LastName FROM Persons |
Gives a result set like this:
参照上面的数据表,返回的结果就因该是:
| LastName |
|---|
| Hansen |
| Svendson |
| Pettersen |
Note: Some database systems require a semicolon at the end of the SQL statement. We don't use the semicolon in our tutorials.
注意:一些数据库系统需要在每条SQL语句结束后带上分号。在我们的教程中将不使用到分号。
SQL (Structured Query Language) is a syntax for executing queries. But the SQL language also includes a syntax to update, insert, and delete records.
SQL是一种针对执行查询的语法。但SQL里还包括对记录进行更新,插入以及删除的语法。
These query and update commands together form the Data Manipulation Language (DML) part of SQL:
这些查询以及更新命令构成了SQL(DML)的一部分:
The Data Definition Language (DDL) part of SQL permits database tables to be created or deleted. We can also define indexes (keys), specify links between tables, and impose constraints between database tables.
| ·Linux 简单介绍 (2007-08-12 11:27:53) |
| ·在ubuntu下更改mysql默认编码(字符集) (2007-08-12 11:23:58) |
| ·asp列出sql数据库中所有数据视图 (2007-08-10 06:32:12) |
| ·asp列出sql数据库中(PUBS数据库)存贮过程及其例子 (2007-08-10 06:32:12) |
| ·介绍一个制作下拉菜单完全不同的办法 (2007-08-10 06:28:15) |
| ·介绍一下GETROWS的用法 (2007-08-10 06:26:16) |
| ·用asp程序显示sql数据库所有表的名称(带删除功能) (2007-08-10 06:21:41) |
| ·源码推荐——SQL SERVER结构浏览器 (2007-08-10 06:16:26) |
| ·购建ASP、CGI、PHP+MySQL运行环境——服务器运行环境配置全攻略(一) (2007-08-10 06:11:44) |
| ·购建ASP、CGI、PHP+MySQL运行环境——服务器运行环境配置全攻略(二) (2007-08-10 06:11:30) |
| 发表评论 | |
| |
| TechFeel.Com 旗下网站: | 摩族智能手机网 | 中国教程在线 | 动力互联科技 |
Copyright © 2005 - 2007 All Rights Reserved |
||
|