标签:boa group by where 参考 信息 details cin view log
字段名称 |
数据类型 |
说明 |
stuID |
char(10) |
学生编号,主键 |
stuName |
Varchar(10) |
学生名称 |
major |
Varchar(50) |
专业 |
字段名称 |
数据类型 |
说明 |
BID |
char(10) |
学生编号,主键 |
title |
Varchar(10) |
学生名称 |
author |
Varchar(50) |
专业 |
字段名称 |
数据类型 |
说明 |
borrowID |
char(10) |
借书编号,主键 |
stuID |
char(10) |
学生编号,外键 |
BID |
char(10) |
图书编号,外键 |
T_time |
datetime |
借书日期 |
B_time |
datetime |
还书日期 |
select 学生编号=stuID,学生名称=(select stuName from student where stuID=borrow.stuID),图书编号=BID,图书名称=(select title from book where BID=borrow.BID),借出日期=T_time from borrow where stuID in (select stuID from student where major=‘计算机‘) and T_time>‘2007-12-15‘ and T_time<‘2008-1-8‘
select 学生编号=stuID,学生名称=stuName,专业=major from student where stuID in (select stuID from borrow)
select 学生名称=(select stuName from student where stuID=borrow.stuID),图书名称=(select title from book where BID=borrow.BID),借出日期=T_time,归还日期=B_time from borrow where BID in (select BID from book where author=‘安意如‘)
select 学生名称=(select stuName from student where stuID=borrow.stuID),借书数量=count(*) from borrow where B_time is null group by stuID
标签:boa group by where 参考 信息 details cin view log
原文地址:https://www.cnblogs.com/yanqb/p/9895399.html