当前位置:网站首页>Know MySQL database
Know MySQL database
2022-07-06 01:58:00 【Crazy Stuka】
List of articles
- Basic concepts of database
- Database management system (DBMS)
- Introduction to today's mainstream databases
- relational database
- MySQL Database introduction
- Common data types
- Check the database structure
- How to create databases and tables
- How to delete tables in a database and delete a database
- Manage data records in tables
- change update
- How to operate the table structure
- How to delete a field
Basic concepts of database
data (Data)
A symbolic record of things
Including digital , written words 、 graphics 、 Images 、 voice 、 File records, etc “ Record ” Forms are stored in a unified format
surface
Organize different records together to store specific data
database
Set of tables , It's a warehouse for storing data
The interrelated data sets stored in a certain way are organized according to the data structure 、 Warehouse for storing and managing data
Database management system (DBMS)
Is to achieve effective organization of database resources 、 System software for management and access
Database system
It's a human computer system , By hardware 、OS、 database 、DBMS、 Application software and database users
Users can chant DBMS Or the application program operates the database
Introduction to today's mainstream databases
SQL Server
Microsoft products , oriented Windows operating system , Simple , Easy to use
Oracle
Oracle products , For all mainstream platforms , large , Security , perfect
DB2
IBM The products of the company
For all mainstream platforms
large , Security , perfect
MySQL
Oracle buys , free , Open source , Small volume
relational database
A relational database system is a database system based on a relational model
The data structure of relational model uses two-dimensional data table which is easy to understand
The relational model can be simply “ Entity - Relationship ”(E-R) It is shown in the figure E-R The figure contains the entity ( Data objects )、 Three elements of relationship and attribute
Entity
Also known as instances , Corresponding to... That can be distinguished from other objects in the real world “ event ” or “ thing ”
Such as bank customers 、 Bank accounts, etc
attribute
A property of an entity , An entity can have multiple properties
Such as “ Bank customers ” Each entity in the entity set has a name 、 address 、 Phone and other attributes
contact
The correspondence between entity sets is called connection , Also known as relationships, such as between bank customers and bank accounts “ savings ” The relationship between
The collection of all entities and their relationships constitutes a relational database
The storage structure of relational database is two-dimensional table , In every two-dimensional table , Each line is called a record , Information used to describe an object , Each column is called a field , Used to describe an attribute of an object
MySQL Database introduction
A popular open source relational database
Oracle Our products
comply with GPL agreement , It can be used and modified free of charge
characteristic
Performance is remarkable 、 Stable service
Open source 、 No copyright restrictions 、 Low cost multithreading 、 Multi user
be based on C/S( client / The server ) framework , Safe and reliable
MySQL Business and community
MySQL The commercial version is made up of MySQL AB The company is responsible for the development and maintenance of , You need to pay to use
MySQL The Community Edition is made up of MySQL developer 、 Fans work together to develop and maintain , Free to use
Difference between them
The organization, management and testing of the commercial version are more strict , It will be more stable than the community version, and the commercial version does not comply GPL, Community compliance GPL Free to use
The commercial version is available 7*24 Hours of service , The community edition does not
MySQL Product camp
The first camp :5.0-5.1 camp , It can be said to be the continuation of early products
The second camp :5.4-5.7 camp , Integrated MySQL AB company 、 Storage engines developed by communities and third-party companies , To improve performance
The third camp :6.0-7.1 camp , Namely MySQL Cluster edition , It is developed to meet the needs of database cluster in the new era
Download url
http://www.dev.mysql.com/downloads
MySQL Database management
Common data types
int: integer
float: Single precision floating point 4 byte 32 position
double: Double precision floating point 8 byte 64 position
char: Fixed length character types
varchar: Variable length character types
text: Text
image: picture
decimal(5,2):5 A valid length number , After the decimal point is 2 position
Check the database structure
1. View the current database
[[email protected] ~]# mysql -u root -p
mysql> show databases;
2. View... In the current database mysql database , How to check
mysql> use mysql;
mysql> show tables;
3. see mysql In the library user surface . How to let me check
mysql> describe user;
4. How not to switch , see mysql library
5. How not to switch , see mysql In the library user Table structure
How to create databases and tables
How to delete tables in a database and delete a database
( High risk orders in the production environment ! No matter what, you can't delete the database and run away If it's light, you'll lose money , Or go to jail )
drop table Table name ;
drop database Library name ;
Manage data records in tables
1. Insert a new data record into the data table
or
select Query usage
How to query serial number 3 The information of this line
How to query the first two lines
Or use combination limit Order to inquire
combination limit Only query the third and fourth lines
How to make the table display vertically
change update
How to put the second line of the sequence aa Change the age to 28
How to modify the age and description in the second line with one command ?
How to delete The third line cc
How to operate the table structure
Modify the name of the table
How to delete a field
How will it be? Age Field set back And set the default value to Age Unknown
How to integrate ‘ name ’ Field Change it to name And No repetition Cannot be empty
边栏推荐
- Dynamics 365 开发协作最佳实践思考
- MCU lightweight system core
- LeetCode 322. Change exchange (dynamic planning)
- Redis daemon cannot stop the solution
- C web page open WinForm exe
- D22:indeterminate equation (indefinite equation, translation + problem solution)
- 【全网最全】 |MySQL EXPLAIN 完全解读
- Redis key operation
- Blue Bridge Cup embedded_ STM32_ New project file_ Explain in detail
- Jisuanke - t2063_ Missile interception
猜你喜欢
Extracting key information from TrueType font files
Computer graduation design PHP college student human resources job recruitment network
Tensorflow customize the whole training process
selenium 等待方式
Folio. Ink is a free, fast and easy-to-use image sharing tool
Kubernetes stateless application expansion and contraction capacity
【Flask】官方教程(Tutorial)-part1:项目布局、应用程序设置、定义和访问数据库
Folio.ink 免费、快速、易用的图片分享工具
How to improve the level of pinduoduo store? Dianyingtong came to tell you
【Flask】官方教程(Tutorial)-part3:blog蓝图、项目可安装化
随机推荐
竞价推广流程
FTP server, ssh server (super brief)
Leetcode skimming questions_ Verify palindrome string II
[flask] obtain request information, redirect and error handling
How to improve the level of pinduoduo store? Dianyingtong came to tell you
[the most complete in the whole network] |mysql explain full interpretation
1. Introduction to basic functions of power query
Cookie concept, basic use, principle, details and Chinese transmission
Sword finger offer 12 Path in matrix
Redis守护进程无法停止解决方案
Competition question 2022-6-26
Blue Bridge Cup embedded_ STM32 learning_ Key_ Explain in detail
[detailed] several ways to quickly realize object mapping
Redis-字符串类型
Alibaba-Canal使用详解(排坑版)_MySQL与ES数据同步
Online reservation system of sports venues based on PHP
竞赛题 2022-6-26
安装Redis
How to get all sequences in Oracle database- How can I get all sequences in an Oracle database?
[le plus complet du réseau] | interprétation complète de MySQL explicite