Vous êtes sur la page 1sur 6

Ben Rydquist

David Zimbra
OMIS 105
Final Project
InSync
Description:
My proposed business, InSync, is going to develop and maintain a social networking
website. This website will stand apart from other social networking websites such as LinkedIn
because it will be exclusively for college students and fresh graduates. It will help current college
students find summer internships or jobs, and help new graduates find more long-term job
options. It will be a straightforward website which makes it easy to create and apply to career
opportunities.
The database will contain a super-type entity for user along with total specialization and
overlap. The user super-type will split into student and employer sub-type entities, with no
overlap between the two. The user entity will contain information about the user and show the
user’s type (student or employer). It will have the most relationships, including relationships
with images and documents, as well as messages. The student sub-type will have relationships
with the university, skills, and application entities, while the employer sub-type will have a
relationship with the job posting entity type. Job posting will have a relationship with
application, which will indirectly connect student and employer. They will also contain a
description that can be searched in a query to group similar jobs together easily. Messages will
be an associative entity with both relationships with user, showing that a message is sent between
two users. Messages will be store the contents of the message to allow analysis of trends and
feedback. Analysts will be able to pull important data out of anywhere in the database and use it
to help students and employers find the right jobs.
ER Model:

MESSAGES
Message Date
Message Content

IMAGE USER
Image ID User ID
Image Title User Name
Image Size Has User Password
User Type
Visit Type =
DOCUMENTS User Email
Has User Phone Number
Document ID
Document Name User Type =
Document File Type
DocumentSize D
S E

EMPLOYER
UNIVERSITY
STUDENT Employer Address
University ID Attends
Student Year Employer City
University Name
Student GPA EmployerState
University Address
University City
University State
Posts
Posesses Submits

JOB POSTING
SKILLS APPLICATION
Job ID
Skill ID Application ID Contains Job Name
Skill Name Application Submit Date
Job Description

SQL Table Creation Queries:


User:
CREATE TABLE User_T
(UserID int not null CHECK (UserID > 0),
UserName nvarchar(25) not null,
UserPassword nvarchar(25) not null,
UserEmail nvarchar(50),
UserPhoneNumber char(50),
UserType char(1) CHECK (UserType IN ('S', 'E')) not null,
UserFullName nvarchar(50),
CONSTRAINT User_PK PRIMARY KEY (UserID))

Images:
CREATE TABLE Images_T
(ImageID int not null CHECK (ImageID > 0),
UserID int not null CHECK (UserID > 0),
ImageTitle nvarchar(50),
ImageSize char(6),
CONSTRAINT Image_PK PRIMARY KEY (ImageID),
CONSTRAINT User_FK FOREIGN KEY (UserID)
REFERENCES User_T (UserID))

Documents:
CREATE TABLE Documents_T
(DocumentID int not null CHECK (DocumentID > 0),
UserID int not null CHECK (UserID > 0),
DocumentName nvarchar(50),
DocumentSize char(6),
DocumentFileType nvarchar(5),
CONSTRAINT Document_PK PRIMARY KEY (DocumentID),
CONSTRAINT User_FK2 FOREIGN KEY (UserID)
REFERENCES User_T (UserID))

UserStudent:
CREATE TABLE UserStudent_T
(SUserID int not null CHECK (SUserID > 0),
UniversityID int not null CHECK (UniversityID > 0),
SUserYear int CHECK (SUserYear > 0 and SUserYear < 5),
SUserGPA decimal(4,3),
CONSTRAINT SUser_PK PRIMARY KEY (SUserID),
CONSTRAINT UserStudent_FK FOREIGN KEY (SUserID)
REFERENCES User_T (UserID),
CONSTRAINT University_FK FOREIGN KEY (UniversityID)
REFERENCES University_T (UniversityID))

University:
CREATE TABLE University_T
(UniversityID int not null CHECK (UniversityID > 0),
UniversityName nvarchar(50) not null,
UniversityAddress nvarchar(50),
UniversityCity nvarchar(50),
UniversityState nvarchar(2),
CONSTRAINT University_PK PRIMARY KEY (UniversityID))

Skills:
CREATE TABLE Skills_T
(SkillID int not null CHECK (SkillID > 0),
SkillName nvarchar(50) not null,
CONSTRAINT Skill_PK PRIMARY KEY (SkillID))
UserStudentSkills:
CREATE TABLE UserStudentSkills_T
(SUserSkillID int not null CHECK (SUserSkillID > 0),
SUserID int not null CHECK (SUserID > 0),
SkillID int not null CHECK (SkillID > 0),
CONSTRAINT SUserSkill_PK PRIMARY KEY (SUserSkillID),
CONSTRAINT SUser_FK FOREIGN KEY (SUserID)
REFERENCES UserStudent_T (SUserID),
CONSTRAINT Skill_FK FOREIGN KEY (SkillID)
REFERENCES Skills_T (SkillID))

