Tekkaman

导航

 

MySQL Keynote

1、Keywords may be entered in any lettercase. The following queries are equivalent:

  

2、Here is another query. It demonstrates that you can use mysql as a simple calculator:

  

3、所有查询以;结尾。

4、显示数据库。 SHOW DATABASES does not show databases that you have no privileges

  

5、If the test database exists, try to access it:

  

6、创建数据库。

  

  nder Unix, database names are case sensitive (unlike SQL keywords), so you must always refer to your database as menagerie, not asMenagerieMENAGERIE, or some other variant. 

7、显示tables

  

8、查看表定义.

  

 

9、使用insert插入数据

  

10、更新数据 

  

 

11、时间计算

  

 

12、取出日期中的月份

  

13、DATE_ADD可以添加时间。

  

 

14、MOD是模运算。

  

 

15、LIKE模式匹配. SQL pattern matching enables you to use _ to match any single character and % to match an arbitrary number of characters (including zero characters).

  

16、Number of animals per combination of species and sex:

  

参考:https://dev.mysql.com/doc/refman/5.7/en/entering-queries.html

posted on 2017-01-31 00:08  Tekkaman  阅读(428)  评论(0编辑  收藏  举报