In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly tells you briefly what is the basic language of mysql. You can look up the relevant professional terms on the Internet or find some related books to supplement them. We will not dabble here. Let's go straight to the topic. I hope this article on what is the basic language of mysql can bring you some practical help.
MySQL is a relational database developed in the 1990s. MySQL5.0 adds support for advanced features such as views, database stored procedures, triggers, cloud server cursors, and distributed transaction protocols.
MySQL advantages: open source, free, cross-platform, high performance, more users
Weakness: poor conformance of SQL standards.
When facing an unfamiliar database, we usually need a way to interact with it, so SQL language is used.
SQL is an acronym for structured query (Structure Query Language). It is a database application language that uses relational models. Most relational database systems support SQL.
Relational database is a database based on relational model, which stores and processes data in the form of two-dimensional tables. Relational database is a database composed of multiple two-dimensional row and column tables that can be connected to each other.
Second, the classification of SQL language.
DDL statement: data definition language. Define different data segments, databases, tables, columns, indexes and other database objects. Common sentence keywords include create, drop, alter.
The creation of database
CREATE DATABASE database name
[CHARACTER SET 'utf8' COLLATE' utf8_general_ci'] set database character set and character set proofreading rules
CREATE DATABASE exam CHARACTER SET 'utf8' COLLATE' utf8_general_ci'
Toggle database:use database name
USE exam
Modification of database
Alter database exam character set utf8
Deletion of database
Drop database database name
Creation of tables
CREATE TABLE table name (attribute 1 data type [length] [constraint],.) [ENGINE=INNODB DEFAULT CHARSET=utf8]; (storage engine and character set) such as
Introduction to constraint data types
Added when ENGINE=INNODB DEFAULT CHARSET=utf8; creates a list, Chinese characters can emerge.
Modification of table
Alter table table name
Add field Alter table add column column name type
Add constraint Alter table table name alter column column name set default 'value'
Alter table table name add constraint primary key name primary key table name (primary key field)
Alter table table name add constraint foreign key name foreign key (foreign key field) references associated table name (associated field)
Modify field Alter table table name change original field name new field name data type [attribute]
Delete field alter table table name drop field name
Modify constraint alter table table name add constraint foreign key name foreign key (foreign key field) references associated table name (associated field)
Deletion of tables
Drop table table name
Insert the data of the table
Insert into table name (column 1, column 2,. ) values ('axioma1,)
Update the data of the table
Update table name set column name = update value [where update condition]
Deletion of table data
Delete from table name [where update condition]
DML operation refers to the operation of table records in the database, including insert (insert), update (update), delete (delete), query (select) of table records.
What is the basic language of mysql to tell you here, for other related issues you want to know can continue to pay attention to our industry information. Our section will capture some industry news and professional knowledge to share with you every day.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.