当前位置:网站首页>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
边栏推荐
- vim+ctags+cscpope开发环境搭建指南
- 状态同步与帧同步
- 王者荣耀-unity学习之旅
- 菜菜的刷题日记 | 蓝桥杯 — 十六进制转八进制(纯手撕版)附进制转换笔记
- 可视化常见问题解决方案(八)数学公式
- Object. Create() principle, object Create() specification, handwritten object create(),Object. Create() usage
- VIM使用
- Authorization+Token+JWT
- Educational Codeforces Round 81 (Rated for Div. 2)
- Failed to install Tui editor, quick solution
猜你喜欢

超级宝典&编程指南(红蓝宝书)-读书笔记

简单易懂的子集dp

Date对象(js内置对象)

Lead the industry trend with intelligent production! American camera intelligent video production platform unveiled at 2021 world Ultra HD Video Industry Development Conference

redis连接出错 ERR AUTH <password> called without any password configured for the default user.

Authorization+Token+JWT

保洁阿姨都能看懂的中国剩余定理和扩展中国剩余定理

反思 | Android 音视频缓存机制的系统性设计

页面实时显示当前时间

安装配置淘宝镜像npm(cnpm)
随机推荐
kaggle-房价预测实战
理解补码的要点
Django使用mysql数据库报错解决
公共依赖模块common的处理
[Educational Codeforces Round 80] 解题报告
P2257 YY的GCD(莫比乌斯反演)
CSDN很火的汤小洋老师全部课程总共有哪些(问号问号问号)
每日一题 | 曾被反转链表支配的恐惧
数据库查询优化的方式
反思 | 事件总线的局限性,组件化开发流程中通信机制的设计与实现
简单易懂的子集dp
数论之阶与原根讲解
什么是闭包?
null和undefined的区别
Discussion on arrow function of ES6
【自我激励系列】你永远不会准备好
Dirichlet 前缀和(数论优化式子复杂度利器)
Object.create()原理,Object.create()规范,手写Object.create(),Object.create()用法
反思 | Android 音视频缓存机制的系统性设计
菜菜的并发编程笔记 |(五)线程安全问题以及Lock解决方案