当前位置:网站首页>MySQL简单操作语句
MySQL简单操作语句
2022-04-21 06:29:00 【万德佛】
--MySQL数据库操作
/*创建数据库*/
Create database database_username;
/*创建表*
/*create table 表名
字段名 数据类型 设置主键
字段名 数据类型 是否为空
*/
create table database_username (
Id int primary key,
Name varchar(20) not null,
age int not null,
sex varchar(2) not null
);
/*添加数据*/
/*insert into 表名 数值(ID,NAME,age,sex)相对应填写*/
insert into database_username values(1,'关羽',118,'男');
insert into database_username values(2,'赵云',112,'男');
/*删除语句*/
/*delete from 表名 从哪里 字段名=‘’ ----删除年龄为112岁的人员信息*/
delete from database_username where age=112;
/*更新*/
/*update 表名 set 字段名=‘’ 从哪里 字段名=‘’*/
update database_username set NAME='李白' where Name='关羽'
update database_username set age=100 where age=112;
/*查询语句*/
/*select 查询所有 from */
select * from database_username;
/*select 列名 from 表名 从哪里找 列名=‘’ order(升序排列) by 列名*/
select ID,NAME,age from database_username where NAME='关羽' order by age;
/*打开表锁(直接在表里插入,删除)*/
select * from database_username for update;
/*年-月-日 时:分:秒时间段查询*/
select * from mes.rmp_msg_detail a
where a.send_time between to_date('2018/10/18 16:46:00','yyyy-mm-dd hh24:mi:ss')
and to_date('2018/10/18 16:48:00','yyyy-mm-dd hh24:mi:ss');
版权声明
本文为[万德佛]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_39251440/article/details/83000143
边栏推荐
- Fundamentals of graphics | area light rendering based on LTC
- Unity限制旋转角度
- Udevd retrieves the kernel module and loads the demo
- Tracking memory leaks using mtrace
- C语言版:二叉树的静态建立
- Oracle uses DBMS_ Crypto realizes MD5 value calculation
- TX2上运行ENet
- Could not initialize cudnn ,please check cudnn installation.
- pg 数据库不能使用 zh_CN.UTF-8:initdb: error: locale “zh_CN.UTF-8“ requires unsupported encoding “GBK“
- VMWare vSphere Failed to create object
猜你喜欢

如何利用JMeter和Jprofiler对软件进行性能测试和优化定位

虚幻引擎之Sequence特效和音频绑定触发
图形学基础|基于SDF的卡通阴影图

SQL学习记录

Dpdk process Deadlock of blood case caused by program startup sequence

图形学基础|深度缓冲(DepthBuffer)
Fundamentals of graphics | cartoon shadow map based on SDF

C# Winform 关于ListView显示不全问题

Unable to resolve dependency for ':app@debug/compileClasspath': Could not download mapsforge-map.jar

图形学基础|景深效果(Depth of Field/DOF)
随机推荐
Unity List使用Find或FindAll查找特定元素以及特定元素个数
Reading notes - refinement of thinking
浅学cookie注入
img= img. Copy() error
Unreal connection to MySQL
PowerShell - batch file deferred replication
程序启动顺序引发的血案之 dpdk 进程死锁
SQL学习记录
Fundamentals of graphics | PBR review
字体图标网站---常用汇总
dpdk 问题分析:ice 100G 网卡 rx_packets 与 rx_bytes 统计问题
基于UnityGameFramework框架的AssetBundle打包
Could not initialize cudnn ,please check cudnn installation.
《21天實戰caffe》1-7天學習筆記一
Learn Ruixin micro rk3399pro record (10)
dpdk 问题分析:dpdk-20.11 ice 100G 网卡 rss_hash 配置无效问题
EzySlice切割人物
PowerShell - 因为在此系统上禁止运行脚本
C语言版:二叉树的遍历方式和逆序
Tracking memory leaks using mtrace