



全文預(yù)覽已結(jié)束
下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
游戲開發(fā)商 Game_Company結(jié)構(gòu):idChar(5) not nullpknamevarChar2(100) not nullcountryvarChar2(100) 數(shù)據(jù):idnamecountry00001世嘉日本00002盛大中國00003任天堂美國游戲 Game結(jié)構(gòu):idChar(4) not nullpkcompanyIdChar(5) not nullFk :Game_Company的idnamevarChar2(100) not nulltypevarChar2(50)數(shù)據(jù):idcompanyIdnametype900100001惡狼傳說格斗900200001櫻花大戰(zhàn)90%益智900300002GT賽車競技900400003口袋妖怪益智900500003俄羅斯方塊益智900600003馬力歐益智900700003口袋妖怪競技游戲者 Player結(jié)構(gòu):useridChar(3) not nullpkusernamevarChar2(50) not nullgameidChar(4) not nullFk :Game_Company的id數(shù)據(jù):useridusernamegameid001張三9003002李四9002003陳奇9001004王照9005005鄭明9006006胡倩9006007李夢9007008馬林90061. 創(chuàng)建game 表的結(jié)構(gòu);表名定義為表名+自己的姓名;create table database_java1_test.game_XXX( idChar(4), companyIdChar(5) not null, namevarChar(100) not null, typevarChar(50);2. 向game表中的主外鍵;alter table database_java1_test.game add primary key (id);alter table database_java1_test.gameadd constraint fk_game_companyforeign key (companyId) references database_java1_test.game_company (id) ;3. 添加game表的數(shù)據(jù);【9008, 00003, 超級瑪麗, 動作】Insert into game values (9008, 00003, 超級瑪麗, 動作);4. 更新game表數(shù)據(jù),把9008游戲名更新為 超級瑪麗升級版;Update game set name=超級瑪麗升級版 where id=9008;5. 統(tǒng)計各個游戲類別的游戲數(shù)量;Select name, count(*) from game group by name;6. 查詢每個游戲商家生產(chǎn)的游戲個數(shù),以及廠商名,國家;select t0.id, , t0.country, t.totalnum from game_company t0, (select companyid, count(*) totalnum from game group by companyid) twhere t0.id=panyid7. 查詢玩家最少的游戲名;select t0.id, , t1.minnum from game t0, (select t.gameid, min(t.totalnum) minnum from (select gameid, count(*) totalnum from player group by gameid) t) t1where t0.id=t1.gameid;8. 查詢游戲名帶有%的游戲select * from game where name like %;9. 查詢沒有人玩的游戲 select * from game g where g.id not in (select distinct p.gameid from player p)10. 查詢玩家最多的三個游戲名;select t0.id, , t.totalnum from game t0, (select gameid, count(*) totalnum from player group by gameid order by totalnum desc, gameid asc limit 3) twhere t0.id=t.gameid;數(shù)據(jù)drop table Player;drop table Game;drop table Game_Company;create table Game_Company( id Char(5) not null primary key, namevarChar2(100) not null, countryvarChar2(100);create table Game( idChar(4)primary key, companyIdChar(5) not null, namevarChar2(100) not null, typevarChar2(50);create table Player( useridChar(3) primary key, usernamevarChar2(50) not null, gameidChar(4) not null); insert into game values (9001,00001,惡狼傳說,格斗); insert into game values (9002,00001,櫻花大戰(zhàn)90%,益智); insert into game values (9003,00002,GT賽車,競技); insert into game values (9004,00003,口袋妖怪,益智); insert into game values (9005,00003,俄羅斯方塊,益智); insert into game values (9006,00003,馬力歐,益智); insert into game values (9007,00003,口袋妖怪,競技);insert into Game_Company values(00001,世嘉,日本);insert into Game_Company values(00002,盛大,中國);insert into Game_Company values(00003,任天堂,美國);insert into Player values(001,張三,9003);insert into Player values(002,李四,9002);insert into Player values(003,陳奇,9001);insert into Player values(004,王照,9005);inse
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年福建南平武夷文化旅游投資開發(fā)有限公司見習(xí)生、實習(xí)生考試筆試試題(含答案)
- 【南陽】2025年河南南陽市南召縣衛(wèi)生系統(tǒng)事業(yè)單位(總醫(yī)院)招聘43人筆試歷年典型考題及考點剖析附帶答案詳解
- 【遼源】2025年吉林遼源市拉拉河社會福利院招聘工作人員4人筆試歷年典型考題及考點剖析附帶答案詳解
- 文庫發(fā)布:班會課件
- 文庫發(fā)布:急診科課件
- 房間課件內(nèi)容
- 敬畏的課件教學(xué)課件
- 敬畏主題班會課件
- 散步課件介紹
- 散步的說課課件
- GB/T 5470-2008塑料沖擊法脆化溫度的測定
- GB/T 40998-2021變性淀粉中羥丙基含量的測定分光光度法
- GB/T 3672.2-2002橡膠制品的公差第2部分:幾何公差
- GB/T 31848-2015汽車貼膜玻璃貼膜要求
- GB/T 18884.2-2015家用廚房設(shè)備第2部分:通用技術(shù)要求
- GB/T 12239-2008工業(yè)閥門金屬隔膜閥
- 行政法培訓(xùn)講義課件
- DB32T 4174-2021 城市居住區(qū)和單位綠化標(biāo)準(zhǔn)
- 基本原理與性能特點多自由度電磁軸承課件
- 北京輸變電工程標(biāo)準(zhǔn)工藝應(yīng)用圖冊(圖文并茂)
- 三相負荷(380V)及單相(220V)最大供電距離計算表及電壓降計算表
評論
0/150
提交評論