資源描述:
《實(shí)驗(yàn)3數(shù)據(jù)庫(kù)的查詢和視圖》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在工程資料-天天文庫(kù)。
1、實(shí)驗(yàn)3數(shù)據(jù)庫(kù)的查詢和視圖T4.1數(shù)據(jù)庫(kù)的查詢1?目的和要求(1)掌握SELECT語(yǔ)句基本用法(2)掌握子查詢的表示(3)掌握連接查詢的表示(4)掌握SELECT語(yǔ)句的GROUPBY子句的作用和使用方法(5)掌握SELECT語(yǔ)句的ORDERBY了旬的作川和使川方法2?實(shí)驗(yàn)內(nèi)容(1)SELECT語(yǔ)句的基木使用1)對(duì)于實(shí)驗(yàn)2給出的數(shù)據(jù)庫(kù)表結(jié)構(gòu),查詢說(shuō)有雇員的每個(gè)數(shù)據(jù)。SQLQueryLsql-SD^ministrator(53))*▼XUSEYGGLGO芻BSELECT■LFROMEoployeesinEmptoyeelDNameEduc
2、ationBrthdaySexWockYearAddressPhoneNumberDepartmentID1[010008I伍容華本科197W33-2813畑東路10028332132112020010王向榮碩士1982-12-0912四牌樓1(MM088379231613102201螂月本科1972-10-18138360660854102208朱:俊碩士196WJ9-2812昨巷21068470881755111006張石兵本科1974-1MJ11134-1-2038456341856210678林淸大專1977X0212中山彳
3、隔2d358346733637302566李玉琨本科19684)9-2013iMflK209-35876599148308759葉凡本科1978-11-1812:!晾西路833089014【思考與練習(xí)】用SELECT杳詢Emmployees和Salary屮所有數(shù)據(jù)SQLQuery6.sql?SD...mini$trator(54))*SQLQuery5.sql-SD...ministrator(53))*USEYGGLGO□SELECT*tz.FROMEmployeesGO□SELECT?lFROMSalaryinH結(jié)果消息Empl
4、oyeeIDNameEducabonBirthdaySexWorkYearAddressPhoneNumberDepartmentID1roiobbs
5、伍吝華本科197603-2813北京東路1228332132112020010王向榮碩士1982-12-0912四牌樓1W1088379231613102201劉明本科1972-10-1813虎踞路10028360660854102208朱俊碩士1965OS-2812牌樓巷5^1068470881755111006張石兵本科1974-1(M)111解放路34H203845634185
6、6210678林濤大專1977-04X)212中山北路24?358346733637302566李玉琨本科19684J3-2013熱和路20935876599148308759葉凡本科1978-11-1812北京西路833089014EmployeelDInComeOutCome41fbbbboi
7、2100.8123.0920100081582.6288033020010286019840200182347.6818051022012569.88185.656102208198010071089913259.98281.522)用S
8、ELECT語(yǔ)句杳詢Employees每個(gè)員丁的地址和電話SQLQuery2.sql?SD^ministrator(53))*USEYGGLGOBSELECTAddress,PhoneN^nier匚FROMEirployees
9、二]結(jié)累二消息AddressPhoneNumber1:寸涼東路122833213212四牌樓1W108837923163100-2836066084牌擺巷847088175蹄路34?1?203845634186中山北路2£?35834673367快和昭209?3587G59918北京西路【思考與練習(xí)】A.用SE
10、LECT語(yǔ)句查詢Employees和Salary中的一列或若丁列SQLQuery2.sql?SD^ministrator(53))GOEJSELECTAddress^PhoneNumberLFROMEmployeesGO□SELECTIncomelFROMSalary4[2.川AddressPhoneNumber1北京東路1002833213212四ttttKM>iO8837923163836066084脫巷3106847088175蹄路34?1?203845634186中山北路24?35834673367&209-35876599
11、18d?西路B?查詢Employees中部門(mén)號(hào)和性別,用DISTINCT消除重復(fù)行3)查詢Employees中000001雇員的地址和電話SDWM-20140228KL-.?dbo.Employees2SQLQuery3.sql?SD