当前位置:网站首页>11. Table and library management
11. Table and library management
2022-04-23 07:40:00 【Ah Dai cloth clothes cool】
11. Management of tables and libraries
One . Create data table
create table t_student
(
id int primary key auto_increment,
name varchar(10) not null,
age int,
sex varchar(8) not null default ' Woman ',
address varchar(100),
height double,
birthday date
)charset=utf8;
Two . Add data
insert into t_student (name,age,sex,birthday,height)
values (' Fan Tingting ',18,' Woman ','1998-12-4',170.6);
insert into t_student(name,age,sex)
values(null,10,' male ');
insert into t_student
values(null,' Cheng Rui ',19,' male ',' nanjing ',176.6,now())
3、 ... and . Modify data sheet
1. Add columns
alter table t_student add weight double;
2. Modify column type
alter table t_student modify name varchar(250);
3. Change column names
alter table t_student change sex gender varchar(8);
4. Modify the name of the table
alter table t_student rename student;
rename table student to t_student;
Four . Delete table
drop table if exists user;
5、 ... and . Truncation table
truncate table emp;
6、 ... and . Create a library
create database if not exists shop charset utf8;
7、 ... and . Delete Library
drop database if exists shop;
版权声明
本文为[Ah Dai cloth clothes cool]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230622239183.html
边栏推荐
猜你喜欢

Educational Codeforces Round 81 (Rated for Div. 2)

Authorization+Token+JWT

数论分块(整除分块)

USO technology was invited to share the technical framework and challenges of AI synthetic virtual characters at lvson2020 conference

manjaro安装与配置(vscode,微信,美化,输入法)

如何SQL 语句UNION实现当一个表中的一列内容为空时则取另一个表的另一列

学习笔记6-几种深度学习卷积神经网络的总结

vim+ctags+cscpope开发环境搭建指南

可视化常见问题解决方案(八)共享绘图区域问题解决方案

自定义时间格式(YYYY-MM-DD HH:mm:ss 星期X)
随机推荐
状态同步与帧同步
Moment.js中format方法函数的格式
C语言的指针符号到底靠近变量类型还是变量名?
MVCC(多版本并发控制)
Failed to install Tui editor, quick solution
小程序换行符\n失效问题解决-日常踩坑
Mysql 索引
CSDN很火的汤小洋老师全部课程总共有哪些(问号问号问号)
LATEX公式注意事项
【TED系列】如何与内心深处的批评家相处?
[COCI]Lampice (二分+树分治+字符串哈希)
快速下载vscode的方法
The difference between null and undefined
【自我激励系列】你永远不会准备好
[Educational Codeforces Round 80] 解题报告
Machine vision series (02) -- tensorflow2 3 + win10 + GPU installation
Discussion on the outline of short video technology
[hdu6868]Absolute Math(推式子+莫比乌斯反演)
Educational Codeforces Round 81 (Rated for Div. 2)
Reflection on the systematic design of Android audio and video caching mechanism