數(shù)據(jù)庫創(chuàng)建及語句_第1頁
數(shù)據(jù)庫創(chuàng)建及語句_第2頁
數(shù)據(jù)庫創(chuàng)建及語句_第3頁
數(shù)據(jù)庫創(chuàng)建及語句_第4頁
數(shù)據(jù)庫創(chuàng)建及語句_第5頁
免費預覽已結(jié)束,剩余6頁可下載查看

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

1、use stuient into走脂更爸Create table studentinsert into courseSno ( o ) f二1T_ 3:_l. u二一ex char (2) chck5ex=,男 Pr $ex=r 女'Classno Char (3) rEntrancedate Smalldatetime not nullfHome_addr varch q (Ftimary Hy (SnJgo create table course ( eno char(3) primary keyfi)消息命令已成功完成.Createtable student (Snochar(8

2、),Snamevarchar(8) not null, sexchar(2) check(sex='男'or sex='女'),Birth Smalldatetime,ClassnoChar(3),Entrance_dateSmalldatetime not null,Home_addrvarchar(40) not null,Primary key (Sno) );inF'-rt i nt hi r”Wvalues L 002 I,C的3程疔設正1肛5),m.-:-rt. 12it:.'匚口二一二三values (10031, 1values

3、( 1 004 1 f T4消息(i行受影響)-彳謾1痛)ti彳銀靜向)a行受匐響)insert into course values ('001','高數(shù)',96,6)insert into coursevalues ('002','C語言程序設計,80,5)insert into coursevalues ('003','Java語言程序設計',48,3)values ('004','Visual_Basic'48,4)9°treate table sc (sn

4、o char(8) not null, eno char(3) not null, grade tinyint r心消息命令已成功完成本create table sc(snochar(8) not null, cnochar(3) not null, grade tinyint,qoI insert into studentvalues 上 2cli IgDl*,,張虹J,1男。'1992-097 1,,白弓1L *' J 南京 )values ' ZOU 0002,林紅 I H I U”T1-12 ,051 1120 Ll-OAON北京-umiuDB (,2gj i

5、(口口三 t r,曲呈,二行注上:喂,-汗號靠卜insert into studentvalues ('20110001','張虹','男','1992-09-11','051','2011-09-01','南京')insert into studentvalues ('20110002','林紅','女','1991-11-12','051','2011-09-01','北京&#

6、39;)insert into studentvalues ('20110003','趙青','男','1993-05-11','051','2011-09-01','上海')create tdble course (eno char (3) primary key,H cname varchar(20) not null, total_perior sitia 1 credit tinyint , create table sc(3no char(8) not null/eno c

7、har i 3not null,grade tinyint. j消息命令已成功I完成D create table course( cno char(3) primary key, cnamevarchar(20) not null, total_perior smallint, credit tinyint ,linsert a lues insertlinsert alues linsert alueslinsert aluesjj('20110001'JOO 1 189) 5G(r20110001T r (i行受蹙響 行受號響)(1行受影響,41行受徵響)<1行受鷺響

8、。insert into sc values ('20110001','001',89)insert into sc values ('20110001','002',78)insert into scvalues ('20110001','003',89)002 78) sc(120110001,f *00389)(r2Q110002Tf T00260) sc201100031'001180)insert into sc取亍夔values ('20110002','

9、002',60)insert into scvalues ('20110003','001',80)update course set credit = 4 where cname = 'C 語言程序設計|國籍祟.洞sncoregradebSIIIB-: ikdlB IU1i 2011DOT1I001的2"而語誦"00278320110002002042011DOT3001BQdelete from sc where cno = '003'select* from student口結(jié)果 j消息eno cnarn

10、e tot 目 -perior credit 1而l Q高數(shù) 加 6select* from coursewhere cno = '001'selectcname,COUNT(*)人數(shù) fromsca,coursebwhere o = o group by cname因結(jié)果消息Horne_adctSno Shame sex Brth Ussno &it nanceselect* from studentwhere Snoin (select Snofrom sc where grade < 60)< 國結(jié)果彘消息cnameI! ! 11 ! ! ! ! IS-Bl 9 1 11 ! "TTfl S- -1 I r X 展 Imani iui iiiIjHii iim iiii * iiuaiii 。諾言程序謾計select cname fromcourse a,student b,sccwhere o = o and b.Sno= c.sno and b.Sname='張虹口結(jié)果用消息cname平均分 ail

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論