MySQL CREATE DATABASE and insert data

Source: Internet
Author: User
Start MySQL
  • start service: sudo service mysql start
  • login: mysql-u root
New Database
  • CREATE Database < databases name;;
  • The
  • is not case-sensitive in most SQL systems, but it is customary to keep uppercase letters, variables and data lowercase
Connect to database
  • use < database name;
  • display: Database changed, indicating successful connection
datasheet
  • data table is a database The component is where the data resides in the database
  • new data table: CREATE table < table name > (< column name 1> data type (data length),< column name 2> data type (data length), ... . );
Insert Data

INSERT into table name (column name 1, column name 2,...) Values (value 1, value 2,...)

Data type
  • int,float,double,enum,set,char,varchar,text,date,time,year
  • data type int,float,double The data does not need to use single quotes ' ' Parcels, the rest of the data types, such as Char,varchar,text,enum,date's data need to be wrapped in single quotes

MySQL CREATE DATABASE and insert data

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.