当前位置:网站首页>Basic statement of database operation
Basic statement of database operation
2022-07-27 10:17:00 【Xiang Yu Han】
Take the book back , After understanding the deployment 、 link mysql after , Want to write code , You need to know the basic statements of database operation in advance , Let's start with :
mysql -u xiaochun -p
Input password , land ;
show databases;
Display all databases , No, 【spring】 Database , Create a ;
use spring;
Use 【spring】 database ;
mysql> create table user(id integer primary key auto_increment,
-> name varchar(60) not null,
-> age integer(3),
-> sex varchar(1));
Create table , And initialize the field ;
show tables;
View under this library , All the watches ;
alter table user rename to student;
Modify the name of the table 【user】 by 【student】;
desc student;
View table structure ;
drop table user;
insert into student values(1,'xiaoming',18,'1');
Add data ;
insert into student(id,name,age,sex) values(2,'xiaozhang',16,'2');
Add data ;
insert into student(id,name,age,sex) values(null,'xiaozhang',16,'2');
Add data , When id Pass in null when , The primary key increases automatically ;
select * from student;
View the data ;
select name,age from student where sex='2' and age<19 order by name;
Conditional query sorting ;
Delete the name 【user】 Table of ;
Attach a screenshot of the Internet query :

The preparations are complete , Next chapter springboot .
边栏推荐
- Shell read read console input, use of read
- 数据库性能系列之子查询
- Decision tree principle and case application - Titanic survival prediction
- oracle rac 19c pdb实例当掉
- 邮件服务器
- Pyautogui realizes automatic office -rpa small case
- QT learning (II) -.Pro file explanation
- mount.nfs: access denied by server while mounting解决
- Mathematical reasoning: five couples get together and shake hands when they meet
- VS2019+CUDA11.1新建项目里没有CUDA选项
猜你喜欢

数据分析如何解决商业问题?这里有份超详细攻略

Pytorch installation (very detailed)

Preparation for Android interview (including the whole process of interview, interview preparation, interview questions and materials, etc.)

Excellent Kalman filter detailed article

Leetcode.814. binary tree pruning____ DFS

NFS 服务器的搭建

Practice and exploration of overseas site Seata of ant group
[email protected], "/>Shell variables, system predefined variables $home, $pwd, $shell, $user, custom variables, special variables $n, $, $*, [email protected],

Dcgan paper improvements + simplified code

线代003
随机推荐
Snowflake vs. Databricks谁更胜一筹?2022年最新战报
Shell流程控制(重点)、if 判断、case 语句、let用法、for 循环中有for (( 初始值;循环控制条件;变量变化 ))和for 变量 in 值 1 值 2 值 3… 、while 循环
解决ORCLE-ORA-01122 01110 01210
Food safety | the more you eat junk food, the more you want to eat it? Please keep this common food calorimeter
Matlab-基于短时神经网络的声音分类
【精选】如何完美的写 PHP 代码的呢?
Xiandai 003
Pytorch installation (very detailed)
Ant高级-path和fileset
使用 Kmeans聚类实现颜色的分割
线代003
Open3d library installation, CONDA common instructions, importing open3d times this error solving environment: failed with initial frozen solve Retrying w
数据分析如何解决商业问题?这里有份超详细攻略
Reason for pilot importerror: cannot import name 'pilot_ Version 'from' PIL ', how to install pilot < 7.0.0
open3d库的安装,conda常用指令,导入open3d时报这个错误Solving environment: failed with initial frozen solve. Retrying w
Preparation for Android interview (including the whole process of interview, interview preparation, interview questions and materials, etc.)
Shell read read console input, use of read
如何创建一个带诊断工具的.NET镜像
Oracle RAC 19C PDB instance is down
Pyautogui实现自动化办公-RPA小case