1.建立表
create table 表名(
field1 datatype,
field2 datatype,
field3 datatype
)字符集 校驗規則 engine 引擎;
2.刪除表(drop)
drop table 表名; --表刪除後無法撤銷!!!慎重
3.修改表(alter)
0.新增列
alter table 表名 add 增加列名 資料型別 after 列名;
1.修改列
alter table 表名 modify 列名 新的資料型別;
2.刪除列
alter table 表名 drop 列名;
3.修改表名
alter table 表名 rename to 新錶名;
4.修改某一列的列名
alter table 表名 change 列名 新的列名 資料型別;
4.檢視表
0.檢視資料庫中的所有表
show tables;
1.檢視表結構
desc 表名;
2.檢視建立表的語句
show create table 表名;
Mysql 4 資料庫的基本操作
1.建立資料庫 create database database name 例 create database aa show create database aa 檢視database aa 2.刪除資料庫 drop database database name 3.mysql所支援的儲存引擎 s...
mysql4語法 mysql四 資料操作
一 介紹 mysql資料操作 dml 資料庫操縱語言 在mysql管理軟體中,可以通過sql語句中的dml語言來實現資料的操作,包括 使用insert實現資料的插入 update實現資料的更新 使用delete實現資料的刪除 使用select查詢資料以及 主要內容包括 插入資料 更新資料 刪除資料 ...
MYSQL 4 檢索資料
select distinct vend id from products 不能部分使用distinct,distinct關鍵字應用於所有列而不是前置它的列。如果給出select distinct vend id,prod price,除非指定的兩個列都不同,否則所有行都被檢索出來。select p...