forked from justinpatten/school-challenge-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CreateDB.sql
35 lines (28 loc) · 874 Bytes
/
CreateDB.sql
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
use master
go
if exists (select [name] from sys.databases where [name] = 'SchoolChallengeDB' )
drop database SchoolChallengeDB
go
create database SchoolChallengeDB
go
use SchoolChallengeDB
go
if exists (select [name] from sys.tables where [name] = 'Students' )
drop table Students
go
if exists (select [name] from sys.tables where [name] = 'Teachers' )
drop table Teachers
go
create table [dbo].[Students](
[Id] int identity primary key,
[StudentNumber] [varchar](100) not null,
[FirstName] [varchar](50) not null,
[LastName] [varchar](50) not null,
[HasScholarship] [bit] not null
)
create table [dbo].[Teachers](
[Id] int identity primary key,
[FirstName] [varchar](50) not null,
[LastName] [varchar](50) not null,
[NumberOfStudents] [int] null
)