Mysql common sense and basic operations. Field type 1.INT[ (M)] Normal size integer type 2. DOUBLE [(M, D)] [ZEROFILL] normal size (DOUBLE precision) floating point number type 3. DATE type. Supported range: 1000-01-01 to 9 field types
1. INT [(M)]
Normal size integer type
2. DOUBLE [(M, D)] [ZEROFILL]
Normal size (double precision) floating point numeric type
3. DATE
Date type. The supported range is '2017-01-01 'to '2017-12-31 '. MySQL displays the DATE value in 'yyyy-MM-DD 'format, but allows you to assign the value to the DATE column using strings or numbers
4. CHAR (M)
Fixed-length string type. when stored, it always fills the right to the specified length with spaces
5. BLOB TEXT
BLOB or TEXT type. The maximum length is 65535 (2 ^ 16-1) characters.
6. VARCHAR
Variable-length string type.
1: Display the database
Show databas,
2: currently selected database,
Mysql> select database ();
------------
| DATABASE () |
------------
| Test;
------------
| DATABASE () |
------------
| Test |
------------
Table information contained in the current database:
Mysql> show tables;
---------------------
| Tables in test
Mysql> show tables;
---------------------
| Tables in test |
---------------------
| Mytable1 |
| Mytable2 |
---------------------
Get table structure
Mysql> desc mytable1;
-------------------------------------------------
| Field mysql> desc mytable1;
-------------------------------------------------
| Field | Type | Null | Key | Default | Extra |
-------------------------------------------------
| S1 | varchar (20) | YES | NULL |
------------------------------------------------
5. import database tables
(1) create a. SQL file
(2) first generate a database such as auction. c: mysqlbin> mysqladmin-u root-p creat auction. a prompt is displayed, indicating that the password is entered and created successfully.
(2) import the auction. SQL file
Listen 1.INT[ (M)] Normal size integer type 2. DOUBLE [(M, D)] [ZEROFILL] normal size (DOUBLE precision) floating point number type 3. DATE type. The supported range is '2017-01-01 'to '9...