当前位置:网站首页>1-3 using SQL to manage databases
1-3 using SQL to manage databases
2022-06-30 21:30:00 【Endless pie】
What is? SQL?
SQL( English full name :Structured Query Language) Structured query language , A programming language designed to access and process databases . Can let us in the form of programming , operation Data in the database .
Three key points :
- SQL Is a database programming language
- Use SQL Language code , be called SQL sentence
- SQL Language can only be used in relational databases ( for example MySQL、Oracle、SQL Server). Non relational database ( for example Mongodb) I won't support it SQL Language .
SQL What can be done ?
- Query data from database
- Insert new data into item data
- Update the data in the database
- Delete data from database
- You can create a new database
- New tables can be created in the database
- You can create stored procedures in the database 、 View
SQL Learning objectives of ?
Query data (select)、 insert data (insert into)、 Update data (update)、 Delete data (delete)
Extra to master 4 Kind of SQL grammar :
where Conditions 、and and or Operator 、order by Sort 、count(*) function
SQL Of SELECT sentence
SELECT Statement to query data from a table . The result of the execution is stored in a result ( Called result set ). The syntax is as follows :
// Query all columns
SELECT * FROM The name of the table
// Query specified column
SELECT Column name FROM The name of the table
-- adopt * hold users Query all the data in the table
-- select * from users
-- from users In the table username and password Find out the corresponding data
select username, password from users
INSERT INTO Statement is used to insert a new data row into a data table
-- towards users In the table , Insert new data ,username The value of is tony stark password The value of is 098123
-- insert into users (username,password) values ('tony stark','098123')
SQL Of UPDATE sentence
-- hold users In the table id by 4 The user password of , Updated to 888888
-- update users set password='888888' where id=4
-- select * from users
-- update users set password='admin123',status=1 where id=2
-- select *from users
SQL Of DELETE sentence
Be careful : When deleting table data, you must add one where Conditions , Otherwise, the data of the whole table will be deleted
-- Delete users In the table id=4 The data of
-- delete from users where id=4
select *from users
边栏推荐
猜你喜欢

文本生成模型退化怎么办?SimCTG 告诉你答案
一文读懂什么是MySQL索引下推(ICP)

Neurotransmetteurs excitateurs - glutamate et santé cérébrale

Reading notes of Clickhouse principle analysis and Application Practice (1)

Open source internship experience sharing: openeuler software package reinforcement test

It is urgent for enterprises to protect API security
笔记【JUC包以及Future介绍】

Arcmap|assign values to different categories of IDS with the field calculator

1-2 install and configure MySQL related software

Nacos部署及使用
随机推荐
A group of K inverted linked lists
1-2 install and configure MySQL related software
Random talk about Clickhouse join
What happens when word encounters an error while trying to open a file?
Metauniverse may become a new direction of Internet development
文本生成模型退化怎麼辦?SimCTG 告訴你答案
物联网僵尸网络Gafgyt家族与物联网设备后门漏洞利用
1-10 respond to client content according to different URLs
Et la dégradation du modèle de génération de texte? Simctg vous donne la réponse
MySQL高级篇3
“信任机器”为发展赋能
1-17 express中间件
多态在代码中的体现
jenkins下载插件下载不了,解决办法
Use the log server to output the topn of various Apache logs
Two skylines
测试媒资缓存问题
Coefficient of variation method matlab code [easy to understand]
Reading notes of Clickhouse principle analysis and Application Practice (3)
The 16th Heilongjiang Provincial Collegiate Programming Contest