-- 创建数据库 Library
use master
GO
IF exists (select* from sysdatabases where name='Library')
drop Database Library --删除数据库
create database Library
on(
name ='Library_data',
filename ='E:\作业\Library_data.mdf',
size=5MB,
maxsize=100mb,
filegrowth=15%
)
log on
(
name='Library_log',
filename ='E:\作业\Library_log.ldf',
size=1MB,
filegrowth=15%
)
-- 1. 创建表 学生信息表
use Library
if exists (select *from sysobjects where name='Book')
drop table Book
create table Book(
BID nvarchar(32) not null,
BName nvarchar(32) not null,
Author varchar(18) not null,
PubComp nvarchar(30) ,
use master
GO
IF exists (select* from sysdatabases where name='Library')
drop Database Library --删除数据库
create database Library
on(
name ='Library_data',
filename ='E:\作业\Library_data.mdf',
size=5MB,
maxsize=100mb,
filegrowth=15%
)
log on
(
name='Library_log',
filename ='E:\作业\Library_log.ldf',
size=1MB,
filegrowth=15%
)
-- 1. 创建表 学生信息表
use Library
if exists (select *from sysobjects where name='Book')
drop table Book
create table Book(
BID nvarchar(32) not null,
BName nvarchar(32) not null,
Author varchar(18) not null,
PubComp nvarchar(30) ,