当前位置:网站首页>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
边栏推荐
- 记一次协程环境下类成员变量污染的问题
- One of the components of the program
- K-means introduction
- Mythical games announced its cooperation with kakao games, a leading Korean game publisher, to promote business expansion in the Asia Pacific Region
- What USB driver needs to know
- 聊聊大火的多模态项目
- Odd number of characters异常
- Prometheus flask exporter usage example
- Stream programming: stream support, creation, intermediate operation and terminal operation
- Introduction to ground plane in unity
猜你喜欢

Application configuration management, basic principle analysis

Where is the cow in Shannon's information theory?

IAAs, SaaS, PAAS, DAAS concepts

js正则-梳理

Running view of program

Three elements of basic concepts and methods of machine learning

聊聊大火的多模态项目

一行代码加速 sklearn 运算上千倍

About Alipay - my savings plan - interest rate calculation instructions

Haplotype analysis using shapeit
随机推荐
DSP online upgrade (2) -- design framework of bootloader
Performance optimization - image compression, loading and format selection
Positive results of enx-101 clinical 1b study published by English topics
The backbone of the top 100 security companies! Meichuang technology was selected into the 2022 China top 100 Digital Security Report
Answers to mobile application development learning general test questions
[cloud native | kubernetes] kubernetes configuration (XV)
Redis core: usage specification
启牛到底是用的什么证券开户?开户是哪家的安全吗
Optimisation des performances - compression, chargement et formatage des images
js正则-梳理
Simple Android weather app (III) -- city management and database operation
02. Redis Blockbuster: viewing core principles from high-frequency problems
Is it safe for Guojin securities to open an account?
ESP8266/ESP32 +1.3“ or 0.96“ IIC OLED指针式时钟
Use of jobservice
03. Redis actual battle: meeting goddess nearby by geo type
Summary of embedded development -- General Catalog
What USB driver needs to know
东方甄选双语直播火爆出圈,新东方转型初见端倪
Huawei releases wireless innovative products and solutions to build 5gigaverse Society