通用知識(shí)
When a syntax element consists of a number of alternatives, the alternatives are separated by vertical bars (“|”). When one member from a set of choices may be chosen, the alternatives are listed within square brackets (“[” and “]”):
TRIM([[BOTH | LEADING | TRAILING] [remstr] FROM] str)
When one member from a set of choices must be chosen, the alternatives are listed within braces (“{” and “}”):
{DESCRIBE | DESC} tbl_name [col_name | wild]
概覽
MySQL, the most popular Open Source SQL database management system, is developed, distributed, and supported by Oracle Corporation.
1 MySQL是數(shù)據(jù)庫(kù)管理系統(tǒng)
2 關(guān)系型
The SQL part of “MySQL” stands for “Structured Query Language”. SQL is the most common standardized language used to access databases.
3 開(kāi)源的
4 數(shù)據(jù)庫(kù)服務(wù)器非常快,可靠可擴(kuò)展菩浙,容易使用
5 MySQL Server works in client/server or embedded systems.
6 A large amount of contributed MySQL software is available.
特征
1 Written in C and C++. 測(cè)試是用的Purify
2 Uses very fast B-tree disk tables (MyISAM) with index compression
3 Designed to make it relatively easy to add other storage engines. This is useful if you want to provide an SQL interface for an in-house database.
4 Uses a very fast thread-based memory allocation system.
5 Executes very fast joins using an optimized nested-loop join.
6 Implements in-memory hash tables, which are used as temporary tables.
數(shù)據(jù)類型
Many data types: signed/unsigned integers 1, 2, 3, 4, and 8 bytes long,
FLOAT
,DOUBLE
,CHAR
,VARCHAR
,BINARY
,VARBINARY
,TEXT
,BLOB
,DATE
,TIME
,DATETIME
,TIMESTAMP
,YEAR
,SET
,ENUM
, and OpenGIS spatial types. See Chapter 11, Data Types.Fixed-length and variable-length string types.
語(yǔ)句和函數(shù)
1 全部地支持操作符和函數(shù)
mysql> SELECT CONCAT(first_name, ' ', last_name)
-> FROM citizen
-> WHERE income/dependents > 10000 AND age > 30;
2 全部支持 Group by和order by
(COUNT()
, AVG()
, STD()
, SUM()
, MAX()
, MIN()
, and GROUP_CONCAT()
).
3 支持 left outer join
right outer join 標(biāo)準(zhǔn)SQL和ODBC語(yǔ)法
4 支持別名
5 支持 delete insert replace update to return the number of rows that were changed (affected), or to return the number of rows matched instead by setting a flag when connecting to the server
6 支持show語(yǔ)句 Support for the INFORMATION_SCHEMA database, implemented according to standard SQL.
7 explain 語(yǔ)句to show how the optimizer resolves a query.
8 表格函數(shù)名和行列名相互獨(dú)立聚凹。唯一限制是不能有空格,
9 You can refer to tables from different databases in the same statement.
安全??
1 A privilege and password system that is very flexible and secure, and that enables host-based verification.
2 Password security by encryption of all password traffic when you connect to a server.
連接
1 Clients can connect using TCP/IP sockets on any platform.
2 On Unix systems, clients can connect using Unix domain socket files.