Êý¾Ý¿âʵÑéºÍ²Î¿¼´ð°¸(3)

2020-04-14 22:25

49£®²éѯͬʱѡÐÞÁË¡°VB¡±ºÍ¡°Êý¾Ý¿â»ù´¡¡±µÄѧÉúÐÕÃû¡£

50 ²éѯֻѡ¡°VB¡±¶øÃ»Ñ¡¡°Êý¾Ý¿â»ù´¡¡±µÄѧÉúÐÕÃû¡£ --ʵÑéÈý --1 create

table

kcb(Cno

char(4)

constraint zj primary key,

Cname char(40), Cpno kcb(cno),

Ccredit smallint); insert

kcb(Cno,Cname,Cpno,Ccredit) values ('1','Êý¾Ý¿â','5',4); --2

11

char(4)

constraint wj foreign key references

into

alter table Student add phone char(7) default '1111111'; --3

alter table kcb drop constraint wj,zj --4 alter --5

alter database ѧÉú¹ÜÀíÊý¾Ý¿â modify

file(name='students_data',filegrowth=3mb); --6

sp_renamedb ѧÉú¹ÜÀíÊý¾Ý¿â,ѧÉú¹ÜÀí --7

backup database ѧÉú¹ÜÀí to disk='c\\297'

12

table Course add

check(class_hour>=Ccredit*16);

--9

create unique index Coucno on Course(Cno); --ʵÑéËÄ --1

select * from student select * from SC --2 select --3

select Sno,Grade from SC where Cno='c01'; --4

select * from SC where Grade>70 and Grade<80 --5

select Sname,Sage from student

13

Sname,Sage from student

where Sdept='¼ÆËã»úϵ';

where Sdept='¼ÆËã»úϵ' and Ssex='ÄÐ' and Sage>18 and Sage<20 --6

select * from SC where Sno='0412101' --7

select max(Grade)max from SC where Cno='c01' --8

select distinct Cno from SC --9 select

OrderID,CustomerID,OrderDate Orders

ORDER BY OrderDate DESC --10 select

14

from OrderID,CustomerID,ShipCountry from Orders

where ShipCountry like'B_a%' or ShipCountry like'C_a%' or ShipCountry like'D_a%' or ShipCountry like'F_a%' --11 select

OrderID,CustomerID,ShipCountry from Orders

where ShipCountry not like'A%a' and ShipCountry not like'B%a' and ShipCountry not like'C%a' and ShipCountry not like'D%a' and ShipCountry not like'E%a' and ShipCountry not like'F%a' --12 select

max(Sage)max,min(Sage)min

15


Êý¾Ý¿âʵÑéºÍ²Î¿¼´ð°¸(3).doc ½«±¾ÎĵÄWordÎĵµÏÂÔØµ½µçÄÔ ÏÂÔØÊ§°Ü»òÕßÎĵµ²»ÍêÕû£¬ÇëÁªÏµ¿Í·þÈËÔ±½â¾ö£¡

ÏÂһƪ£º¾ò½ø¶Ó°à×齨ÉèÖÆ¶È»ã±à

Ïà¹ØÔĶÁ
±¾ÀàÅÅÐÐ
¡Á ×¢²á»áÔ±Ãâ·ÑÏÂÔØ£¨ÏÂÔØºó¿ÉÒÔ×ÔÓɸ´ÖƺÍÅŰ棩

ÂíÉÏ×¢²á»áÔ±

×¢£ºÏÂÔØÎĵµÓпÉÄÜ¡°Ö»ÓÐĿ¼»òÕßÄÚÈݲ»È«¡±µÈÇé¿ö£¬ÇëÏÂÔØÖ®Ç°×¢Òâ±æ±ð£¬Èç¹ûÄúÒѸ¶·ÑÇÒÎÞ·¨ÏÂÔØ»òÄÚÈÝÓÐÎÊÌ⣬ÇëÁªÏµÎÒÃÇЭÖúÄã´¦Àí¡£
΢ÐÅ£º QQ£º