当前位置:网站首页>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
边栏推荐
- Campus second-hand transaction based on wechat applet
- 【Flask】静态文件与模板渲染
- 安装Redis
- Xshell 7 Student Edition
- 同一个 SqlSession 中执行两条一模一样的SQL语句查询得到的 total 数量不一样
- selenium 元素定位(2)
- 【Flask】响应、session与Message Flashing
- 竞赛题 2022-6-26
- ctf. Show PHP feature (89~110)
- [the most complete in the whole network] |mysql explain full interpretation
猜你喜欢
国家级非遗传承人高清旺《四大美人》皮影数字藏品惊艳亮相!
安装php-zbarcode扩展时报错,不知道有没有哪位大神帮我解决一下呀 php 环境用的7.3
Redis-字符串类型
A basic lintcode MySQL database problem
Executing two identical SQL statements in the same sqlsession will result in different total numbers
leetcode3、實現 strStr()
How to improve the level of pinduoduo store? Dianyingtong came to tell you
Kubernetes stateless application expansion and contraction capacity
02. Go language development environment configuration
Poj2315 football games
随机推荐
Gbase 8C database upgrade error
干货!通过软硬件协同设计加速稀疏神经网络
Cookie concept, basic use, principle, details and Chinese transmission
阿里测开面试题
National intangible cultural heritage inheritor HD Wang's shadow digital collection of "Four Beauties" made an amazing debut!
Flowable source code comments (36) process instance migration status job processor, BPMN history cleanup job processor, external worker task completion job processor
[flask] obtain request information, redirect and error handling
【Flask】官方教程(Tutorial)-part1:项目布局、应用程序设置、定义和访问数据库
Blue Bridge Cup embedded_ STM32_ New project file_ Explain in detail
Leetcode3. Implement strstr()
ClickOnce does not support request execution level 'requireAdministrator'
Flutter Doctor:Xcode 安装不完整
Folio. Ink is a free, fast and easy-to-use image sharing tool
GBase 8c数据库升级报错
Open source | Ctrip ticket BDD UI testing framework flybirds
Computer graduation design PHP enterprise staff training management system
Paddle框架:PaddleNLP概述【飛槳自然語言處理開發庫】
Docker compose configures MySQL and realizes remote connection
[flask] official tutorial -part1: project layout, application settings, definition and database access
Blue Bridge Cup embedded_ STM32 learning_ Key_ Explain in detail