5

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
USE master;
GO
IF db_id (N'Bank') IS NOT NULL
DROP DATABASE Bank;
go
CREATE DATABASE Bank
ON (NAME = Bank_dat,
FILENAME = 'C:\data\Bankdat.mdf',
SIZE = 10MB,
MAXSIZE = 50MB,
FILEGROWTH = 5MB)
LOG ON (NAME = Bank_log,
FILENAME = 'C:\data\Banklog.ldf',
SIZE = 5MB,
MAXSIZE = 25MB,
FILEGROWTH = 5MB);
GO
USE Bank;
GO
CREATE TABLE Human (idofperson int PRIMARY KEY,
firstname char(50),
secondname char(50),
dateofbirth datetime,
location char(150),
email char(25),
phone int);
GO
ALTER DATABASE Bank ADD FILEGROUP NewFG;
GO
ALTER DATABASE Bank ADD FILE (NAME = New_data_file,
FILENAME = 'C:\data\Newdatafile.ndf',
SIZE = 5MB,
MAXSIZE = 100MB,
FILEGROWTH = 5MB)
TO FILEGROUP NewFG;
GO
ALTER DATABASE Bank MODIFY FILEGROUP NewFG DEFAULT;
GO
ALTER DATABASE Bank MODIFY FILEGROUP [PRIMARY] DEFAULT;
GO
ALTER DATABASE Bank REMOVE FILE New_data_file;
GO
ALTER DATABASE Bank REMOVE FILEGROUP NewFG;
GO
CREATE TABLE Employee (idofperson int,
post char(50),
passnumber int,
experience int);
GO
CREATE SCHEMA SchemaBank;
GO
ALTER SCHEMA SchemaBank TRANSFER Employee;
GO
DROP TABLE SchemaBank.Employee;
DROP SCHEMA SchemaBank;
GO