第1个回答 2019-12-29
1)
select
a.学号,a.成绩
from
选修
a,
课程
b
where
a.课程号=b.课程号
and
b.课程名='3号'
order
by
a.成绩
desc
--
如果不是按课程名查,可以不用连接"课程"表
2)
select
a.课程号,
b.课程名,
count(a.学好)
from
选修
a,
课程
b
where
a.课程号=b.课程号
group
by
a.课程号,
b.课程名
3)
select
b.姓名
from
选修
a,
学生
b
where
a.学号=b.学号
and
a.成绩
>
90
4)
insert
into
学生(学号,姓名,性别,年龄,所在系)
values
('012508','刘敏','女',18,'计算机')
第2个回答 2014-12-02
(1)create table Student
(sno char(8) primary key,
sname char(10),
gender char(2),
department char(20),
age int)
go
(2) alter table Student alter column sno char(10)
(3) drop table Student
第3个回答 2014-12-02
(1)
CREATE TABLE [dbo].[Student](
[sno] [varchar](8) NOT NULL,
[sname] [nvarchar](10) NOT NULL,
[gender] [nvarchar](2) NOT NULL,
[department] [nvarchar](50) NOT NULL,
[age] [int] NOT NULL,
CONSTRAINT [PK_sno] PRIMARY KEY CLUSTERED
(
[sno] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
(2)
alter table Student alter column sno varchar(10)
(3)
drop table Student本回答被提问者采纳