求助。SQLserver问题
1个回答
展开全部
create database StudentDataBase
on primary
(
name=StudentDataBase_DAT,
filename='F:\StudentDataBase.mdf',
size=5MB,
maxsize=15MB,
filegrowth=1MB
)
LOG on
(
name=StudentDataBase_LOG,
filename='F:\StudentDataBase.LOG',
size=5MB,
maxsize=10MB,
filegrowth=10%
)
create table studentInfo
(
Sno varchar(10) not null,
Sname varchar(10) not null,
Ssex char(2) default '男',
Sdateofbirth datetime,
Sclass varchar(10) not null,
primary key(Sno)
)
insert into studentInfo(Sno,Sname,Ssex,Sdateofbirth,Sclass)
values('08763','张三','男','1995-10-16','软件1402'),
('08764','李四','女','1995-10-17','软件1401'),
('08765','王五','男','1955-10-18','软件1402');
select *
from studentInfo
where Sno='08764'
select *
from studentInfo
where Ssex='男'
delete
from studentInfo
where Sclass<>'软件1401'
on primary
(
name=StudentDataBase_DAT,
filename='F:\StudentDataBase.mdf',
size=5MB,
maxsize=15MB,
filegrowth=1MB
)
LOG on
(
name=StudentDataBase_LOG,
filename='F:\StudentDataBase.LOG',
size=5MB,
maxsize=10MB,
filegrowth=10%
)
create table studentInfo
(
Sno varchar(10) not null,
Sname varchar(10) not null,
Ssex char(2) default '男',
Sdateofbirth datetime,
Sclass varchar(10) not null,
primary key(Sno)
)
insert into studentInfo(Sno,Sname,Ssex,Sdateofbirth,Sclass)
values('08763','张三','男','1995-10-16','软件1402'),
('08764','李四','女','1995-10-17','软件1401'),
('08765','王五','男','1955-10-18','软件1402');
select *
from studentInfo
where Sno='08764'
select *
from studentInfo
where Ssex='男'
delete
from studentInfo
where Sclass<>'软件1401'
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询