sql数据库常用命令(国外英文资料).docVIP

  • 6
  • 0
  • 约1.52万字
  • 约 18页
  • 2017-06-05 发布于河南
  • 举报
sql数据库常用命令(国外英文资料)

sql数据库常用命令 Displaying the current server version: Select the version (); Display current date time: The select now (); Display current user: Select the user (); -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - MySQL statement specification: The keywords and function names are all capitalized; Database name, table name, field name all lowercase; The SQL statement must end with a semicolon. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - Create a database: / / within which {} is required and [] is optional CREATE {DATABASE or SCHEMA} [IF NOT EXISTS] db_name [DEFAULT] CHARACTER SET [=] charset name For example, create a database named t1: The CREATE DATABASE t1; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- View the list of databases under the current server: SHOW {DATABASES or SCHEMAS} [LIKE pattern or WHERE expr] View the warning message: SHOW WARNINGS; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Modify database: ALTER {DATABASE or SCHEMA} [db_name] -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Delete database: DROP {DATABASE or SCHEMA} [IF EXISTS] db_name -- -- -- -- -- -- -- -- -- -- --

文档评论(0)

1亿VIP精品文档

相关文档