MySQL Basic method

Source: Internet
Author: User


24.1 Database Overview
The Digital Library (dtabase) is an existential data (
Data) of the warehouse, the
Warehouse is
Technical Photo One
Data structures (data structures are exponential
The form of a group or a link between data) to organize the stored
We can provide it through data

Multiple ways to manage data in a database,




SQL Language
Structured Query Language (stuctured Query Language, abbreviated as SQU, is a computer language used to store, extract, and retrieve stored
Data stored in a relational database. As a standard language for accessing relational databases, SQL has been widely used since its inception, not only
Well-known large commercial database products such as Oracle. DB2. Sybase. SQL Server supports many of its open source database products such as PostgreSQL
Myssql also supports it, and even some small products like acess also support SQL, and in recent years the booming NoSQL system was initially directly called
Need SQL again, and then have to fix to not only SQL, to embrace SQL
In the 1980s, SQL was defined as a relational database language by the American National Standards Institute (ANSI) and the International Organization for Standardization (I150).
Standards, the main components are:
(1) Data definition language (Language, DDL): Mainly used to define databases, data tables, etc., where the package
Include the CREATE statement, ALERT statement, and drop statement.
(2) Data manipulation language (manipulation Language, DML): Primarily used to add, modify, and
Delete operations, including INSERT statements, UPDATE statements, and DELETE statements,
(3) Data Query Language (Language. DQL): Mainly used for querying data, including SELECT statements, you can
Query one or more data in the database.
(4) Data Control Language (Language, or DCL): Primarily used to control user access rights, including Grant
Statement REVOKE statements, COMMIT statements, and rollback statements,


related commands for MySQL 1 Listing databases: show databases 2 Select database: Use databasesname 3 Creating databases: Create Database name 4 Deleting databases: Drop database name
basic operation of data
To create a data table:

Grammar
CREATE Table Table name (
Field name data type [constraint],
Field name data type [constraint],
Field name data type [constraint]
The "CREATE TABLE table name" is the command for creating tables in the syntax format; Table Name "is the name of the created table;" Field name is a column in a table
"Data Type" is the data type contained in MySQL.

Add data
When the data table is created successfully, there is no data in the table, and if you want to insert data into the data table you need to use the INSERT statement, insert
To use to insert data into the table. There are two different INSERT statements based on how you insert data: Inserting data into all fields in a table
and inserts data into the fields specified in the table.


Grammar

Insert into table name values (value 1. Value 2, value 3: Insert into table name (column name 1, column Name 2 ....) Values (value 1. Value 2, value 3: ); Querying Data Syntax:Select Column Name 1, column name 2...from table name [WHERE Condition list ...] Update Data: GrammarUpdate table name set column name 1= value, column name 2= value ... [Where condition expression ....] Delete Data GrammarDelete from table name [WHERE Condition expression ....]

MySQL Basic method

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.