ddl:用來定義資料庫物件:建立庫、表、列等
首先貼一張表,下面的查詢內容會用到(僅供參考)
create table 表名();
新增列(新增乙個性別列)create
table student(
id bigint
,stu_name varchar(50
),stu_age int
);
alter table 表名 add 列名 資料型別;
修改資料型別(將stu_name varchar大小從50改到30)alter
table student add stu_gender tinyint
;
alter table 表名 modify 列名 資料型別(xx);
檢視表結構alter
table student modify stu_name varchar(30
);
可以檢視資料上述型別是否被修改
desc 表名;
desc student;
修改表名
rename table 原表名 to 新錶名;
修改字符集rename
table student to newstu;
alter table 表名 character set 字符集編碼;
修改表的列名alter
table student character
set gbk;
alter table 表名change 原列名 新列名 資料型別(xx);
刪除一列alter
table student change stu_name s_name varchar(30
);
(刪除上述性別列)
alter table 表名 drop 列名;
刪除表alter
table student drop stu_gender;
drop table 表名;
drop
table student;
什麼是DML?其含義及其常用命令解析
dml 資料庫操作語言,用來運算元據庫表中的記錄,如增刪改查等。select from 表名 select from student dml dcl dql insert into 表名 列名1,列名2 value 列值1,列值2 insert into student id,stu name,st...
Redis常用命令含義
created by phpstorm.user perilla date 2018 4 27 time 9 13 namespace reids class reids 作用 學習redis class reidselse strng 字串 set public function strings ...
ubuntu dpkg 常用命令及其作用
nux的包管理有多種,除了rpm,apt等還有優秀的dpkg,下面是dpkg命令的詳細使用教程,希望對你有用。deb包的管理是比較優秀的包管理工具,用的linux系統有 debian ubuntu dpkg命令的使用 dpkg l 檢視當前系統中已經安裝的軟體包的資訊 dpkg l 軟體包名稱 檢視...