Access over 20 million homework & study documents

Database4

Content type
User Generated
Subject
MySQL
Type
Homework
Rating
Showing Page:
1/19
CSIS 325 Semester Project Phase II
Instructions
Phase II is performed in three steps.
Step 1: Table Creation
Create a new database and execute the code below in SQL Server’s query window to create the
database tables.
CREATE TABLE PhysicianSpecialties
(SpecialtyID integer,
SpecialtyName varchar(50),
CONSTRAINT PK_PhysicianSpecialties PRIMARY KEY (SpecialtyID))
go
CREATE TABLE ZipCodes
(ZipCode varchar(10),
City varchar(50),
State varchar(2),
CONSTRAINT PK_ZipCodes PRIMARY KEY (ZipCode))
go
CREATE TABLE PhysicianPractices
(PracticeID integer,
PracticeName varchar(50),
Address_Line1 varchar(50),
Address_Line2 varchar(50),
ZipCode varchar(10),
Phone varchar(14),
Fax varchar(14),
WebsiteURL varchar(50),
CONSTRAINT PK_PhysicianPractices PRIMARY KEY (PracticeID),
CONSTRAINT FK_PhysicianPractices_ZipCodes FOREIGN KEY (ZipCode) REFERENCES Zipcodes)
go
CREATE TABLE Physicians
(PhysicianID integer,
FirstName varchar(40),
LastName varchar(50),
PracticeID integer,
SpecialtyID integer,
Email varchar(50),
CONSTRAINT PK_Physicians PRIMARY KEY (PhysicianID),
CONSTRAINT FK_Physicians_Practices FOREIGN KEY (PracticeID) REFERENCES
PhysicianPractices,
CONSTRAINT FK_Physicians_PhysicianSpecialities FOREIGN KEY (SpecialtyID) REFERENCES
PhysicianSpecialties)

Sign up to view the full document!

lock_open Sign Up
Showing Page:
2/19
go
CREATE TABLE Patients
(PatientID integer,
FirstName varchar(50),
MiddleInitial varchar(1),
LastName varchar(50),
Address_Line1 varchar(50),
Address_Line2 varchar(50),
ZipCode varchar(10),
Phone_Home varchar(14),
Phone_Alternate varchar(14),
Email varchar(50),
CONSTRAINT PK_Patients PRIMARY KEY (PatientID))
go
CREATE TABLE Referrals
(ReferralID integer,
StartDate smalldatetime,
EndDate smalldatetime,
PatientID integer,
PhysicianID integer,
CONSTRAINT PK_Referrals PRIMARY KEY (ReferralID),
CONSTRAINT FK_Referrals_Patients FOREIGN KEY (PatientID) REFERENCES Patients,
CONSTRAINT FK_Referrals_Physicians FOREIGN KEY (PhysicianID) REFERENCES Physicians)
go
CREATE TABLE Services
(ServiceID integer,
ServiceName varchar(50),
CONSTRAINT PK_ServiceID PRIMARY KEY (ServiceID))
go
CREATE TABLE Frequencies
(FrequencyID integer,
Frequency varchar(30),
CONSTRAINT PK_Frequencies PRIMARY KEY (FrequencyID))
go
CREATE TABLE ReferralServices
(ReferralID integer,
ServiceID integer,
FrequencyID integer,
CONSTRAINT PK_ReferralServices PRIMARY KEY (ReferralID, ServiceID),
CONSTRAINT FK_ReferralServices_Referrals FOREIGN KEY (ReferralID) REFERENCES Referrals,
CONSTRAINT FK_ReferralServices_Services FOREIGN KEY (ServiceID) REFERENCES Services,
CONSTRAINT FK_ReferralServices_Frequencies FOREIGN KEY (FrequencyID) REFERENCES
Frequencies)
go
CREATE TABLE PaymentTypes
(PaymentTypeID integer,

Sign up to view the full document!

lock_open Sign Up
Showing Page:
3/19

Sign up to view the full document!

lock_open Sign Up
End of Preview - Want to read all 19 pages?
Access Now
Unformatted Attachment Preview
CSIS 325 Semester Project Phase II Instructions Phase II is performed in three steps. Step 1: Table Creation Create a new database and execute the code below in SQL Server’s query window to create the database tables. CREATE TABLE PhysicianSpecialties (SpecialtyID integer, SpecialtyName varchar(50), CONSTRAINT PK_PhysicianSpecialties PRIMARY KEY (SpecialtyID)) go CREATE TABLE ZipCodes (ZipCode varchar(10), City varchar(50), State varchar(2), CONSTRAINT PK_ZipCodes PRIMARY KEY (ZipCode)) go CREATE TABLE PhysicianPractices (PracticeID integer, PracticeName varchar(50), Address_Line1 varchar(50), Address_Line2 varchar(50), ZipCode varchar(10), Phone varchar(14), Fax varchar(14), WebsiteURL varchar(50), CONSTRAINT PK_PhysicianPractices PRIMARY KEY (PracticeID), CONSTRAINT FK_PhysicianPractices_ZipCodes FOREIGN KEY (ZipCode) REFERENCES Zipcodes) go CREATE TABLE Physicians (PhysicianID integer, FirstName varchar(40), LastName varchar(50), PracticeID integer, SpecialtyID integer, Email varchar(50), CONSTRAINT PK_Physicians PRIMARY KEY (PhysicianID), CONSTRAINT FK_Physicians_Practices FOREIGN KEY (PracticeID) REFERENCES PhysicianPractices, CONSTRAINT FK_Physicians_PhysicianSpecialities FOREIGN KEY (SpecialtyID) REFERENCES PhysicianSpecialties) go CREATE TABLE Patients (PatientID integer, FirstName varchar(50), MiddleInitial varchar(1), LastName varchar(50), Address_Line1 varchar(50), Address_Line2 varchar(50), ZipCode varchar(10), Phone_Home varchar(14), Phone_Alternate varc ...
Purchase document to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Anonymous
Just what I was looking for! Super helpful.

Studypool
4.7
Indeed
4.5
Sitejabber
4.4