1
-- ********** create database ********** --
-- ********** Begin ********** --
create database school
-- ********** End ********** --
go
use school
go
-- ********** create table ********** --
-- ********** Begin ********** --
create table teacher(
ID int not null,
Name varchar(20) not null,
sex char(2) not null,
Phone varchar(20) null
)
-- ********** End ********** --
go
SET NOCOUNT ON
-- ********** insert ********** --
-- ********** Begin ********** --
insert into teacher(ID,Name,sex)
values(1,'Lucy','F')
-- ********** End ********** --
go
2
-- ********** create database ********** --
-- ********** Begin ********** --
create database website
-- ********** End ********** --
go
use website
go
-- ********** create table ********** --
-- ********** Begin ********** --
create table shopping(
ID int IDENTITY(1,1) not null,
Name varchar(20) not null,
address varchar(30) not null
)
-- ********** End ********** --
go
SET NOCOUNT ON
insert into shopping (Name, address) values ('eBay', 'www.ebay.com')
go
SET NOCOUNT ON
-- ********** insert ********** --
-- ********** Begin ********** --
insert into shopping(Name,address)
values('amazon','www.amazon.com')
-- ********** End ********** --
go
SET NOCOUNT ON
-- ********** delete ********** --
-- ********** Begin ********** --
delete from shopping where Name='eBay';
-- ********** End ********** --
go
3
-- ********** create database ********** --
-- ********** Begin ********** --
create database Books
-- ********** End ********** --
go
use Books
go
-- ********** create table ********** --
-- ********** Begin ********** --
create table prices
(
ID int identity(1,1)not null,
Name varchar(20)not null,
price varchar(30)not null
)
-- ********** End ********** --
go
SET NOCOUNT ON
-- ********** insert ********** --
-- ********** Begin ********** --
insert into prices(Name,price)
values('Harry Potter','$128')
-- ********** End ********** --
go
SET NOCOUNT ON
insert into prices (Name, price) values ('Walden', '$5')
go
SET NOCOUNT ON
-- ********** update ********** --
-- ********** Begin ********** --
update prices
SET price='$6'
where ID='2'
-- ********** End ********** --
go
声明:著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。