mysql 基本語句總結

2021-07-24 10:20:35 字數 447 閱讀 2478

1.開啟、關閉資料庫服務

dos下輸入 net start mysql          net stop mysql  開啟、關閉服務

2.建立、使用資料庫

create database + 資料庫名稱;    use +資料庫名稱

3.建立資料庫表

create table +表名(

列名 屬性  屬性  ,

列名   屬性 屬性 );

4.插入insert into 表名 values

(' ',' ','  '),(' ',' ','  '),(' ',' ','  ') 這樣可以插入多條記錄

5.刪除記錄

delete from 表名 where +條件

6.查詢 select * from 表名 where 條件

7.修改update 表名 set 更改的列 where 條件

Mysql基本語句的總結

1 建立乙個表 drop table if exists 表名 create table 表名 id int 11 primary key auto increment,name varchar 20 not null 2 修改乙個表的表名 alter table 表名1 rename to 表名2...

mysql基本語句 mysql基本語句

mysql關係型資料庫rds中的老大哥,增刪改查是mysql入門的基礎 增刪改查語句 增刪改查的語句命令為 增 insert 刪 delete 改 update 查 select或者show 庫操作建立資料庫 create database shujukuba 建立帶字符集的資料庫 create d...

MySQL基本語句總結之約束

not null 限制列取值非空。default 給定列的預設值。unique 限制列取值不重。check 限制列的取值範圍。primary key 指定本列為主碼。foreign key 定義本列為引用其他表的外碼。使用形式為 foreign key 外碼列名 references 外表名 外表列...