Mysql common sense and basic operations-PHP Tutorial

Source: Internet
Author: User
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...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.