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