1,使用子查詢獲得當前沒有被讀者借閱的圖書資訊
select bname as '圖書名稱',bid as '圖書編號',author as '作者名稱',pubcomp as '出版社',price as '單價' from book where bid not in(
select nif from borrow
);2,使用子查詢獲得今年的所有繳納罰款的讀者清單
select reader.rname as '讀者姓名',book.bname as '圖書名稱',pdate as '罰款日期',amount as '繳納罰金'from (penalty inner join reader on penalty.rid = reader.rid) inner join book on book.bid = penalty.bid where year(pdate)=year(now());
3,使用子查詢獲得位址為空的所有讀者尚未歸還的圖書清單
select borrow.rid as '讀者編號',reader.rname as '讀者姓名',book.bname as '圖書名稱',lenddate as '借書日期',willdate as '應歸還日期',returndate as '實際歸還日期' from (borrow inner join reader on borrow.rid = reader.rid) inner join book on book.bid = borrow.nif where borrow.rid in(
select reader.rid from reader where raddress is null
)and returndate is null order by borrow.rid desc,lenddate asc;
第二章 課後作業 2 82,2 90
a 格式 seeeeeee emmmmmmm mmmmmmmm mmmmmmmm pi的二進位制數表示為 0 10000000 10010010000111111101011,s 為0,是個正數。e 為 10000000 轉為10進製為128,128 127 1,即實際指數部分為1.m 為 1001...
S2 第二章 課後作業
新增library資料庫 use master if exists select from sysdatabases where name library drop database library create database library on primary 主資料檔案的具體描述 name...
資料庫作業3 第二章課後題
3.定義並理解下列術語,說明它們之間的聯絡與區別 1 域 domain 域是一組具有相同資料型別的集合。笛卡爾積 cartesian product 域上的一種集合運算。給定一組域d1,d2,dn,允許其中某些域是相同的。d1,d2,dn的笛卡爾積為 d1 d2 dn d1,d2,dn di di,...