admin 管理员组

文章数量: 886992

多表查询案例(例题+答案)

– 创建book表格

CREATE TABLE book(bookID VARCHAR(20) PRIMARY KEY ,bookName VARCHAR(50) DEFAULT NULL);

– 插入数据

INSERT INTO book VALUES
(1,'java基础'),
(2,'javaweb'),
(3,'JDBC'),
(4,'HTML高级');

– 图片展示

– 创建loan表格

CREATE TABLE loan(uid INT,bookID VARCHAR(32),lnum INT,PRIMARY KEY(uid,bookID));

– 插入数据

INSERT INTO loan VALUES
(1,1,8),
(2,4,2),
(3,3,3),
(4,2,7),
(5,1,1),
(2,3,10),
(2,2,3),
(3,

本文标签: 多表查询案例(例题答案)