当前位置:网站首页>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
边栏推荐
- Redis守护进程无法停止解决方案
- 剑指 Offer 12. 矩阵中的路径
- [flask] official tutorial -part1: project layout, application settings, definition and database access
- Leetcode3. Implement strstr()
- 晶振是如何起振的?
- NiO related knowledge (II)
- Unity learning notes -- 2D one-way platform production method
- 02.Go语言开发环境配置
- Social networking website for college students based on computer graduation design PHP
- FTP server, ssh server (super brief)
猜你喜欢
Leetcode sum of two numbers
UE4 unreal engine, editor basic application, usage skills (IV)
NumPy 数组索引 切片
How to improve the level of pinduoduo store? Dianyingtong came to tell you
Mongodb problem set
Blue Bridge Cup embedded_ STM32 learning_ Key_ Explain in detail
Accelerating spark data access with alluxio in kubernetes
3D vision - 4 Getting started with gesture recognition - using mediapipe includes single frame and real time video
Blue Bridge Cup embedded_ STM32_ New project file_ Explain in detail
Open source | Ctrip ticket BDD UI testing framework flybirds
随机推荐
剑指 Offer 38. 字符串的排列
500 lines of code to understand the principle of mecached cache client driver
【Flask】获取请求信息、重定向、错误处理
leetcode3、實現 strStr()
[network attack and defense training exercises]
It's wrong to install PHP zbarcode extension. I don't know if any God can help me solve it. 7.3 for PHP environment
Xshell 7 Student Edition
FTP server, ssh server (super brief)
【Flask】官方教程(Tutorial)-part1:项目布局、应用程序设置、定义和访问数据库
How to use C to copy files on UNIX- How can I copy a file on Unix using C?
使用npm发布自己开发的工具包笔记
Shutter doctor: Xcode installation is incomplete
Computer graduation design PHP animation information website
You are using pip version 21.1.1; however, version 22.0.3 is available. You should consider upgradin
Online reservation system of sports venues based on PHP
Leetcode3, implémenter strstr ()
Executing two identical SQL statements in the same sqlsession will result in different total numbers
Leetcode sum of two numbers
Selenium element positioning (2)
Luo Gu P1170 Bugs Bunny and Hunter