日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 >

MySQL修改、删除表的结构

發(fā)布時(shí)間:2025/3/12 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 MySQL修改、删除表的结构 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

MySQL修改、刪除表的結(jié)構(gòu)

1、增加一列

alter table student add score double(3,1);

說明

double(3,1)指數(shù)據(jù)是三位,小數(shù)部分占一位,整數(shù)部分占兩位,默認(rèn)最后一列

alter ?table student add score double (5,2) first

在第一列插入score

alter ?table student add score double(5,2) after enterdate;

在enterdate后插入

3、刪除一列

alter table student drop score;

4、修改一列,列名不變

alter table student modify score float(2,1);

update student set score = 3.45 where sno =2 ;

修改一列,列名改變

alter table student change score score2 double(3,1);

5、修改表名

alter table student rename to stu;

6、查看表的結(jié)構(gòu)

desc student;

7、刪除數(shù)據(jù)庫(kù)表

drop table student;

?

總結(jié)

以上是生活随笔為你收集整理的MySQL修改、删除表的结构的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。