UserEmployer:
CREATE TABLE UserEmployer_T
(EUserID int not null CHECK (EUserID > 0),
EUserAddress nvarchar(50),
EUserCity nvarchar(50),
EUserState nvarchar(2),
CONSTRAINT EUser_PK PRIMARY KEY (EUserID),
CONSTRAINT UserEmployer_FK FOREIGN KEY (EUserID)
REFERENCES User_T (UserID))

JobPosting:
CREATE TABLE JobPosting_T
(JobID int not null CHECK (JobID > 0),
EUserID int not null CHECK (EUserID > 0),
JobName nvarchar(50),
JobDescription nvarchar(MAX),
CONSTRAINT Job_PK PRIMARY KEY (JobID),
CONSTRAINT EUser_FK FOREIGN KEY (EUserID)
REFERENCES UserEmployer_T (EUserID))

Application:
CREATE TABLE Application_T
(ApplicationID int not null CHECK (ApplicationID > 0),
JobID int not null CHECK (JobID > 0),
ApplicationSubmitDate datetime,
CONSTRAINT Application_PK PRIMARY KEY (ApplicationID),
CONSTRAINT Job_FK FOREIGN KEY (JobID)
REFERENCES JobPosting_T (JobID))

UserStudentApplication:
CREATE TABLE UserStudentApplication_T
(SUserApplicationID int not null CHECK (SUserApplicationID > 0),
SUserID int not null CHECK (SUserID > 0),
ApplicationID int not null CHECK (ApplicationID > 0),
CONSTRAINT SUserApplication_PK PRIMARY KEY (SUserApplicationID),
CONSTRAINT SUser_FK2 FOREIGN KEY (SUserID)
REFERENCES UserStudent_T (SUserID),
CONSTRAINT Application_FK FOREIGN KEY (ApplicationID)
REFERENCES Application_T (ApplicationID))

Message:
CREATE TABLE Message_T
(MessageID int not null CHECK (MessageID > 0),
UserID1 int not null CHECK (UserID1 > 0),
UserID2 int not null CHECK (UserID2 > 0),
MessageDate datetime,
MessageContent nvarchar(200),
CONSTRAINT Message_PK PRIMARY KEY (MessageID),
CONSTRAINT User_FK3 FOREIGN KEY (UserID1)
REFERENCES User_T (UserID),
CONSTRAINT User_FK4 FOREIGN KEY (UserID2)
REFERENCES User_T (UserID))

Views:
UserApplicationInfo:

create view applicationinfo as


select UserStudentApplication_T.SUserID,UserStudentApplication_T.ApplicationID,
JobPosting_T.JobID, JobName
from UserStudent_T, UserStudentApplication_T, Application_T, JobPosting_T
where UserStudent_T.SUserID = UserStudent_T.SUserID
and Application_T.ApplicationID = UserStudentApplication_T.ApplicationID
and Application_T.JobID = JobPosting_T.JobID
group by UserStudentApplication_T.SUserID,UserStudentApplication_T.ApplicationID,
JobPosting_T.JobID, JobName
with check option

This view shows which student users submitted applications to which job postings. This view
can allow employers to see which students are interesting in what job types, and can try get them
to apply to their similar jobs. Employers could also see if there are any trends in application
submissions from students and try to target those users.

UserMessages:
create view usermessages as
select Message_T.UserID1, User_T.UserFullName, Message_T.UserID2, MessageContent
from Message_T, User_T
where UserID1 = User_T.UserID
group by UserID1, UserID2,MessageContent, User_T.UserFullName
with check option
This view shows which user each message was sent by and which user each message was sent to.
It also displays the contents of the message and can be searched for keywords. This can help
InSync see user opinions, and can implement improvements if enough people talk about them.
They can also determine what is trending among users and let users know.

JobsApplied:
create view jobsapplied as
select JobPosting_T.JobID, JobName, UserEmployer_T.EUserID, Application_T.ApplicationID
from UserEmployer_T, Application_T, JobPosting_T
where UserEmployer_T.EUserID = JobPosting_T.EUserID
and Application_T.JobID = JobPosting_T.JobID
group by UserEmployer_T.EUserID,Application_T.ApplicationID, JobPosting_T.JobID, JobName
with check option

This view shows which employer users posted jobs that received applications. This can be used
by employers to determine if a certain job type is better at the current time. Employers would
notice any trends and be able to adjust their job postings accordingly.

Vous aimerez peut-être aussi