There are many popular databases on the market. although these databases follow the same standards during development, each type of database has many popular databases, which are different from other similar products. although these databases follow the same standards during development, each database has something different from other similar products.
I. ansi SQL and SQL extension languages of common relational databases are currently popular languages used to operate relational databases. The popular SQL language standards are ANSI-developed ANSI SQL-92. ANSI is a member of ISO and IEC. The SQL-92 was jointly announced by ISO and IEC in 1992. ANSI also released an ANSI SQL-92, typically called ansi SQL. Although there are some differences between popular relational databases and ansi SQL versions, they basically follow the ansi SQL standard.
1. ANSI SQL
Ansi SQL mainly includes two data operation languages: one is the data definition language (DDL) used for database element definition, and the other is the data management language (DML) used for database element management ).
(1) Data Definition Language (DDL)
DDL is a language used to define and manage database elements. it is mainly used to create, modify, and delete data tables, indexes, and views in databases. The following code creates a table in the database.
Create table MyTable
(User_id smallint,
Username char (22 ),
Password char (22 ),
Email char (30 ));
The following code modifies the table created above. A new column is added.
Alter table MyTable
ADD tel_no char (22 );
The following code deletes the table created above.
Drop table MyTable;
As you can see, the preceding three SQL statements create, modify, and delete elements in the database. Other database elements can perform these operations in a similar way.
(2) data management language (DML)
DML is a language used to manage data in databases. it is mainly used to query, insert, modify, and delete data in databases. For example, the following code inserts a data entry into the MyTable table in the database.
Insert into MyTable
VALUES (100001, 'Simon ', '123', 'pch1982cn @ yahoo.com.cn ');
The following code modifies the data.
UPDATE MyTable
SET username = "Elaine"
WHERE user_id = 100001;
The following code deletes the data.
Delete from MyTable
WHERS user_id = 100001;
The following code queries the data in the database.
SELECT * FROM MyTable
WHERE user_id = 100001;
The preceding examples are typical examples of ansi SQL. For most relational database products, ansi SQL can be used to perform general operations on the database.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service