資源描述:
《select查詢 實(shí)例集錦》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在行業(yè)資料-天天文庫。
1、select查詢實(shí)例集錦例一:圖書管理數(shù)據(jù)庫 圖書(總編號(hào)C(6),分類號(hào)C(8),書名C(16),作者C(6),出版單位C(20),單價(jià)N(6,2)) 讀者(借書證號(hào)C(4),單位C(8),姓名C(6),性別C(2),職稱C(6),地址C(20))借閱(借書證號(hào)C(4),總編號(hào)C(6),借書日期D(8))Createtablebook(bidvarchar(6)primarykey,kindvarchar(8),bnamevarchar(16),bauthorvarchar(6),bpubvarchar(20),bpriceint(5)
2、);Createtablecarduser(uidvarchar(4)primarykey,upartvarchar(8),unamevarchar(6),usexenum('0','1','2'),ujobvarchar(6),uaddvarchar(20));Createtableborrow(idint(8)primarykeyauto_increment,uidvarchar(4),bidvarchar(6),datedate);Insertintobook(bid,kind,bname,bpub,bprice)values("000
3、001","tec","tecnetwork","AA",17);Insertintobook(bid,kind,bname,bpub,bprice)values("000002","tec","tecAjax","AA",23);Insertintobook(bid,kind,bname,bpub,bprice)values("000003","elc","elecCap","BB",33);BreezelifePage106/12/2021Insertintobook(bid,kind,bname,bpub,bprice)values("
4、000004","tec","tecXml","AA",21);Insertintobook(bid,kind,bname,bpub,bprice)values("000005","elc","elcJquery","BB",15);Insertintobook(bid,kind,bname,bpub,bprice)values("000006","pic","picPhoto","CC",10);Insertintobook(bid,kind,bname,bpub,bprice)values("000007","pic","picShow"
5、,"BB",26);Insertintocarduser(uid,upart,uname,usex)value("0001","Pso","Jason","1");Insertintocarduser(uid,upart,uname,usex)value("0002","Pso","April","0");Insertintocarduser(uid,upart,uname,usex)value("0003","Pso","Sharon","0");Insertintocarduser(uid,upart,uname,usex)value("
6、0004","Pso","Monica","0");Insertintocarduser(uid,upart,uname,usex)value("0005","Psale","Pary","1");Insertintocarduser(uid,upart,uname,usex)value("0006","Psale","Rita","0");Insertintocarduser(uid,upart,uname,usex)valueBreezelifePage106/12/2021("0007","Psale","Lucy","0");Inse
7、rtintocarduser(uid,upart,uname,usex)value("0008","Psale","Sofia","0");Insertintocarduser(uid,upart,uname,usex)value("0009","Pedit","Basil","1");Insertintocarduser(uid,upart,uname,usex)value("0010","Pedit","Rita","0");Insertintoborrow(uid,bid)value("0001","000004");Insertint
8、oborrow(uid,bid)value("0001","000005");Insertintoborrow(uid,bid)value("0001","0000