SQL数据库的简答题求解答

SQL数据库的简答题求解答,第1张

(1)SELECT sno,sname FROM student where sage>20

(2)select cno from course where cname='物理'

(3)select sno,cno from sc where score is null

(4)select sno,cno from sc where score between 80 and 90

(5)select distinct sno from sc

(6)select from sc order by cno,sno desc

1

create table A (

S# varchar(20) primary key,

SN varchar(20),

Sex varchar(2),

Age number(10),

Dept varchar(50));

create table B (

C# varchar(20) primary key,,

CN varchar(20));

create table C (

S# number(10),

C# number(10),

Grade number(10));

2

insert into table A(S#,Sn,Dept) values('010102','张静','机电');

3

update C set grade=59 where grade>=60;

4

delete from C where S# in (select S# from A where Sn like '李%');

delete from A where Sn like '李%';

5

select S#,Sex,Age from A where Sn='刘华';

6

select AS#,BC#,BCn from A,B,C

where ADept not in('计算机系','法律系') and AS#=CS# and CC#=BC#;

7

select CS#,sum(Grade) G from B,C

where Cn='大学语文' and BC#=CC# group by CS# order by G desc;

8

alter table A drop column Sex;//删除列

alter table A drop Column Age;

update A set SEX='',AGE='';//删除列记录

(不知道你这个删除具体是什么意思,2种你自己选择。)

9

drop table C;

drop table B;

drop table A; //先删C再删A,否则会报错,无法删除使用记录。

一,建库

create database 教师管理数据库

on

(

name=教师管理数据库_mdf,

fileneme='数据库路径\教师管理数据库_datamdf',

size=5MB,

maxsize=15MB,

filegrowth=1MB

)

log

on

(

name=教师管理数据库_mdf,

fileneme='数据库路径\教师管理数据库_datamdf',

size=5MB,

maxsize=110,

filegrowth=10%

)

go

二、晚上再说,喝醉了

1

SELECT S FROM dboStudent AS S

INNER JOIN dboResults AS R

ON SSNO = RSNO

INNER JOIN dboSchedule AS SC

ON RCNO = SCCNO

WHERE SCCNAME = '软件工程'

2

SELECT S, SC FROM dboStudent AS S

INNER JOIN dboResults AS R

ON SSNO = RSNO

INNER JOIN dboSchedule AS SC

ON RCNO = SCCNO

WHERE SSNO IN

(SELECT SNO FROM dboResults GROUP BY SNO HAVING COUNT(SNO) > 5)

3

SELECT S, SC FROM dboStudent AS S

INNER JOIN dboResults AS R

ON SSNO = RSNO

INNER JOIN dboSchedule AS SC

ON RCNO = SCCNO

WHERE SSNO IN

(SELECT SNO FROM dboResults WHERE Level < 60)

以上就是关于SQL数据库的简答题求解答全部的内容,包括:SQL数据库的简答题求解答、数据库SQL语句考试、关于SQL Server 2005数据库的考试题目!等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/sjk/10192096.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-06
下一篇 2023-05-06

发表评论

登录后才能评论

评论列表(0条)

保存