三 MYSQL常用語句 查詢語句

2022-06-30 18:30:16 字數 749 閱讀 4174

複習第三天

2021-03-12 12:54:48

序號

函式/方法

含義

例子

備註

1show databases;

顯示所有的資料庫 

2use  資料庫名字;

選擇某個資料庫

#選擇zuoye資料庫

use zuoye;

3create database 資料庫名字;

建立資料庫

#建立school資料庫

create database school;

4drop database 資料庫名字;

刪除某個資料庫

#刪除zuoye資料庫

drop database zuoye;

序號

函式/方法

含義

例子

備註

1show tables;

顯示所有的資料表

前提:先選某個資料庫

2drop table 資料表名;

刪除某個表

#刪除test資料表

drop table test;

mysql常用語句 MySQL常用語句

create table student id int primary key auto increment comment 學號 name varchar 200 comment 姓名 age int comment 年齡 comment 學生資訊 修改表注釋 alter table studen...

MySQL常用語句

and和or可以混用,and比or具有更高的優先順序,但盡量使用圓括號區分 自動過濾重複的資料owner,關鍵字distinct select distinct owner from pet 按照生日公升序排列,關鍵字order by select name,birth from pet order...

MySQL常用語句

1.insert into mis users name,age values ywm 13 select id,name,age from mis users limit 0,50 delete from mis users where id 8 update mis users set name...