-
Notifications
You must be signed in to change notification settings - Fork 0
/
member.sql
executable file
·82 lines (73 loc) · 1.88 KB
/
member.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
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
71
72
73
74
75
76
77
78
79
80
81
82
CREATE TABLE Organization
(
OrganizationID INT NOT NULL AUTO_INCREMENT,
OrganizationName VARCHAR(45),
OrganizationAddress VARCHAR(45),
MemberID INT,
PRIMARY KEY (OrganizationID),
CONSTRAINT FK_Org FOREIGN KEY (MemberID) REFERENCES Member
);
CREATE TABLE Member
( MemberID INT NOT NULL AUTO_INCREMENT,
MemberFname VARCHAR(45) NOT NULL,
MemberLname VARCHAR(45) NOT NULL,
MemberPhone VARCHAR(10),
MemberBday VARCHAR(45) NOT NULL,
MemberAddress VARCHAR(45),
MemberDate VARCHAR(45),
Memberspouse VARCHAR(45),
OrganizationName VARCHAR(45),
PRIMARY KEY (MemberID),
CONSTRAINT FK_Member FOREIGN KEY (OrganizationName) REFERENCES Organization
);
CREATE TABLE VolunteerOpportunities
(
VolOpprtID INT NOT NULL AUTO_INCREMENT,
VolOpprtDate DATE,
VolOpprtNumNeed INT,
VolOpprtDescription VARCHAR(200),
MemberID INT,
PRIMARY KEY (VolOpprtID),
CONSTRAINT FK_VolunteerOpportunities FOREIGN KEY (MemberID) REFERENCES Member
);
CREATE TABLE ChildinChildCare
(
ChildID INT NOT NULL AUTO_INCREMENT,
ChildName VARCHAR(45),
ChildBDay DATE,
PRIMARY KEY (ChildID)
);
--TeacherinChildcare ChildinChildcare ChildcareFamily Payment
CREATE TABLE TeacherinChildcare
(
TeacherID INT NOT NULL AUTO_INCREMENT,
TeacherNAME VARCHAR(45),
TeacherRoom VARCHAR(10),
PRIMARY KEY (TeacherID)
);
CREATE TABLE ChildinChildcare
(
ChildCID INT NOT NULL AUTO_INCREMENT,
ChildCName VARCHAR(45),
ChildCBDay DATE,
PRIMARY KEY (ChildCID)
);
CREATE TABLE ChildcareFamily
(
FamilyID INT NOT NULL AUTO_INCREMENT,
FamilyName VARCHAR(45),
FamilyPaymentAmt INT,
FamilyAddress VARCHAR(200),
FamilyPhone VARCHAR(20),
Spouse VARCHAR(45),
PRIMARY KEY (FamilyID)
);
CREATE TABLE Payment
(
PaymentID INT NOT NULL AUTO_INCREMENT,
PayAmt INT,
PayCheckNO VARCHAR(10),
PayChildcareNO VARCHAR(10),
PayDescription VARCHAR(200),
PRIMARY KEY (PaymentID)
);