Home > Database > Mysql Tutorial > MySQL常用语句笔记

MySQL常用语句笔记

WBOY
Release: 2016-06-07 15:40:46
Original
1048 people have browsed it

mysql SHOW DATABASES; mysql CREATE DATABASE mydb; mysql USE mydb; mysql SHOW TABLES; mysql CREAT E TABLE mytable ( - name VARCHAR(20) , - genda CHAR(1), - birth DATE , - addr VARCHAR(20) - ) ; mysql SHOW COLUMNS FROM mytable ; mysql DESCRI

mysql> SHOW DATABASES;

mysql> CREATE DATABASE mydb;


mysql> USE mydb;

mysql> SHOW TABLES;


mysql> CREATE TABLE mytable (

         -> name VARCHAR(20),

         -> genda CHAR(1),

         -> birth DATE,

         -> addr VARCHAR(20)

         -> );


mysql> SHOW COLUMNS FROM mytable;

mysql> DESCRIBE mytable;


mysql> SELECT * FROM mytable;


mysql> INSERT INTO mytable

         -> VALUES (

         -> 'cook',

         -> 'M',

         -> '1991-02-07',

         -> 'China'

         -> );


mysql> SELECT name                    // 排序后输出第四个名字

         -> FROM mytable

         -> ORDER BY name DESC

         -> LIMIT 3 1


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template