



下載本文檔
版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
1、1、查詢商品的所有信息。2、 網站管理人員在了解商品信息時只需要了解所有商品的商品號、 商品名稱和商品單價。3、在Goods表中存儲有冏品數量和冏品單價,現在需要了解所有冏品的冏品號、冏品名稱和商品名額。4、要求需要了解所有商品號、商品名稱和總價值,但希望分別以漢字標題商品號、商品名稱和總價值表示 g_ID、g_Namef口 g_Price*g_Number。5、顯示所有會員的編號、姓名、性別和年齡。6、查詢所有商品中的“熱點”商品的所有信息。7、查詢商品類別為“ 01” ,商品單價在2500 元以上的商品信息,要求分別以漢字標題商品號、商品名稱、商品類別號和價格。8、查詢所有年齡在2025歲
2、的會員的名稱和年齡(用 NL表示,不是基本表中的字段,是計算出來的) 。9、查詢所有年齡不在2025歲的會員的名稱、籍貫和 NL(同8)。10、查詢來自“湖南株洲”或“湖南長沙”兩地會員的詳細信息。11、查詢家庭地址不是“湖南株洲”或“湖南長沙”的商品的詳細信息。12、查詢所有商品中以“三星”兩字開頭的商品的詳細信息。13、查詢姓“黃”且名字中只有兩個漢字的會員的會員名、真實姓名、電話和店子郵箱。14、知道一個商品的商品名稱中包含有“520”字樣,要求查詢該商品的商品號、商品名稱、商品單價和商品折扣。15、查詢暫時沒有商品圖片的商品信息。16、查詢在WebSho網站進行了網購并下訂單的會員編號
3、。17、查詢商品表中錢5 條商品的詳細信息。18、查詢商品類別號為“01”的商品的商品號、商品名稱和商品單價,并根據商品的價格進行降序(價格由高到低)排列。19、在上例中,如果商品的價格相同,要求根據商品名稱進行升序排列。20、查詢所有商品的最高價、最低價、平均價和所有庫存量之和。21、查詢每一類別的商品總數。22、查詢商品單價超過2000 的商品類別編號和庫存量。23、顯示每個商品類別的商品庫存量及商品總庫存量。24、顯示商品總庫存量、每個種類商品的商品總量和每一商品的數量。25、查詢訂單總額大于5000 的訂單信息,并按升序排列。26、查詢每個商品的商品號、商品名稱和商品類別名稱。27、查
4、詢所有訂單中訂購的商品信息(商品名稱、購買價格和購買數量)和訂單日期。28、查詢不低于“三星SGH-C178價格的商品號、商品名稱和商品單價,查詢后的結果要求按商品單價升序排列。29、查詢所有商品類別及其應用商品信息,如果該商品類別沒有對應商品也需要顯示其類別信息。30、 查詢所有商品信息 (即使不存在對應的商品類別信息, 實際上這種情況是不存在的) 。31、查詢所有商品的基本信息和類別信息。32、查詢與“摩托羅拉 W380為同類商品的商品號、商品名稱和類別號。33、查詢購買了“紅雙喜牌乒乓球拍”的訂單號、訂單時間和訂單總金額。34、查詢購買了商品號為“060001”的會員e_ID(會員號)、
5、e_Name會員名稱)和e_Address(籍貫) 。35、查詢購買了“紅雙喜牌乒乓球拍”的訂單號、訂單時間和訂單總金額(使用“= ”完 成) 。36、查詢比籍貫為“湖南長沙”人以會員年齡小的會員信息,查詢結果按降序排列。37、針對Employees表中的每一位員工,在Orders表中查找處理過訂單并且送貨模式為“郵寄”的多有訂單信息。38、求每一類商品的平均價格,并將結果保存到數據庫中。39、將商品中的類別名稱為“家用電器”的商品折扣修改為 0.8 。40、使用兩條Update 語句保證數據庫的一致性。41、刪除類別名稱為“家用電器”的商品的基本信息。42、查詢“三星”的商品以及價格不高于2
6、000 的商品。1、 select *from scott.goods;2、 select g_id, g_name, g_pricefrom scott.goods;3、 select g_id, g_name, g_price*g_numberfrom goods;4、 select g_id 商品號 , g_name 商品名稱 , g_price*g_number 總價值 from scott.goods;5、 select c_id 編號 ,c_name 姓名 ,c_gender 性別 , to_char(sysdate, 'yyyy') to_char(c_birth
7、,'yyyy') as 年齡from scott.customers;6、 select *from scott.goodswhere g_status = ' 熱點 '7、 select g_id 商品號 ,g_name 商品名稱 ,t_id 類別號 ,g_price 價格from goodswhere t_id = '01' and g_price > 25008、 select c_name,to_char(sysdate, 'yyyy') to_char(c_birth,'yyyy') nl from
8、 customerswhere to_char(sysdate, 'yyyy') to_char(c_birth,'yyyy') between 20 and 259、 select c_name,to_char(sysdate, 'yyyy') to_char(c_birth,'yyyy') nlfrom customerswhere to_char(sysdate, 'yyyy') to_char(c_birth,'yyyy') not between 20 and 25 10、 select
9、c_id,c_name,c_addressfrom customerswhere substr(c_address,1,4) in (' 湖南株洲 ',' 湖南長沙 ')11、 select c_id,c_name,c_addressfrom customerswhere substr(c_address,1,4) not in (' 湖南株洲 ',' 湖南長沙 ')12、 select *from goodswhere g_name like ' 三星 %'13、 select c_name,c_truename
10、,c_phone,c_e-mail from customerswhere c_truename like '黃_'14、 select g_id, g_name,g_price,g_discountfrom goodswhere g_name like '%520%'15、 select *from goodswhere g_image is null16、 select g_idfrom orderdetails17、 select *from scott.goodswhere rownum <= 5;18、 select g_id,g_name,g_
11、pricefrom scott.goodswhere t_id = '01'order by g_price desc19、 select g_id,g_name,g_pricefrom scott.goodswhere t_id = '01'order by g_price desc,g_name asc20、 、 select max(g_price) 最 高 價 , min(g_price) 最 低 價 ,avg(g_price) 平 均 價 ,sum(g_number) 總庫存from scott.goods21、 select t_id 類別號 ,co
12、unt(t_id) 商品數from scott.goodsgroup by t_id;22、 select t_id, sum(g_number) 庫存量from scott.goodswhere g_price >=2000group by t_id;23、 select g_id, t_id, sum(g_number) 庫存量from scott.goodsgroup by rollup(t_id,g_id);24、 select g_id, t_id, sum(g_number) 庫存量from scott.goodsgroup by cube(t_id,g_id);25、 se
13、lect o_id 訂單編號 ,sum(d_price * d_number) 總金額from scott.orderdetailsgroup by o_idhaving sum(d_price * d_number) > 5000order by sum(d_price * d_number)26、 select goods.g_id,goods.t_id,types.t_name,goods.g_namefrom scott.goods ajoin scott.types bon a.t_id = b.t_id;27、 select order.o_id, o_date, o_dat
14、e, g_name, d_price, d_number from scott.order ajoin scott.orderdetails b on a.o_id = b.o_id join goods c on b.g_id = c.g_id;28、 select b.g_id 商品號 ,b.g_name 商品名稱 ,b.g_price 價格from scott.goods ajoin scott.goods bon a.g_name = ' 三星 SGH-C178' and a.g_price <= b.g_price order by b.g_price;29、
15、select types.t_id, t_name, g_id, g_name, g_price, g_number from scott.typesleft outer join scott.goods on types.t_id = goods.t_id;30、 select types.t_id, t_name, g_id, g_name, g_price, g_numberfrom scott.typesright outer join scott.goods on types.t_id = goods.t_id;31、 select types.t_id, t_name, g_id,
16、 g_name, g_price, g_number from scott.typesfull outer join scott.goods on types.t_id = goods.t_id;32、 select g_id, g_name, t_id from scott.goodswhere t_id in (select t_id from goods where g_name = '摩托羅拉 W380');33、 select o_id, o_date, o_sumfrom scott.orderswhere o_id in(select o_id from orde
17、rdetails where g_id in(select g_id from goods where g_name = ' 紅雙喜牌乒乓球拍 ');34、 select c_id, c_name, c_address from scott.customerswhere c_id in(select c_idfrom orders ajoin orderdetails b on a.o_id = b.o_id where g_id = '060001');35、 select o_id, o_date, o_sum from scott.orderswhere
18、o_id in(select o_id from orderdetails where g_id =(select g_id from goods where g_name = ' 紅雙喜牌乒乓球拍 ') );36、 select c_id, c_name, to_char(sysdate) - to_char(c_birth) age, c_address from scott.customerswhere substr(c_address,1,4)< >' 湖南長沙 ' and c_birth > all湖南長沙 ' )(selec
19、t c_birth from customers where substr(c_address,1,4) = order by age desc;37、 select * from orders where o_sendmode = ' 郵寄 ' and EXISTS (select e_id from employees as emp where emp.e_id = order.e_id) 38、 ( 1)先建立一個新表: create table avggoods(t_id char(2),a_avg float);其中 t_id 代表商品類別號,a_avg 代表平均價格( 2)對數據庫的商品表按商品號分組求平均價格,并把商品號和平均價格存入新表; insert into avggoods (t_id, a_avg) select t_id, avg(g_price) from goods group by t_id;38、 3)查看 avggoods 表中的記錄 select * from avg
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 微生物檢測與公眾健康研究試題及答案
- 項目管理資格考試參考資料試題及答案
- 項目隨機事件應對相關題目及答案
- 項目管理認證考試難度試題及答案
- 初中政治共建“一帶一路”倡議:進展貢獻與展望素材
- 關注項目管理專業人士的職業素養提升試題及答案
- 理解2025年證券從業資格證考試的評估標準試題及答案
- 2025年證券從業資格證考試觀點探討與試題答案
- 證券從業資格分析與解題試題及答案
- 理解不同行業投資的特點試題及答案
- 中國政法大學社會主義市場經濟概論重點歸納及復習試題(楊干忠版)
- 煤礦頂板事故防治(1)
- 《螞蟻和西瓜》課件
- 計量支付用表承包人
- 調Q技術與鎖模技術(課堂PPT)
- 快速制作會議座次表、會場座位安排
- 公司財務報表模板(word版本)
- 北京牌匾標識設置管理規范北京城管理委員會
- 工廠利器管制辦法
- 郫縣征地拆遷補償安置暫行辦法
- 專業拜訪技巧
評論
0/150
提交評論