資料庫之DQL分頁查詢 DML增刪改

2021-10-13 05:44:36 字數 534 閱讀 3779

— 1、分頁查詢,limit後面第乙個數代表從哪一條資料開始(下標從零開始),第二個數代表查幾條

select * from students where stu_***=1 limit 0,3

— 2、插入語句

insert into students (stu_id,stu_name,stu_age,stu_***,tea_id) values (5,』王一博』,25,1,1)

— id設定自增時可以省略id欄位

insert into students (stu_name,stu_age,stu_***,tea_id) values (『鄧論』,25,1,1)

— 可以直接寫值

insert into students values (7,』王一博』,25,1,1)

— 3、修改語句

update students set stu_name = 『黃景瑜』 where stu_id = 7

— 4、刪除語句

delete from students where stu_id = 7

資料庫 DQL 基礎查詢

dql data query languge select 查詢列表 from 表名 特點 查詢的結果集 是乙個虛擬表 select後面跟的查詢列表,可以有多個部分組成,中間用逗號隔開 例如 select 欄位1,欄位2,表示式 from 表 查詢列表可以是 字段 表示式 常量 函式等 查詢單個字段...

DQL 資料庫查詢語言

一 select 查詢操作 網際網路使用者查詢餘額,查詢裝備,查詢商品的操作 建立資料庫 create database company 建立表mysql create table company.employee5 id int primary key auto increment not nul...

MySql資料庫之DML

mysql資料庫的增刪查改操作 1 插入表中的資料 第一種插入資料的方法 指定所有列 insert into stu number,name age,gender values itcast 0001 zhangsan 28 male 使用第二種方法插入第二組資料,沒有填入的資料的列名,以null填...