当前位置:网站首页>11.表和库的管理
11.表和库的管理
2022-04-23 06:23:00 【阿呆布衣酷】
11.表和库的管理
一.创建数据表
create table t_student
(
id int primary key auto_increment,
name varchar(10) not null,
age int,
sex varchar(8) not null default '女',
address varchar(100),
height double,
birthday date
)charset=utf8;
二.添加数据
insert into t_student (name,age,sex,birthday,height)
values ('范婷婷',18,'女','1998-12-4',170.6);
insert into t_student(name,age,sex)
values(null,10,'男');
insert into t_student
values(null,'程瑞',19,'男','南京',176.6,now())
三.修改数据表
1.添加列
alter table t_student add weight double;
2.修改列类型
alter table t_student modify name varchar(250);
3.修改列名
alter table t_student change sex gender varchar(8);
4.修改表名
alter table t_student rename student;
rename table student to t_student;
四.删除表
drop table if exists user;
五.截断表
truncate table emp;
六.创建库
create database if not exists shop charset utf8;
七.删除库
drop database if exists shop;
版权声明
本文为[阿呆布衣酷]所创,转载请带上原文链接,感谢
https://adbycool.blog.csdn.net/article/details/124350406
边栏推荐
- 关于素数的不到100个秘密
- How to improve the service efficiency of the hotel without blind spots and long endurance | public and Private Integrated walkie talkie?
- 保洁阿姨都能看懂的中国剩余定理和扩展中国剩余定理
- 什么是闭包?
- Emergency medical communication solution | mesh wireless ad hoc network system
- el-table 横向滚动条固定在可视窗口底部
- Background management system framework, there is always what you want
- Source Insight 4.0常见问题
- 可视化常见绘图(一)堆叠图
- (一)OpenPAI jupyter jupyterhub jupyterlab 方案比较
猜你喜欢
Solution of emergency communication system for major security incidents
Jiangning hospital DMR system solution
Javscript gets the real suffix of the file
Educational Codeforces Round 81 (Rated for Div. 2)
USO technology was invited to share the technical framework and challenges of AI synthetic virtual characters at lvson2020 conference
菜菜的刷题日记 | 蓝桥杯 — 十六进制转八进制(纯手撕版)附进制转换笔记
# 可视化常见绘图(二)折线图
Beifeng communication helps Zhanjiang fire brigade build PDT wireless communication system
Metro wireless intercom system
可视化之路(九)Arrow类详解
随机推荐
F-牛妹的苹果树(直径合并)
PC端一次启动多个微信
推导式与正则式
el-table的数据更新后,页面中数据未更新this.$forceUpdate()无效果
数据分析入门 | kaggle泰坦尼克任务(四)—>数据清洗及特征处理
特殊成员与魔法方法
技术小白的第一篇(表达自己)
Educational Codeforces Round 81 (Rated for Div. 2)
[2020WC Day2]F.采蘑菇的克拉莉丝(子树和查询、轻重儿子思想)
How does the public and Private Integrated walkie talkie realize cooperative work under multi-mode communication?
# 可视化常见绘图(二)折线图
两个线程交互打印奇偶数字
Meishe technology launches professional video editing solution for desktop -- Meiying PC version
免费开源充电桩物联网云平台
Pycharm
菜菜的并发编程笔记 |(五)线程安全问题以及Lock解决方案
ES6之箭头函数细谈
学习笔记7-深度神经网络优化
Tensorflow安装后ImportError: DLL load failed: 找不到指定的模块,且国内安装缓慢
(一)OpenPAI jupyter jupyterhub jupyterlab 方案比较