当前位置:网站首页>MySQL - Database Foundation
MySQL - Database Foundation
2022-06-21 10:48:00 【Longbow dog learning C】
Catalog
One . What is a database
File saving data has the following disadvantages
- File security issues
- Files are not conducive to data query and management
- Files are not conducive to storing large amounts of data
- It's not convenient to control the file in the program
So in order to solve the above problems , More effective data management , Database came into being .
Two . Mainstream databases
- SQL Sever: Microsoft products ,.Net Programmer's favorite , Medium and large scale projects .
- Oracle: Oracle products , Suitable for large projects , Complex business logic , Concurrency is generally not as good as MySQL.
- MySQL: The world's most popular database , It belongs to Oracle , Good concurrency , Not suitable for complex business . Mainly used in e-commerce ,SNS, Forum . For the simple SQL The treatment effect is good .
- PostgreSQL : A relational database developed by the computer department of the University of California, Berkeley , Whether it's for private use , commercial , Or for academic research , Free to use , Modify and distribute .
- SQLite: It's a lightweight database , Abide by ACID Database management system based on RDBMS , It's contained in a relatively small C In the library . Its design goal is embedded , And it has been used in many embedded products , It takes up very low resources , In embedded devices , It may take only a few hundred K That's enough memory .
- H2: It's a use. Java Development of embedded database , It itself is just a class library , It can be directly embedded into the application project .
3、 ... and . Basic use
You need to install on your own server first , The blogger bought the ECS here +Xshell The use of . Please operate in the station as shown in the figure , You can find a number of installation tutorials , I won't go into details here .

Connect to server
mysql -h 127.0.0.1 -P 3306 -u root -p
mysql -uroot -p At present, only the second type can be connected , The problem remains to be solved .
- If not -h 127.0.0.1 The default is to connect locally
- If not -P 3306 Connection by default 3306 Port number
The server , database , Table relations
Install the server , Is to install a database management program system program on the machine , You can manage multiple databases , Generally, an application pair uses a database . The corresponding relationship is as follows :

Code operation
// Create database
creat database base1;
// Using a database
use base1;
// Create database tables
creat table person(
id int,
name varchar(32),
gender varchar(2)
);
// Insert data into the table
insert into person(id,name,gender)values(1,' One person ',' male ');
insert into person(id,name,gender)values(2,' Person two ',' male ');
insert into person(id,name,gender)values(3,' Three people ',' Woman ');
// Query data in table
select * from person;SQL classification
DDL【data definition language】 Data definition language , Used to maintain the structure of stored data
For instructions : create, drop, alterDML【data manipulation language】 Data manipulation language , Used to manipulate data
For instructions : insert,delete,updateDML There is another one in the DQL, Data query language , For instructions : select
DCL【Data Control Language】 Data control language , Mainly responsible for authority management and affairs
For instructions : grant,revoke,commit
Database foundation supplement
Database features
- Data integrity
- Good data sharing
- High data independence
relational database
Bloggers haven't found the answer yet , Just remember that the following three are relational databases .
- Oracle
- SQL Server
- DB2
In the relational model, the logical structure of data is a two-dimensional table
边栏推荐
- 送分题,ArrayList 的扩容机制了解吗?
- 金融机构抢滩“数字员工”;保险APP适老化服务评测框架发布
- The third part of the procedure
- [cloud based co creation] enterprise digitalization accelerates "new intelligent manufacturing"
- Mythical games announced its cooperation with kakao games, a leading Korean game publisher, to promote business expansion in the Asia Pacific Region
- 聊聊大火的多模态项目
- How to learn function test? Ali engineer teaches 4 steps
- 功能测试怎么学?阿里工程师教4个步骤
- Dapr advanced -02- view dapr logs
- Unable to access gcr IO solutions
猜你喜欢

How to learn function test? Ali engineer teaches 4 steps

Xidian AI ranked higher than Qingbei in terms of AI major, and Nantah ranked first in China in terms of Software Science in 2022

Tensorflow, danger! Google itself is the one who abandoned it

Matplotlib two methods of drawing torus!

Starting a prairie fire, Alibaba cloud database "hundred cities gather together" to help small and medium-sized enterprises' digital intelligence transformation

性能优化——图片压缩、加载和格式选择

燎原之势 阿里云数据库“百城聚力”助中小企业数智化转型

The "first city" in Central China. How can Changsha be built?

Les nouveaux programmeurs optimisent une ligne de code lundi et sont exhortés à se retirer mercredi?

还在直接用localStorage么?全网最细:本地存储二次封装(含加密、解密、过期处理)
随机推荐
DSP online upgrade (1) -- understand the startup process of DSP chip
Prometheus flask exporter usage example
What USB driver needs to know
功能测试怎么学?阿里工程师教4个步骤
程序員新人周一優化一行代碼,周三被勸退?
JWT与Session的比较
JS regular - comb
Wangedit encapsulation plug-in preliminary
ESP8266/ESP32 +1.3“ or 0.96“ IIC OLED指针式时钟
Will the thunderstorm of Celsius be the "Lehman moment" in the field of encryption?
Why does C throw exceptions when accessing null fields?
中国国际电子商务中心与易观分析联合发布:2021年4季度全国网络零售发展指数同比增长0.6%
K-means introduction
The delimiter connects the list string without secondary processing joiner on(). join()&&String. join(“,“, list)
Financial institutions scramble for "digital employees"; Release of aging service evaluation framework for insurance app
Talk about the multimodal project of fire
DSP online upgrade (2) -- design framework of bootloader
character string
[cloud based co creation] enterprise digitalization accelerates "new intelligent manufacturing"
02. Redis Blockbuster: viewing core principles from high-frequency problems