Download as pdf or txt
Download as pdf or txt
You are on page 1of 74

EGE ÜNİVERSİTESİ

BİLGİSAYAR MÜHENDİSLİĞİ

DATABASE MANAGEMENT
FEBRUARY - 2022
PROJECT

LINKEDINMOODLE DATABASE SYSTEM

05170000076 - EMİN BERKE AYDIN


05170000054 – TALHA GÖKHANASLAN
05200000770 – MUHAMMED BARAN ÇİÇEK

02.02.2022
Introduction

The aim of this project is to design and implement a relational database for
LinkedinMoodle platform. The "LinkedinMoodle" database project is considered as a
combination of the applications of LinkedIn, the career platform, and Moodle, the
education platform. Users can share their professional career profiles and get courses,
mentors etc. The LİnkedinMoodle database design makes it possible for users to get
courses, mentor services and share them on their profiles like their other social and
professional career activities.

1. ANALYSIS

1-) Write a brief explanation using your own words (in English) about these applications in
terms of their scope.

LINKEDIN
LinkedIn: is a social networking site designed for professional use by employees, job
seekers and employers. At the same time, it is a platform to easily communicate with peer
groups and make friends easily. LinkedIn provides job postings that can be accessed
easily and in the most professional way and applications can be made. LinkedIn also
provides, sharing presentations, files, and many books, and to advertise the blogs written
in an effortless way. At the same time, it promises to easily reach people in its professional
networks by sharing people's talents, achievements, awards, and many other things with
the added CV section. The more people you add to your network on the site, the faster you
can catch opportunities and increase your chances by reaching more people. Thanks to all
these features, LinkedIn is in a rapidly growing network position. The most important
reason for its rapid growth is that it provides professionals around the world with the
opportunity to establish a real and effective communication network and network
development.
MOODLE
Moodle: It is a free, open source, object-oriented, dynamic distance education system.
Moodle is used by lecturers and students. Lecturers: They can open the courses they
teach in the Moodle system, and can announce the documents, projects and grades of the
students registered for the course. Students, on the other hand, can register for these
courses given by the lecturers, access the documents shared by the lecturers, and upload
their homework related to the course to the system. Moodle is widely used in education
systems as an easy and useful system in terms of providing faster access to information
and sharing.

2. Write an analysis report for each web application:

a. What is the aim of each application?

LinkedIn: LinkedIn is a site where users' career resumes are kept. Users can share their
talents, patents, courses, and projects they have attended, awards they have received,
exam results, languages they know, and organizations they have attended in their profiles.
They can create a detailed CV and present their work experience, education information,
licenses and certificates to employers and other users. In addition, it can offer the
opportunity to establish a real and effective communication network with companies and
people around the world, and to develop a network.

Moodle: Moodle is an educational platform that enables trainers, mentors, and students to
share knowledge.

LinkedinMoodle: LinkedinMoodle is a career and education platform that provides users


both features like Moodle and LinkedIn. Users can share their career’s details, socialize,
create their CV, roll courses, get service from mentors and share their knowledge.
b. What are the main entities of them?

LinkedinMoodle Entities: COURSE, COURSE_SECTION, PROJECT_INSTRUCTOR,


PROJECT_STUDENT, STUDENT, INSTRUCTOR, OTHER, PERSON, COMPANY,
SYSTEM_MEMBER, INTEREST, SKILL, POSITION, POSITION_HISTORY, JOB_OFFER,
SAVED_JOB, POST_COMMENT, POST, SOCIAL_EVENT, JOB_APPLY,
CURRENT_COURSE, FOLLOW, DIRECT_MESSAGE, JOIN, LOCATION, COMMENT_LIKE,
LIKE

c. What are the characteristics of each entity?

LinkedInMoodle

LinkedInMoodle can be imagined as an educational career platform that allows users to


both features of LinkedIn and Moodle. Therefore, users can login to system, get courses
from instructors, upload their projects, get mentee services from mentors, sections also
they get socialize, upload, and create their CVs’, send messages and comment to posts,
apply or offer jobs, attempt events and so on.

COMPANY: The information of the companies registered in the system is kept in the
COMPANY table. The attributes of this entity are: "Company_id" is company
specific company number, "Company_name" is company name, "Sector" is for
company's sector.
LOCATION: The location and location information of the companies registered in the
system is kept in the LOCATION table. The attributes of this entity are:
"Company_number" is the company-specific company number, "Country" is the
country where the company is located, "City" is the city where the company is located,
"Address" is the full address of the company, "Address_code" is the address code of the
company, "District " is for the district where the company is located, "Post_code" is for the
postal code where the company is located.

POSITION: The positions of the people added to the system in the companies are kept in
the POSITION table. Attributes of this entity are: “Position_code” is for specific code of the
position, “Title” is for position’s name, “Company_id” is for company’s code number.

POSITION_HISTORY: The previous positions of the people added to the request are kept
in the POSITION_HISTORY table. The attributes of this entity are: “Person_id” is for the
personal number of the employee, “Start_date” is for the start date of the job, “Finish_date”
is for the end date of the job, “Ph_code” is for the specific code of the past position, “Title”
is for the position name, “ps_code” is for the specific position of the position for the code.

FOLLOW: The people followed by the people in the system are kept in the FOLLOW
table. Attributes of this entity are: “Follower_number” is for follower user’s specific
number, “Followed_number” is for followed user’s specific number and “Follow_date” is
for following date.

JOB_APPLY: Job posting applications are kept in the JOB APPLICATION table. The
attributes of this entity are: "Jo_id" is for the job posting's unique code number, "Person_id"
is for the job applicant's unique application code number, "Application_date" is the time the
applicant applied for the job, and "Cv" is for the applicant's CV.

JOB_OFFER: Job postings added to the system and the properties of these postings are
kept in the JOB_OFFER table. The attributes of this entity are: "Offerpost_id" is for the job
posting specific code number, "Member_id" is for the job poster specific number,
"Shared_date" is for the job posting date, "End_date" is for the job posting date, "Sector" is
for which sector it is, "Type" is for job type (internship, full-time, part-time, remote).
DIRECT_MESSAGE: The messages of the people in the system are kept in the
DIRECT_MESSAGE table. The attributes of this entity are: "Code" is for the specific
message code number, "Sender_number" is for the code number of the person sending
the message, "Recipient_number" is for the code number of the person receiving the
message, "Content" is for the text. the content of the direct message, the “date” is for the
date the message was sent.

POST: The posts shared by the people in the system and the information of these posts
are kept in the POST table. The attributes of this entity are: "Post_id" for the post's unique
code number, "Person_id" for the person number of the person who posted the post,
"Total_like" for the total number of likes for the post, "Total_comment" for the number total
number of comments on the post, "Title " is for the type of post (image, text, video), "date"
is for the post's publication date, and "Shared_hour" is for the post's publication time.

POST_COMMENT: The comments made to the posts shared by people in the system are
kept in the POST_COMMENT table. The attributes of this entity are: "Comment_id" is for
the specific code number of the comment, "Person_id" is for the person number of the
commenter, "Content" is for the text content of the comment, "Comment_date" is for the
post's publication date.

SKILL: The abilities of the people in the system and the levels of these abilities are kept in
the SKILLS table. The attributes of this entity are: “Skill_name” is for the name of the skill,
“Person_id” is for the employee with some skill and “Field” is for the skill field of the
employee.

SAVED_JOB: Jobs saved by people in the system are kept in the SAVED_JOB table. The
attributes of this entity are: "Sj_id" is for the specific code number of the job posting,
"Person_id" is for the number of the employee who registered the job posting,
"Shared_date" is for the date it is posted, "Brief" is for the information of the job it has
registered, "Level" is for the level of the job it has registered, "Type " is for the type of job it
has registered, "Offerpost_id" is for the posting of the job it has registered.

INTEREST: In the system, the areas that people are interested in are kept in the
INTEREST table. The attributes of this entity are: "Person_id" is for employees who are
interested in some field, "Relevance_name" is for name of interest and "Field" is for
employee interest.
COURSE: Course general information of each course opened in the system is kept in the
COURSE table. The properties of this entity are: “Course_number” is for the specific code
number of the course, “Course_name” is for the name of the course, “Credit” is for the
credit number of the course.

COURSE_SECTION: Each course opened in the system also has sessions. Information
about these sessions is kept in the COURSE_SECTION table. The attributes of this entity
are as follows: "course_number" is the code number specific to the course section,
"Section_id" is the code number specific to the section, "Instructor_id" is the specific
number of the department lecturer, "Year" is the year the course is given, "Semester" is the
term for the course.

CURRENT_COURSE: The current course information of the students kept in the system is
kept in the CURRENT_COURSE table. Properties of this entity: "Student_id" is the student
number of the student who took the course, "Section_id" is the special code number of the
course, "Currentcourse_id" is the special current code.

INSTRUCTOR: General information of the instructors registered in the system is kept in


the instructor table. The qualifications of this entity are as follows: "Instructor_id"
instructor's special number, "Title" instructor title (Assoc., Professor, etc.), "University"
instructor's university, "Department" instructor's department, "Faculty" instructor for the
member's faculty.

STUDENT: Student contact information of students registered in the system is kept in the
STUDENT table. The attributes of this entity are: “Student_id” is for the student’s unique
number, “University” is for the student’s university, “Department” is for the student’s
department, “Faculty” is for the student’s faculty. , "Instructor_id" is for the mentor id of the
student.

PROJECT_INSTRUCTOR: The projects shared by the instructors in the system and the
information about the projects are kept in the PROJECT_INSTRUCTOR table. Properties
of this entity: “Name” is the project name, “Task_id” is the project specific code number,
“Instructor_id” is the instructor number of the project, “Start_date” is the project start date. ,
“End_date” is for project delivery date information, “Brief” is for content of the project.
PROJECT_STUDENT: The projects that students add to the system and information about
the projects are kept in the PROJECT_STUDENT table. "Student_id" is the school number
of the owner of the project, "task_id" is the project specific code number, "Upload_date" is
for the upload date of the project, "Document_info" is for the content of the uploaded
project, "ps_id" is the special code of the uploaded project.

SOCIAL_EVENT: Events added to the system and information about the events are kept
in the SOCIAL_EVENT table. "Se_id" is for the special code of the event, "Title" is for the
name of the event, "Start_date" is for the start date of the event, "End_date" is for the end
date of the event, "Member_id" is the code of the member who made the event.

SYSTEM_MEMBER: Members registered to the system and information about members


are kept in the SYSTEM_MEMBER table. "member_id" is the member specific code, "mail"
is for the member's mail, "Password" is for the password of the member, "type" is for
specifying the type of the member, "joined_date" is for the date the member is registered.

PERSON: Personnel registered in the system and information about personnel are kept in
the PERSON table. "person_id" is the special code of the person, "fname" is the person's
first name, "mname" is the person's middle name, "lname" is the person's last name,
"birth_date" is the person's date of birth, "sex" is the person's gender, "phone" is the
personun is for phone number, "type" is for what type of person the person is.

COMMENT_LIKE : Information about the likes posted to the comments in the system is
kept in the COMMENT_LIKE table. "comment_id" is the special code of the comment,
"person_id" is the special number of the person who liked the comment, "date" is the date
the person liked the comment.

POST_LIKE : Information about the likes sent to the posts in the system is kept in the
LIKE table. "post_id" is the special code of the post liked, "person_id" is the special
number of the person who liked the post, "date" is the date the post was liked.
JOIN : The information of who participated in the events in the system is kept in the JOIN
table. "se_id" is for the unique code of the event, "person_id" is the unique number of the
person participating in the event.

OTHER : The information of students or non-instructors in the system is kept in the


OTHER table. "other_id" is the personal code.

d. What relationships exists among the entities?

LinkedInMoodle Relationships

A LinkedInMoodle user can also be a student, instructor, or mentor in the system. Users
can work in more than one company. Users can be interested in some fields. Users apply
or offer a job, connect with other users, send messages to other users, comment to other
users’ posts and share posts. Users have skills. Users can organize some events. Users
can be participant of some events. Users can save job postings. Users can receive some
certificates.

COURSE – SECS- COURSE_SECTION: 1-N relationship

COURSE_SECTION - TEACHES – INSTRUCTOR: N:1 relationship

COURSE_SECTION – CURRENT_COURSE – STUDENT: N:N relationship

INSTRUCTOR – TEACHES – COURSE_SECTION: 1:N relationship

INSTRUCTOR – SHARE – PROJECT_INSTRUCTOR: 1:N relationship

INSTRUCTOR – MENTOR – STUDENT: 1:N relationship

STUDENT – MENTOR – INSTRUCTOR: N:1 relationship

STUDENT – CURRENT_COURSE – COURSE_SECTION: N:N relationship


STUDENT – UPLOAD – PROJECT_STUDENT : 1:N relationship

PROJECT_INSTRUCTOR – SHARE – INSTRUCTOR : N:1 relationship

PROJECT_INSTRUCTOR – HAS – PROJECT_STUDENT : 1:N relationship

PROJECT_STUDENT - UPLOAD – STUDENT: N:1 relationship

PROJECT_STUDENT – HAS – PROJECT_INSTRUCTOR: N:1 relationship

PERSON – FOLLOW – PERSON: N:N relationship

PERSON – DIRECT_MESSAGE – PERSON: N:N relationship

PERSON- JOB_APPLY – JOB_OFFER: N:N relationship

PERSON – SAVED – SAVED_JOB:1:N relationship

PERSON – MAKE – POST_COMMENT: 1:N relationship

PERSON – COMMENT_LIKE – POST_COMMENT: N:N relationship

PERSON – LIKE – POST: N:N relationship

PERSON – SHARE – POST :1:N relationship

PERSON – JOIN – SOCIAL_EVENT:N:N relationship

PERSON – HAS – POSITION_HISTORY: 1:N relationship

PERSON – HAS – INTEREST: 1:N relationship

PERSON – HAS – SKILL: 1:N relationship

JOB_OFFER – JOB_APPLY – PERSON : N:N relationship

JOB_OFFER – PART_OF – SAVED_JOB: 1:N relationship

JOB_OFFER – SHARE – SYSTEM_MEMBER: N:1 relationship

SAVED_JOB – PART_OF – JOB_OFFER : N:1 relationship


SAVED_JOB – SAVED – PERSON : N:1 relationship

SYSTEM_MEMBER – SHARE – JOB_OFFER: 1:N relationship

SYSTEM_MEMBER – CREATE – SOCIAL_EVENT: 1:N relationship

POST_COMMENT – MAKE – PERSON : N:1 relationship

POST_COMMENT - COMMENT_LIKE – PERSON: N:N relationship

POST_COMMENT – INCLUDE – POST: N:1 relationship

POST – INCLUDE – POST_COMMENT: 1:N relationship

POST – LIKE – PERSON : N:N relationship

POST – SHARE – PERSON : N:1 relationship

SOCIAL_EVENT – CREATE – SYSTEM_MEMBER : N:1 relationship

SOCIAL_EVENT – JOIN – PERSON : N:N relationship

POSITION_HISTORY – HAS – PERSON : N:1 relationship

POSITION_HISTORY – HAS – POSITION : N:1 relationship

POSITION - WORKS_FOR – COMPANY: 1:N relationship

POSITION – HAS – POSITION_HISTORY : 1:N relationship

INTEREST – HAS – PERSON: N:1 relationship

SKILL – HAS – PERSON : N:1 relationship

COMPANY – WORKS_FOR – POSITION: 1:N relationship

e. What are the constraints related to entities, their characteristics and


the relationships among them?

LinkedInMoodle Key Constraints

COURSE --> (course_number)


COURSE_SECTION --> (section_id)
PROJECT_INSTRUCTOR --> (task_id)
PROJECT_STUDENT--> (ps_id)
JOB_OFFER--> (offerpost_id)
SAVED_JOB--> (sj_id)
POST_COMMENT --> (comment_id)
POST --> (post_id)
SOCIAL_EVENT --> (se_id)
POSITION_HISTORY --> (ph_code)
POSITION--> (ps_code)
SYSTEM_MEMBER--> (member_id)
PERSON --> (person_id)
COMPANY --> (company_id)
INTEREST --> (person_id) and (interest_name)
SKILL --> (person_id) and (skill_name)
JOB_APPLY --> (person_id) and (jo_id)
FOLLOW --> (follower_id) and (followed_id)
DIRECT_MESSAGE --> (sender_id) and (recipient_id)
COMMENT_LIKE --> (comment_id) and (person_id)
LIKE --> (post_id) and (person_id)
JOIN --> (se_id) and (person_id)
LOCATION --> (company_id) and (address_code)
STUDENT --> (student_id)
OTHER --> (other_id)
INSTRUCTOR --> (instructor_id)
CURRENT_COURSE --> (student_id) and (section_id)
LinkedInMoodle Referential Integrity Constraints

Course_Section.course_number Course.course_number
Project_Student.task_id Project_Instructor.task_id
SAVED_JOB.offerpost_id JOB_OFFER.offerpost_id
POSITION_HISTORY.ps_code POSITION.ps_code
POST_COMMENT.post_id POST.post_id
PERSON.person_id MEMBER.member_id
COMPANY.company_id MEMBER.member_id
INTEREST.person_id PERSON.person_id
SKILL.person_id PERSON.person_id
SAVED_JOB.person_id PERSON.person_id
JOB_OFFER.member_id MEMBER.member_id
POST_COMMENT.person_id PERSON.person_id
POST.person_id PERSON.person_id
SOCIAL_EVENT.member_id MEMBER.member_id
POSITION_HISTORY.person_id PERSON.person_id
POSITION.company_id COMPANY.company_id
JOB_APPLY.person_id PERSON.person_id
JOB_APPLY.jo_id JOB_OFFER.jo_id
FOLLOW.follower_id PERSON.person_id
FOLLOW.followed_id PERSON.person_id
DIRECT_MESSAGE.Recipient_number PERSON.person_id
DIRECT_MESSAGE.sender_id PERSON.person_id
COMMENT_LIKE.comment_id POST_COMMENT.comment_id
COMMENT_LIKE.person_id PERSON.person_id
LIKE.post_id POST.post_id
LIKE.person_id PERSON.person_id
JOIN.se_id SOCIAL_EVENT.se_id

JOIN.person_id PERSON.person_id
LOCATION.company_id COMPANY.company_id
STUDENT.student_id PERSON.person_id
OTHER.other_id PERSON.person_id
INSTRUCTOR.instructor_id PERSON.person_id
COURSE_SECTION.instructor_id INSTRUCTOR.instructor_id
STUDENT.instructor_id INSTRCUTOR.instructor_id
PROJECT_INSTRUCTOR.instructor_id INSTRUCTOR.instructor_id
PROJECT_STUDENT.student_id STUDENT.student_id
CURRENT_COURSE.student_id STUDENT.student_id
CURRENT_COURSE.section_id COURSE_SECTION.section_id

3-Create an EER diagram for the virtually integrated version of the applications,
LinkedinMoodle. Try to use enhanced/extended features of ER modeling. Do not use any tool.
You can use any drawing application with the right legend for ER modeling. The output of
this step is just an EER diagram for LinkedinMoodle.
4-Convert EER diagram into relational model using the methodology that will be introduced
in your course.

Design – Logical Model

1.Iteration
1- Regular entity
Course(course_number, course_name, credit)
Course_Section(section_id,year,semester)
Project_Instructor(task_id,brief,start_date,end_date,project_name)
Project_Student(upload_date,document_info)
Job_Offer(offerpost_id, shared_date, end_date, title_ sector)
Saved_Job(sj_id, shared_date,end_date,brief, level_type)
Post_Comment(comment_id, date, content)
Post(post_id, post_type, title, post_date, total_comment, total_like)
Social_Event(se_id, title, start_date, end_date)
Position_History(ph_code, title, start_date, end_date)
Position(ps_code, title)

2-Weak entity
--
3- 1-1 relations
--
4- 1-N relations
Course_Section(----------, course_number) #Secs
Project_Student(----------, task_id) # Has
Saved_Job(----------, offerpost_id)# Part_of
Position_History(---------, ps_code)#Has
Post_Comment(----------,post_id)#Include
5- N-N relations
--
6- Multivalued attributes
--
7- N-ary relations
--
8- disjoint- overlapping
A- System_Member(member_id, mail, password, type, joined_date)
Person(person_id, fname, mname, lname, birth_date, sex,
phone,no_of_connections)
Company(company_id, name, sector)
9- Union
--

2.Iteration

1-
--
2- Interest(member_id, interest_name, interest_field)
Skill(member_id, skill_name, skill_field)
3-
--
4-
Saved_Job(---------, person_id)#Saved
Job_Offer(----------, member_id)#Share
Post_Comment(---------, person_id)#Make
Post(-----------, person_id)#Share
Social_Event(-----------,member_id)#Create
Position_History(----------, person_id)#Has
Position(-----------,company_id)#Work_For

5-
Job_Apply(person_id, jo_id, date, cv)
Follow(follower_id, followed_id, date)
Direct_Message(sender_id, recipient_id, content, date)
Comment_Like(comment_id, person_id, date)
Like(post_id, person_id, date)
Join(joinevent_id, se_id, person_id)

6-
Location(company_id, address_code, country, city, district, adres, post_code)
7-
--
8-
A-) Person(---------,type)
Student(student_id, department, faculty, university)
Other(other_id)
Instructor(instructor_id, title, department, faculty, university)
9-
--
3.Iteration
1-
--
2-
--
3-
--
4- Course_Section(---------,instructor_id)#Teaches
Student(---------, instructor_id)#Mentor
Project_Instructor(---------, instructor_id)#Share
Project_Student(---------, student_id) #Upload

5- Current_Course(currentcourse_id, student_id, section_id)

6-
--
7-
--
8-
--
9-
--
Course
Course_number Course_name credit

Course_section
Section_id Course_id Year semester

Project_Instructor
Task_id Brief Start_date End_date Project_name İnstructor_id

Project_student
Upload_date Document_info Task_id Student_id

Job_Offer
Offerpost_id Shared_date End_date Title Sector Member_id

Saved_job
Sj_id Shared_date End_date Brief Level Type Offerpost_id Person_id

Post_comment
Comment_id Date Comment_cont Person_id Post_id Comment_like
ent

Post
Post_id Post_type Title Date Total_com Total_like Person_id
ment

Social_Event
Se_id Title Sart_date End_date Member_id

Position_History
Ph_code Title Start_date End_date Ps_code Person_id Company_id

Position
Ps_code Title Company_id

System_member
Member_id Mail Password Type Joined_date

Person
Person_i Fname Mname Lname Birth_dat Sex Phone type connecti
d e ons

Company
Company_id Name sector No_of_employees
Interest
Person_id İnterest_name field

Skill
Company_id Skill_name Skill_field

Job_Apply
Person_id Jo_id Date cv

Follow
Follower_id Followed_id date

Direct_Message
Sender_id Receiver_id Content date Dm_id

C_LIKE
Comment_id Person_id date

LIKE
Post_id Person_id date Like_id

JOIN
Se_id Person_id Joinevent_id

Location
Company_id Adress_code Country City District Adres Post_code

Student
Student_id Department Faculty University İnstructor_id

Other
Other_id

Instructor
İnstructor_id Title Department Faculty university

Current_course
Student_id Section_id Currentcourse_id
5-Write down the appropriate SQL scripts (DDL statements) for creating the database and its
relational model. You can select any of the DBMS you wish.

CREATE TABLE IF NOT EXISTS LinkedinMoodleSchema.job_offer


(
offer_post_id int,
member_id int,
shared_date date,
end_date date,
job_title varchar(150),
job_sector varchar(150)
)

CREATE TABLE IF NOT EXISTS LinkedinMoodleSchema.join_event


(
social_event_id int,
person_id int
)

CREATE TABLE IF NOT EXISTS LinkedinMoodleSchema.other_user


(
other_user_id int
)

CREATE TABLE IF NOT EXISTS LinkedinMoodleSchema.person


(
person_id int,
fname varchar(100),
mname varchar(100),
lname varchar(100),
birth_date date,
sex varchar(50),
person_type varchar(20),
no_of_connections int,
phone_number varchar(14)
)

CREATE TABLE IF NOT EXISTS LinkedinMoodleSchema.position


(
position_code int,
position_title varchar(200),
company_id int
)

CREATE TABLE IF NOT EXISTS LinkedinMoodleSchema.position_history


(
person_id int,
position_id int,
company_id int,
position_title varchar(200),
start_date date,
end_date date
)
CREATE TABLE IF NOT EXISTS LinkedinMoodleSchema.post
(
post_id int,
person_id int,
post_type varchar(50),
post_title varchar(200),
post_date date,
total_comments int,
total_likes int
)

CREATE TABLE LinkedinMoodleSchema .company (


`company_id` int NOT NULL,
`company_name` varchar(100) NOT NULL,
`sector` varchar(100) NOT NULL,
`no_of_employees` int DEFAULT NULL,
)

CREATE TABLE `course` (


`course_id` int NOT NULL,
`course_name` varchar(150) NOT NULL,
`course_credit` int NOT NULL,
)
CREATE TABLE `course_section` (
`course_id` int NOT NULL,
`section_id` int NOT NULL,
`course_year` varchar(11) NOT NULL,
`course_semester` varchar(50) NOT NULL,
)

CREATE TABLE `company_location` (


`address_code` int NOT NULL,
`company_id` int NOT NULL,
`country` varchar(100) NOT NULL,
`city` varchar(100) NOT NULL,
`district` varchar(150) NOT NULL,
`address` varchar(500) NOT NULL,
`post_code` varchar(45) DEFAULT NULL,
)

CREATE TABLE `current_course` (


`student_number` int NOT NULL,
`section_id` int NOT NULL,
`current_course_id` int NOT NULL,
)

CREATE TABLE `direct_message` (


`sender_id` int NOT NULL,
`recipient_id` int NOT NULL,
`message_content` text NOT NULL,
`message_date` date NOT NULL,
`dm_id` int NOT NULL,
)
CREATE TABLE `follow` (
`follower_id` int NOT NULL,
`followed_id` int NOT NULL,
`followed_date` date DEFAULT NULL,
)

CREATE TABLE `instructor` (


`instructor_id` int NOT NULL,
`instructor_title` varchar(100) NOT NULL,
`department` varchar(150) NOT NULL,
`faculty` varchar(150) NOT NULL,
`university` varchar(150) NOT NULL,
)

CREATE TABLE `interest` (


`person_id` int NOT NULL,
`interest_name` varchar(100) NOT NULL,
`interest_field` varchar(100) NOT NULL,
)

CREATE TABLE IF NOT EXISTS LinkedinMoodleSchema.post_comment


(
comment_id int,
post_id int,
person_id int,
comment_content varchar(1000),
comment_date date
)
CREATE TABLE IF NOT EXISTS LinkedinMoodleSchema.post_like
(
person_id int,
post_id int,
liked_date date
)

CREATE TABLE IF NOT EXISTS LinkedinMoodleSchema.project_instructor


(
project_task_id int,
brief varchar(1000),
start_date date,
end_date date,
instructor_id int,
project_name varchar(100)
)

CREATE TABLE IF NOT EXISTS LinkedinMoodleSchema.project_student


(
project_id int,
student_number int,
upload_date date,
document_info boolean
)
CREATE TABLE IF NOT EXISTS LinkedinMoodleSchema.saved_job
(
saved_job_id int,
person_id int,
shared_date date,
end_date date,
brief varchar(1000),
job_level varchar(20),
job_type varchar(20)
)

CREATE TABLE IF NOT EXISTS LinkedinMoodleSchema.skill


(
person_id int,
skill_name varchar(100),
skill_field varchar(100)
)

CREATE TABLE IF NOT EXISTS LinkedinMoodleSchema.social_event


(
event_id int,
member_id int,
event_title varchar(100),
start_date date,
end_date date
)
CREATE TABLE `comment_like`
(
`comment_id` int NOT NULL,
`person_id` int NOT NULL,
`like_date` date DEFAULT NULL,
)

CREATE TABLE IF NOT EXISTS LinkedinMoodleSchema.student


(
student_id int,
mentor_id int,
department varchar(150),
faculty varchar(150),
university varchar(150)
)

CREATE TABLE IF NOT EXISTS LinkedinMoodleSchema.job_apply


{
job_offer_id int,
person_id int,
cv_code int,
apply_date date;
}
CREATE TABLE IF NOT EXISTS LinkedinMoodleSchema.system_member
(
member_id int,
member_mail varchar(100),
member_password varchar(100),
member_type varchar(50),
joined_date date
)

6-Populate the database you just created again using SQL script file loaded with sample
tuples. (The tables should have enough number of tuples for the SELECT statements to be
run accordingly.)

INSERTS

INSERT INTO person


(`person_id`,`fname`,`mname`,`lname`,`birth_date`,`sex`,`person_type`,`no_of_connections`,`
phone_number`)
VALUES
(1,"Leonard","Steel","Mills","1976-12-04","Male","Student",0,"09 86 59 72 53"),
(2,"Finn","Isaac","Mcgee","1988-11-01","Female","Student",0,"05 47 36 46 33"),
(3,"Keaton","Glenna","Mckay","1976-03-19","Male","Student",0,"01 65 96 88 45"),
(4,"Nelle","Matthew","Robertson","1970-01-07","Female","Student",0,"06 08 90 10 34"),
(5,"Judah","Eliana","Rios","1976-02-02","Male","Student",0,"07 47 22 87 31"),
(6,"Ava","Brett","Richardson","1997-12-17","Female","Student",0,"03 76 00 10 22"),
(7,"Leah","Walker","Washington","1994-07-22","Male","Student",0,"06 46 18 86 37"),
(8,"Alyssa","Lacey","Becker","1986-08-26","Female","Student",0,"05 33 47 52 89"),
(9,"Glenna","Hollee","Washington","1992-10-16","Male","Student",0,"02 63 50 16 18"),
(10,"Len","Ruth","Emerson","1998-11-05","Female","Student",0,"05 11 22 86 24"),
(11,"Emmanuel","Jason","George","1966-05-11","Male","Student",0,"07 73 63 37 86"),
(12,"Hilary","Lael","Burt","1993-06-07","Female","Student",0,"09 78 57 54 31"),
(13,"Gregory","Giselle","Tucker","1975-09-20","Male","Student",0,"07 47 31 43 31"),
(14,"Xyla","Rogan","Riddle","1997-04-16","Female","Student",0,"01 64 29 57 32"),
(15,"Kerry","Ainsley","Sharpe","1985-03-07","Male","Student",0,"02 89 01 24 76"),
(16,"Carlos","Dustin","Cameron","1993-08-19","Female","Student",0,"03 16 85 51 24"),
(17,"Hollee","Vance","George","1969-07-07","Male","Student",0,"08 89 94 63 94"),
(18,"Kaye","Susan","Mueller","1991-09-11","Female","Student",0,"03 27 42 23 26"),
(19,"Francesca","Barrett","Santos","1970-01-22","Male","Student",0,"08 47 47 24 19"),
(20,"Lesley","Lionel","Petty","1978-04-19","Female","Student",0,"06 76 77 17 72"),
(21,"Imogene","Alice","Townsend","1973-05-18","Male","Student",0,"02 72 74 00 08"),
(22,"Sydnee","Lysandra","Davis","1972-07-24","Female","Student",0,"06 28 28 43 85"),
(23,"Dalton","Benjamin","Franks","1968-10-17","Male","Student",0,"05 07 47 93 83"),
(24,"Kyla","Shana","Stewart","1988-11-29","Female","Instructor",0,"05 83 46 73 05"),
(25,"Mariam","Cherokee","Kirkland","1986-12-22","Male","Instructor",0,"08 45 56 89
63"),
(26,"Ian","Dorian","Ashley","1975-10-23","Female","Instructor",0,"04 89 80 13 17"),
(27,"Kennedy","Abbot","Mathis","1973-01-25","Male","Instructor",0,"08 17 01 53 86"),
(28,"Jonah","Fitzgerald","Rich","1982-05-30","Female","Instructor",0,"03 31 43 45 07"),
(29,"Katell","Geoffrey","Lowe","1987-06-03","Male","Other User",0,"06 42 36 55 45"),
(30,"Ori","Kieran","Zamora","1969-02-03","Female","Other User",0,"07 36 92 22 25");*/
INSERT INTO system_member
(`member_id`,`member_mail`,`member_password`,`member_type`,`joined_date`)
VALUES
(1,"erat.volutpat.nulla@icloud.com","a6ds45","Person","2018-12-26"),
(2,"nullam.nisl@hotmail.edu","ads7894","Person","2021-02-11"),
(3,"sed.est.nunc@hotmail.couk","kbmf45","Person","2021-05-01"),
(4,"nec.tempus@yahoo.couk","3ruewıfjds","Person","2018-12-26"),
(5,"adipiscing.lobortis@protonmail.edu","bm04rwe","Person","2018-11-06"),
(6,"vel@outlook.ca","owkenı2","Person","2018-12-26"),
(7,"non@google.org","sd78g9b","Person","2021-05-03"),
(8,"vivamus.nibh@protonmail.ca","skmv3","Person","2018-12-26"),
(9,"in.at.pede@aol.couk","soıfjke3","Person","2020-12-23"),
(10,"est.nunc@protonmail.ca","8fs74d95","Person","2018-12-26"),
(11,"metus@protonmail.com","651asd651","Person","2021-05-03"),
(12,"auctor.quis@yahoo.edu","asd48asd4","Person","2021-05-03"),
(13,"penatibus@protonmail.com","asdmlk12","Person","2018-12-26"),
(14,"ut.tincidunt@google.org","Aidldaslşd","Person","2020-12-04"),
(15,"dolor.nulla@google.couk","Elizabethasdkas","Person","2021-02-04"),
(16,"sit.amet.consectetuer@hotmail.couk","1345Dahlia","Person","2018-12-26"),
(17,"morbi@yahoo.net","435yla","Person","2019-03-17"),
(18,"malesuada@google.couk","122hea","Person","2019-03-17"),
(19,"libero.mauris@google.com","Owen123","Person","2019-03-17"),
(20,"lacinia.vitae.sodales@icloud.couk","45456","Person","2019-04-01"),
(21,"ligula.nullam.enim@hotmail.net","789465sad","Person","2019-04-01"),
(22,"sed.orci@yahoo.net","asd132","Person","2019-08-17"),
(23,"mauris.blandit@protonmail.couk","sdf234","Person","2019-08-17"),
(24,"pede.blandit@google.ca","sdf324","Person","2018-09-02"),
(25,"sed.sapien@google.net","45fhg","Person","2020-04-26"),
(26,"imperdiet.non@protonmail.org","xcv3452","Person","2019-04-01"),
(27,"lorem@protonmail.org","sdf324fds","Person","2021-03-04"),
(28,"ipsum.cursus.vestibulum@icloud.couk","cvb3254","Person","2018-02-24"),
(29,"libero.nec.ligula@hotmail.ca","sfd234fg","Person","2019-08-17"),
(30,"dolor.dolor@icloud.net","465465fds","Person","2020-05-18"),
(31,"purus@protonmail.com","ymj894","Company","2018-03-10"),
(32,"magna.ut@google.org","d56f4gg46fd5","Company","2019-09-22"),
(33,"nascetur.ridiculus.mus@yahoo.edu","456fsd65ds4f","Company","2020-10-21"),
(34,"sed.auctor@yahoo.org","1hmgjg6m","Company","2019-11-09"),
(35,"lobortis.quam@google.org","hg1vcfd","Company","2018-12-29"),
(36,"accumsan@protonmail.ca","789fdssfd","Company","2018-01-10"),
(37,"ultricies@google.com","165sdf","Company","2020-04-28"),
(38,"malesuada.vel@outlook.net","pnholg195","Company","2021-12-26"),
(39,"eu.odio@protonmail.edu","1ıhu3erjnkw","Company","2019-04-07"),
(40,"sapien.cursus@yahoo.org","ğgfb4ads","Company","2019-03-05");*/

INSERT INTO company(company_id, company_name, sector, no_of_employees) VALUES


(31,"Ac Limited","Software Development",0),
(32,"Consequat Institute","Energy",0),
(33,"Ut Ipsum Ac PC","Textile",0),
(34,"Enim Corp.","Embedded Systems",0),
(35,"Vitae Dolor PC","White Goods",0),
(36,"Massa Limited","Glass Producement",0),
(37,"Tristique Ac Eleifend LLP","Defence",0),
(38,"Non Institute","Iron Steel Endustry",0),
(39,"Bibendum Associates","Car & Truck",0),
(40,"Lorem Vitae Consulting","Airways",0);*/

INSERT INTO position_history(person_id, position_id, company_id, position_title,


start_date, end_date)
VALUES
(1, 1000, 31, "deneme", "2019-09-22", "2021-02-04");

insert into company_location (address_code, company_id, country, city, district, address,


post_code)
VALUES
(1, 37, 'France', 'Noisy-le-Grand', 'Declaration', '9 Ryan Park', '93164 CEDEX'),
(2, 40, 'Czech Republic', 'Rychvald', 'Huxley', '58582 International Court', '735 32'),
(3, 32, 'Netherlands', 'Kampen (Overijssel)', 'Kropf', '160 Texas Crossing', '8264'),
(4, 36, 'United States', 'West Palm Beach', 'Hayes', '942 Continental Plaza', '33405'),
(5, 35, 'Czech Republic', 'Loštice', 'Hayes', '90 Dakota Crossing', '789 83'),
(6, 35, 'Czech Republic', 'Světlá nad Sázavou', 'Merchant', '9351 Orin Hill', '582 91'),
(7, 39, 'Germany', 'Nürnberg', 'Birchwood', '29604 Dapin Junction', '90451'),
(8, 31, 'Czech Republic', 'Šardice', 'Cordelia', '45 Anthes Avenue', '696 13'),
(9, 39, 'United States', 'Saint Louis', 'Stuart', '9 David Pass', '63121'),
(10, 33, 'United States', 'Richmond', 'Emmet', '68 Leroy Parkway', '23203');
insert into course (course_id, course_name, course_credit)
VALUES
(240, 'Business Administration', 8),
(102, 'Sociology', 3),
(347, 'Accounting', 7),
(124, 'Finance Analysis', 2),
(142, 'Risk Analysis', 2),
(192, 'History of Economics', 5),
(298, 'Macroeconomics', 7),
(355, 'Microeconomics', 6),
(148, 'Consumer Behaviors', 6),
(244, 'Law of Economics', 2);

insert into course_section (course_id, section_id, instructor_id, course_year, course_semester)


VALUES
(240, 101, 24, '2021','Fall'),
(102, 102, 28, '2021','Spring'),
(347, 103, 27, '2021','Fall'),
(124, 104, 28, '2021','Spring')
(142, 105, 28, '2021','Fall'),
(192, 106, 25, '2021','Spring'),
(298, 107, 28, '2021','Fall'),
(355, 108, 27, '2021','Spring'),
(148, 109, 27, '2021','Fall'),
(244, 110, 28, '2021','Spring');
insert into current_course (current_course_id, student_number, section_id)
VALUES
(1, 1, 102)
(2, 2, 110),
(3, 3, 107),
(4, 4, 110),
(5, 5, 103),
(6, 6, 109)
(7, 7, 102),
(8, 8, 109),
(9, 9, 108),
(10, 10, 108),
(11, 11, 110),
(12, 12, 103),
(13, 13, 109),
(14, 14, 108),
(15, 15, 106)
(16, 16, 110),
(17, 17, 106),
(18, 18, 103),
(19, 19, 107),
(20, 20, 105)
(21, 21, 104),
(22, 22, 108),
(23, 23, 106);
insert into direct_message (sender_id, recipient_id, message_content, message_date, dm_id)
VALUES
(1, 9, 'pede posuere nonummy integer', '2021-07-03', 1)
(2, 4, 'in eleifend quam', '2021-10-26', 2),
(3, 9, 'leo odio', '2022-01-22', 3),
(4, 28, 'donec posuere metus', '2021-02-18', 4),
(5, 18, 'elementum nullam varius nulla facilisi', '2021-03-06', 5),
(6, 9, 'eu magna vulputate', '2021-09-10', 6),
(7, 4, 'pretium nisl ut', '2021-05-10', 7),
(8, 4, 'sodales scelerisque mauris sit amet', '2021-11-03', 8)
(9, 19, 'dictumst morbi', '2021-10-26', 9),
(10, 23, 'neque vestibulum eget vulputate ut', '2021-04-02', 10),
(11, 21, 'enim lorem ipsum dolor', '2021-12-05', 11),
(12, 13, 'id lobortis convallis tortor', '2022-01-01', 12),
(13, 20, 'lacus morbi quis tortor id', '2021-08-26', 13),
(14, 5, 'lobortis est phasellus sit amet', '2021-05-28', 14),
(15, 24, 'rhoncus aliquam lacus morbi', '2021-09-26', 15),
(16, 27, 'quam pharetra magna ac', '2021-04-25', 16),
(17, 30, 'dapibus dolor vel est donec', '2021-08-04', 17)
(18, 20, 'lobortis ligula sit amet eleifend', '2021-12-08', 18),
(19, 23, 'tristique est et tempus semper', '2021-11-13', 19),
(20, 19, 'volutpat sapien arcu sed', '2021-10-22', 20),
(21, 1, 'pulvinar lobortis est phasellus sit', '2021-07-06', 21),
(22, 14, 'nam congue risus semper porta', '2021-02-07', 22)
(23, 25, 'hac habitasse', '2022-01-01', 23),
(24, 17, 'fusce lacus', '2021-08-28', 24),
(25, 2, 'pellentesque eget nunc', '2021-04-25', 25),
(26, 2, 'magna at nunc', '2021-02-02', 26)
(27, 7, 'risus praesent', '2021-06-01', 27),
(28, 9, 'luctus rutrum nulla', '2021-07-24', 28),
(29, 28, 'nascetur ridiculus', '2022-01-05', 29),
(30, 4, 'mi pede', '2021-06-29', 30);

insert into social_event (event_id, organizator_member_id, event_title, start_date, end_date)


VALUES
(1, 31, 'Marketing', '2022-01-30', '2022-02-20'),
(2, 6, 'Sales', '2022-01-30', '2022-02-20'),
(3, 33, 'Services', '2022-01-30', '2022-02-20'),
(4, 26, 'Training', '2022-01-30', '2022-02-20'),
(5, 1, 'Support', '2022-01-30', '2022-02-20'),
(6, 10, 'Legal', '2022-01-30', '2022-02-20'),
(7, 4, 'Product Management', '2022-01-30', '2022-02-20'),
(8, 37, 'Sales', '2022-01-30', '2022-02-20'),
(9, 25, 'Research and Development', '2022-01-30', '2022-02-20'),
(10, 16, 'Support', '2022-01-30', '2022-02-20'),
(11, 25, 'Accounting', '2022-01-30', '2022-02-20'),
(12, 18, 'Support', '2022-01-30', '2022-02-20'),
(13, 9, 'Marketing', '2022-01-30', '2022-02-20'),
(14, 18, 'Product Management', '2022-01-30', '2022-02-20'),
(15, 37, 'Accounting', '2022-01-30', '2022-02-20'),
(16, 36, 'Business Development', '2022-01-30', '2022-02-20'),
(17, 5, 'Human Resources', '2022-01-30', '2022-02-20'),
(18, 36, 'Business Development', '2022-01-30', '2022-02-20'),
(19, 15, 'Accounting', '2022-01-30', '2022-02-20'),
(20, 22, 'Support', '2022-01-30', '2022-02-20'),
(21, 14, 'Services', '2022-01-30', '2022-02-20'),
(22, 23, 'Human Resources', '2022-01-30', '2022-02-20'),
(23, 7, 'Product Management', '2022-01-30', '2022-02-20')
(24, 19, 'Legal', '2022-01-30', '2022-02-20'),
(25, 40, 'Research and Development', '2022-01-30', '2022-02-20'),
(26, 7, 'Human Resources', '2022-01-30', '2022-02-20'),
(27, 27, 'Research and Development', '2022-01-30', '2022-02-20'),
(28, 21, 'Human Resources', '2022-01-30', '2022-02-20'),
(29, 25, 'Research and Development', '2022-01-30', '2022-02-20'),
(30, 29, 'Business Development', '2022-01-30', '2022-02-20');

insert into join_event (social_event_id, person_id, join_event_id)


VALUES
(20, 16, 1),
(9, 1, 2),
(15, 10, 3),
(29, 17, 4),
(15, 3, 5)
(4, 3, 6),
(20, 3, 7),
(8, 16, 8),
(23, 30, 9),
(16, 9, 10),
(18, 24, 11),
(5, 20, 12),
(3, 17, 13)
(2, 16, 14),
(19, 13, 15),
(14, 9, 16),
(16, 24, 17),
(30, 11, 18),
(8, 5, 19),
(17, 5, 20),
(3, 2, 21),
(3, 24, 22),
(13, 29, 23),
(2, 6, 24),
(15, 5, 25),
(16, 9, 26),
(24, 10, 27),
(20, 28, 28),
(19, 4, 29),
(22, 13, 30),
(21, 28, 31),
(6, 3, 32),
(3, 12, 33),
(7, 1, 34),
(6, 5, 35),
(5, 13, 36),
(26, 22, 37),
(17, 25, 38),
(28, 29, 39),
(19, 6, 40),
(2, 22, 41),
(22, 7, 42),
(23, 4, 43),
(6, 9, 44),
(1, 6, 45),
(11, 12, 46),
(28, 25, 47),
(25, 20, 48),
(14, 20, 49),
(24, 27, 50),
(9, 3, 51),
(5, 18, 52),
(12, 27, 53),
(6, 5, 54),
(7, 3, 55),
(20, 24, 56),
(2, 5, 57),
(21, 30, 58),
(6, 4, 59),
(8, 21, 60);

insert into follow (follower_id, followed_id, followed_date)


VALUES
(2, 5, '2020-05-13'),
(23, 17, '2020-07-04'),
(29, 29, '2020-12-25'),
(9, 17, '2018-09-14'),
(2, 25, '2021-04-25'),
(7, 19, '2019-11-10'),
(25, 21, '2018-02-17'),
(22, 18, '2019-11-23'),
(15, 26, '2019-05-26'),
(24, 19, '2019-07-14'),
(9, 15, '2018-07-22'),
(17, 14, '2021-11-20'),
(29, 25, '2018-12-18'),
(21, 19, '2019-02-26'),
(9, 18, '2020-03-30'),
(10, 8, '2020-08-07'),
(15, 13, '2019-08-10'),
(15, 17, '2019-08-11'),
(11, 15, '2021-10-19'),
(18, 21, '2021-06-25'),
(11, 25, '2020-02-27'),
(25, 19, '2020-01-22'),
(16, 20, '2018-02-14'),
(15, 23, '2018-08-02'),
(30, 4, '2019-06-15'),
(5, 20, '2020-02-05'),
(28, 2, '2020-08-26'),
(8, 2, '2019-07-30'),
(1, 21, '2020-02-17'),
(6, 21, '2019-01-22'),
(16, 26, '2019-02-10'),
(6, 30, '2021-01-05'),
(1, 20, '2021-12-29'),
(11, 19, '2019-05-13'),
(10, 19, '2019-05-27'),
(11, 12, '2018-06-02'),
(18, 19, '2019-02-19'),
(8, 15, '2020-02-08'),
(22, 6, '2019-09-07'),
(25, 6, '2020-08-10'),
(12, 20, '2019-12-20'),
(2, 30, '2018-03-07'),
(13, 15, '2021-11-09'),
(28, 29, '2019-07-09'),
(2, 12, '2018-07-21'),
(21, 9, '2020-12-22'),
(7, 16, '2021-10-14'),
(29, 30, '2019-01-01'),
(6, 5, '2021-02-28'),
(20, 3, '2021-04-07');

insert into instructor (instructor_id, instructor_title, department, faculty, university)


VALUES
(24, 'Dr', 'Department of Business', 'Faculty of Economics', 'Harvard University'),
(25, 'Assist Dr', 'Department of Economics', 'Faculty of Economics', 'Stanford University'),
(26, 'Prof', 'Department of Business', 'Faculty of Economics', 'Cambridge University'),
(27, 'Researcher', 'Department of International Relations', 'Faculty of Economics', 'University
of Amsterdam'),
(28, 'Dr', 'Department of Economics', 'Faculty of Economics', 'Ege University');

insert into interest (person_id, interest_name, interest_field)


VALUES
(5, 'Gypsum', 'Gypsum'),
(15, 'Office Equipment', 'Equipments'),
(3, 'DOT Regulations', 'Computer Science'),
(21, 'XSLT', 'Grocery'),
(19, 'Musical Theatre', 'Theatre'),
(28, 'Logic Design', 'Electronics'),
(7, 'Events Coordination', 'Management'),
(17, 'Psychedelic Rock', 'Music'),
(19, 'Aquariums', 'Fishery'),
(20, 'Tk', 'Shoes'),
(22, 'IACUC', 'Baby'),
(7, 'Psychosocial', 'Psychology'),
(19, 'Diamonds', 'Jewelry'),
(18, 'BBx', 'Garden'),
(15, 'Investments', 'Finance'),
(3, 'Electric Cars', 'Automotive'),
(24, 'League of Legends', 'Games'),
(3, 'Creative Make-up', 'Beauty')
(11, 'TKI', 'Automotive'),
(3, 'Tarkovski', 'Movies'),
(17, 'Izotope RX', 'Chemistry'),
(14, 'Clinical Supervision', 'Medicine'),
(12, 'Nutritions', 'Health'),
(2, 'Working Capital Management', 'Economics'),
(21, 'Basketball', 'Sports'),
(23, 'Nike Air', 'Shoes'),
(29, 'Avid Media Composer', 'Music'),
(3, 'Early Intervention', 'History'),
(20, 'XCAL', 'Outdoors'),
(2, 'HR Software', 'Software Development'),
(14, 'Ernest Hemingway Books', 'American Literature'),
(5, 'BCLS', 'Baby'),
(18, 'Flexo', 'Grocery'),
(14, 'IASO', 'Jewelry'),
(29, 'Crystal Xcelsius 2008', 'Toys'),
(13, 'The Witcher Video Game', 'Games'),
(1, 'WAN', 'Beauty'),
(11, 'Gutters', 'Baby'),
(13, 'Tax Accounting', 'Accounting'),
(3, 'Citrix XenDesktop', 'Computers'),
(1, 'Capacity Building', 'Civil Engineering'),
(14, 'Alternative Music', 'Music'),
(1, 'Punk Music', 'Music'),
(27, 'Hats', 'Clothing'),
(27, 'Kyphoplasty', 'Electronics'),
(3, 'DCF', 'Computers'),
(12, 'GPS Devices', 'Electronics'),
(7, 'IoT', 'Electronics'),
(21, 'Occupational Rehabilitation', 'Health'),
(10, 'Start-ups', 'Entrepreneurship'),
(28, 'Yasar Kemal Books', 'Turkish Literature'),
(5, 'McKesson STAR', 'Toys'),
(24, 'Puma XC', 'Shoes'),
(16, 'Urban Design', 'Urban Engineering'),
(12, 'PDF Creators', 'Software Development'),
(25, 'Classical Music', 'Music')
(26, 'Science&Fiction Movies', 'Movies'),
(11, 'IBM AIX', 'Computers'),
(7, 'PTCRB', 'Industry'),
(14, 'Data Center', 'Data Engineering');
insert into skill (person_id, skill_name, skill_field)
VALUES
(2, 'SFDC', 'Business'),
(13, 'ICD-9-CM', 'Electronics'),
(18, 'Laboratory Skills', 'Chemisty'),
(10, 'CDISC', 'Electronics'),
(17, 'Guitar', 'Music'),
(8, 'VSX', 'Outdoors'),
(23, 'Animal Behavior', 'Zoology'),
(2, 'Oracle DB', 'Software Development'),
(19, 'Eze Castle', 'Sociology'),
(10, 'White Papers', 'Economics'),
(3, 'Production Efficiency', 'Product Management'),
(8, 'IDS', 'Endustrial Engineering'),
(7, 'Zend Certification', 'Human Resources'),
(29, 'Functional Verification', 'Software Development'),
(23, 'Union Avoidance', 'Trade'),
(29, 'Golden Cutting', 'Jewelry'),
(26, 'FCS', 'First Aid'),
(7, 'ATP', 'Botanics'),
(16, 'Value Stream Mapping', 'Software Development'),
(1, 'HNI', 'Mechanical Engineering'),
(23, 'Lustre', 'Toys'),
(13, 'Job Evaluation', 'Business Analysis'),
(19, 'WSH', 'Electronics'),
(27, 'Public Statistics', 'Statistics'),
(10, 'Physical Oceanography', 'Oceanography'),
(25, 'wxWidgets', 'Graphic Design'),
(12, 'Aluminum Production', 'Industry'),
(17, 'Theology', 'Philosophy'),
(15, 'Oracle VM', 'Software Development'),
(29, 'WWAN', 'Networks');

insert into job_apply (job_offer_id, person_id, cv_code, apply_date)


VALUES
(1, 28, 275, '2022-01-21'),
(2, 18, 745, '2022-01-09'),
(3, 13, 427, '2022-01-12'),
(4, 25, 210, '2022-01-04')
(5, 27, 514, '2022-01-20'),
(6, 18, 493, '2022-01-07'),
(7, 4, 496, '2022-01-26'),
(8, 20, 581, '2022-01-29'),
(9, 2, 115, '2022-01-05'),
(10, 7, 317, '2022-01-12'),
(11, 17, 813, '2022-01-03'),
(12, 6, 204, '2022-01-03'),
(13, 7, 463, '2022-01-21'),
(14, 2, 964, '2022-01-25'),
(15, 26, 827, '2022-01-14'),
(16, 25, 589, '2022-01-29'),
(17, 15, 180, '2022-01-17'),
(18, 29, 182, '2022-01-15'),
(19, 12, 936, '2022-01-08'),
(20, 5, 187, '2022-01-24'),
(21, 23, 852, '2022-01-04'),
(22, 18, 606, '2022-01-21'),
(23, 9, 923, '2022-01-17'),
(24, 17, 924, '2022-01-13'),
(25, 11, 562, '2022-01-07'),
(26, 25, 234, '2022-01-06'),
(27, 21, 419, '2022-01-10'),
(28, 16, 606, '2022-01-05')
(29, 10, 996, '2022-01-14'),
(30, 12, 405, '2022-01-05');

insert into job_offer (offer_post_id, member_id, shared_date, end_date, job_title, job_sector)


VALUES
(1, 29, '2022-01-30', '2022-02-20', 'Business Development', 'Accounting'),
(2, 16, '2022-01-30', '2022-02-20', 'Training', 'Marketing'),
(3, 31, '2022-01-30', '2022-02-20', 'Services', 'Sales'),
(4, 14, '2022-01-30', '2022-02-20', 'Support', 'Business Development'),
(5, 26, '2022-01-30', '2022-02-20', 'Product Management', 'Training'),
(6, 5, '2022-01-30', '2022-02-20', 'Legal', 'Marketing'),
(7, 28, '2022-01-30', '2022-02-20', 'Human Resources', 'Engineering'),
(8, 25, '2022-01-30', '2022-02-20', 'Marketing', 'Accounting'),
(9, 10, '2022-01-30', '2022-02-20', 'Research and Development', 'Research and Development'),
(10, 29, '2022-01-30', '2022-02-20', 'Services', 'Services'),
(11, 17, '2022-01-30', '2022-02-20', 'Sales', 'Support'),
(12, 12, '2022-01-30', '2022-02-20', 'Legal', 'Sales'),
(13, 40, '2022-01-30', '2022-02-20', 'Human Resources', 'Business Development'),
(14, 39, '2022-01-30', '2022-02-20', 'Services', 'Legal'),
(15, 5, '2022-01-30', '2022-02-20', 'Support', 'Engineering'),
(16, 7, '2022-01-30', '2022-02-20', 'Engineering', 'Business Development'),
(17, 25, '2022-01-30', '2022-02-20', 'Research and Development', 'Support'),
(18, 21, '2022-01-30', '2022-02-20', 'Engineering', 'Human Resources'),
(19, 37, '2022-01-30', '2022-02-20', 'Sales', 'Sales'),
(20, 11, '2022-01-30', '2022-02-20', 'Business Development', 'Support'),
(21, 27, '2022-01-30', '2022-02-20', 'Legal', 'Services'),
(22, 32, '2022-01-30', '2022-02-20', 'Training', 'Accounting'),
(23, 34, '2022-01-30', '2022-02-20', 'Accounting', 'Engineering'),
(24, 4, '2022-01-30', '2022-02-20', 'Sales', 'Services'),
(25, 8, '2022-01-30', '2022-02-20', 'Engineering', 'Sales'),
(26, 20, '2022-01-30', '2022-02-20', 'Business Development', 'Services'),
(27, 15, '2022-01-30', '2022-02-20', 'Business Development', 'Marketing'),
(28, 12, '2022-01-30', '2022-02-20', 'Business Development', 'Accounting'),
(29, 30, '2022-01-30', '2022-02-20', 'Training', 'Research and Development'),
(30, 4, '2022-01-30', '2022-02-20', 'Sales', 'Services');

insert into other_user (other_user_id)


values(29),(30);
insert into position (position_code, position_title, company_id)
VALUES
(1, 'Biostatistician II', 36),
(2, 'Clinical Specialist', 37),
(3, 'Technical Writer', 40),
(4, 'Compensation Analyst', 33)
(5, 'Mechanical Systems Engineer', 37),
(6, 'Structural Engineer', 34),
(7, 'Safety Technician IV', 38),
(8, 'Safety Technician II', 33),
(9, 'Paralegal', 31),
(10, 'Tax Accountant', 34),
(11, 'Help Desk Technician', 33),
(12, 'Help Desk Technician', 38),
(13, 'Paralegal', 39),
(14, 'Administrative Officer', 35),
(15, 'Human Resources Manager', 32)
(16, 'Payment Adjustment Coordinator', 35),
(17, 'Food Chemist', 40),
(18, 'Dental Hygienist', 35),
(19, 'Actuary', 35),
(20, 'Business Systems Development Analyst', 40);
insert into position_history (person_id, position_id, company_id, position_title, start_date,
end_date, p_history_id)
VALUES
(27, 1, 37, 'Data Coordiator', '2017-07-10', '2021-02-07', 1),
(27, 2, 31, 'Civil Engineer', '2017-10-26', '2019-09-19', 2),
(27, 3, 36, 'Data Coordiator', '2017-08-16', '2021-07-27', 3),
(6, 4, 40, 'Graphic Designer', '2017-05-15', '2018-11-29', 4)
(10, 5, 39, 'Social Worker', '2017-03-01', '2020-06-09', 5),
(26, 6, 38, 'VP Accounting', '2017-04-26', '2021-11-27', 6),
(23, 7, 32, 'Social Worker', '2018-01-14', '2021-03-13', 7),
(5, 8, 34, 'Financial Analyst', '2017-03-20', '2018-06-04', 8),
(26, 9, 32, 'Nurse Practicioner', '2017-08-20', '2019-01-07', 9),
(23, 10, 38, 'Cost Accountant', '2017-09-26', '2021-05-28', 10),
(27, 11, 35, 'Clinical Specialist', '2017-11-28', '2019-02-13', 11),
(1, 12, 33, 'Account Representative I', '2017-11-10', '2018-09-23', 12),
(12, 13, 40, 'Speech Pathologist', '2017-07-03', '2020-05-30', 13),
(26, 14, 39, 'Tax Accountant', '2017-12-15', '2020-12-22', 14),
(25, 15, 39, 'Software Consultant', '2017-02-26', '2019-10-29', 15),
(30, 16, 37, 'Assistant Professor', '2018-01-21', '2018-05-24', 16),
(24, 17, 39, 'Developer II', '2017-06-01', '2021-12-05', 17),
(24, 18, 34, 'Accountant IV', '2017-11-06', '2021-11-23', 18),
(22, 19, 37, 'Clinical Specialist', '2018-01-24', '2021-10-21', 19),
(17, 20, 34, 'Environmental Tech', '2017-08-07', '2019-09-13', 20);
insert into post (post_id, person_id, post_type, post_title, post_date, total_comments,
total_likes)
VALUES
(1, 3, 'Text', 'diam in magna bibendum', '2021-10-10', 0, 0),
(2, 27, 'Text', 'vivamus vestibulum sagittis sapien', '2019-08-14', 0, 0),
(3, 3, 'Text', 'sed vestibulum', '2018-03-23', 0, 0),
(4, 28, 'Text', 'vestibulum ante', '2018-06-07', 0, 0),
(5, 10, 'Video', 'amet nulla quisque arcu', '2020-07-27', 0, 0),
(6, 27, 'Image', 'libero nullam sit amet', '2019-12-23', 0, 0),
(7, 13, 'Video', 'nulla justo aliquam quis', '2020-12-16', 0, 0),
(8, 27, 'Text', 'elit sodales', '2020-06-12', 0, 0),
(9, 5, 'Video', 'egestas metus', '2020-07-28', 0, 0),
(10, 4, 'Text', 'nibh fusce lacus purus', '2018-03-27', 0, 0),
(11, 28, 'Image', 'magna ac consequat', '2019-07-09', 0, 0),
(12, 28, 'Text', 'quis odio', '2018-10-17', 0, 0),
(13, 7, 'Video', 'curabitur gravida nisi', '2018-06-10', 0, 0)
(14, 8, 'Text', 'id', '2021-12-05', 0, 0),
(15, 7, 'Image', 'diam in', '2021-11-30', 0, 0),
(16, 28, 'Video', 'justo sollicitudin ut suscipit', '2019-08-15', 0, 0),
(17, 26, 'Text', 'luctus', '2021-02-12', 0, 0),
(18, 15, 'Video', 'aliquam erat volutpat', '2020-04-11', 0, 0),
(19, 21, 'Image', 'eget semper', '2020-12-13', 0, 0),
(20, 6, 'Image', 'in', '2021-02-08', 0, 0);
insert into post_comment (comment_id, post_id, person_id, comment_content,
comment_date, comment_likes)
VALUES
(1, 7, 24, 'lacus morbi', '2021-02-01', 0),
(2, 1, 11, 'malesuada in imperdiet', '2020-01-03', 0),
(3, 13, 7, 'odio elementum', '2020-01-27', 0)
(4, 14, 14, 'lacus curabitur at', '2019-01-08', 0),
(5, 15, 17, 'in tempor', '2018-08-15', 0),
(6, 14, 21, 'rutrum nulla tellus', '2019-10-14', 0),
(7, 6, 22, 'vestibulum', '2018-08-01', 0),
(8, 1, 15, 'etiam pretium', '2019-06-20', 0),
(9, 1, 28, 'tellus', '2019-06-03', 0),
(10, 18, 14, 'arcu sed augue', '2020-07-01', 0),
(11, 17, 1, 'ut mauris eget', '2018-04-23', 0),
(12, 20, 1, 'in', '2020-03-26', 0),
(13, 4, 23, 'iaculis', '2018-04-05', 0),
(14, 18, 9, 'morbi non lectus', '2021-04-23', 0),
(15, 4, 21, 'eu sapien cursus vestibulum', '2019-10-18', 0),
(16, 16, 1, 'donec semper sapien a', '2019-09-28', 0),
(17, 14, 17, 'potenti', '2018-04-02', 0),
(18, 19, 23, 'vestibulum ante', '2020-11-12', 0),
(19, 17, 24, 'lacinia', '2019-08-09', 0),
(20, 6, 19, 'eu nibh quisque', '2019-02-25', 0),
(21, 4, 16, 'varius nulla facilisi cras', '2021-11-25', 0),
(22, 11, 3, 'sapien', '2020-05-15', 0),
(23, 20, 28, 'vestibulum ante', '2021-04-30', 0),
(24, 3, 18, 'integer pede', '2018-04-28', 0),
(25, 4, 2, 'gravida nisi', '2019-03-18', 0),
(26, 1, 19, 'vulputate', '2019-08-15', 0),
(27, 7, 4, 'ante ipsum primis', '2020-10-12', 0),
(28, 11, 12, 'interdum mauris ullamcorper', '2021-05-03', 0),
(29, 6, 4, 'leo odio condimentum', '2020-12-06', 0),
(30, 13, 12, 'eu orci mauris lacinia', '2020-11-23', 0),
(31, 13, 23, 'adipiscing molestie', '2020-10-29', 0),
(32, 19, 12, 'elit proin risus', '2020-04-11', 0),
(33, 14, 22, 'venenatis lacinia aenean sit', '2018-10-21', 0),
(34, 8, 29, 'elit proin', '2018-11-16', 0),
(35, 11, 9, 'sagittis sapien cum', '2020-09-13', 0),
(36, 12, 9, 'tincidunt lacus at velit', '2018-03-24', 0),
(37, 17, 7, 'nisl venenatis lacinia', '2019-11-09', 0),
(38, 15, 28, 'in sapien iaculis', '2018-05-06', 0),
(39, 19, 25, 'sed', '2018-11-19', 0),
(40, 1, 19, 'quis libero', '2018-12-21', 0);

insert into post_like (person_id, post_id, liked_date, like_id)


VALUES
(6, 14, '2022-01-14', 1),
(26, 1, '2022-01-15', 2),
(15, 12, '2022-01-26', 3)
(9, 4, '2022-01-21', 4),
(20, 15, '2022-01-30', 5),
(15, 12, '2022-01-13', 6),
(1, 3, '2022-01-12', 7),
(29, 18, '2022-01-18', 8),
(1, 8, '2022-01-25', 9),
(13, 20, '2022-01-03', 10),
(23, 3, '2022-01-07', 11),
(11, 4, '2022-01-15', 12),
(13, 15, '2022-01-30', 13),
(27, 17, '2022-01-25', 14),
(15, 10, '2022-01-10', 15),
(29, 19, '2022-01-15', 16),
(8, 20, '2022-01-18', 17),
(18, 4, '2022-01-23', 18),
(26, 9, '2022-01-09', 19),
(26, 1, '2022-01-25', 20),
(7, 7, '2022-01-26', 21)
(27, 20, '2022-01-24', 22),
(15, 18, '2022-01-25', 23),
(13, 15, '2022-01-20', 24),
(15, 3, '2022-01-18', 25),
(3, 6, '2022-01-08', 26),
(20, 2, '2022-01-22', 27),
(20, 16, '2022-01-23', 28),
(2, 6, '2022-01-13', 29),
(2, 13, '2022-01-24', 30),
(5, 14, '2022-01-25', 31),
(16, 14, '2022-01-23', 32),
(26, 17, '2022-01-27', 33),
(13, 10, '2022-01-21', 34),
(20, 7, '2022-01-07', 35),
(8, 13, '2022-01-14', 36),
(2, 19, '2022-01-07', 37),
(29, 5, '2022-01-20', 38),
(6, 16, '2022-01-07', 39),
(25, 3, '2022-01-16', 40)
(21, 10, '2022-01-03', 41),
(15, 10, '2022-01-18', 42),
(9, 7, '2022-01-13', 43),
(17, 10, '2022-01-21', 44)
(3, 19, '2022-01-08', 45),
(4, 4, '2022-01-23', 46),
(9, 11, '2022-01-14', 47),
(22, 19, '2022-01-25', 48)
(21, 6, '2022-01-27', 49),
(22, 14, '2022-01-09', 50),
(15, 18, '2022-01-28', 51),
(5, 6, '2022-01-05', 52),
(12, 20, '2022-01-22', 53),
(20, 13, '2022-01-26', 54),
(7, 12, '2022-01-26', 55),
(23, 14, '2022-01-14', 56),
(8, 2, '2022-01-28', 57),
(30, 18, '2022-01-06', 58),
(13, 14, '2022-01-25', 59),
(19, 8, '2022-01-03', 60);

insert into comment_like (comment_id, person_id, like_date)


VALUES
(1, 20, '2020-02-05'),
(2, 29, '2021-02-08'),
(3, 29, '2020-12-06'),
(4, 22, '2021-03-28'),
(5, 24, '2021-10-26'),
(6, 25, '2021-10-06'),
(7, 14, '2019-11-24'),
(8, 21, '2020-09-30'),
(9, 22, '2021-07-18'),
(10, 12, '2021-08-25'),
(11, 30, '2019-05-08'),
(12, 27, '2019-07-10'),
(13, 4, '2019-03-07'),
(14, 22, '2020-02-23'),
(15, 9, '2020-09-29'),
(16, 17, '2018-11-04'),
(17, 5, '2020-04-19'),
(18, 16, '2020-10-20'),
(19, 3, '2020-01-23'),
(20, 8, '2019-02-14'),
(21, 16, '2019-02-23'),
(22, 29, '2019-09-07'),
(23, 17, '2018-05-30'),
(24, 17, '2019-01-06'),
(25, 2, '2021-09-17'),
(26, 20, '2020-11-19'),
(27, 16, '2021-06-21'),
(28, 19, '2018-08-08'),
(29, 22, '2018-07-05'),
(30, 6, '2020-10-28')
(31, 6, '2018-11-15'),
(32, 2, '2019-05-01'),
(33, 16, '2022-01-05'),
(34, 28, '2021-11-28'),
(35, 21, '2019-05-20'),
(36, 26, '2020-09-06'),
(37, 16, '2018-05-16'),
(38, 1, '2018-04-25'),
(39, 5, '2018-02-02'),
(40, 7, '2018-04-08');
insert into project_instructor (project_task_id, brief, start_date, end_date, instructor_id,
project_name)
VALUES
(1, 'aliquet at', '2021-11-28', '2022-01-10', 26, 'ante vivamus'),
(2, 'lectus pellentesque at nulla suspendisse', '2021-09-16', '2022-01-15', 26, 'mi'),
(3, 'viverra eget congue eget semper', '2021-10-14', '2022-01-17', 28, 'nullam varius nulla
facilisi'),
(4, 'nec nisi volutpat eleifend donec', '2021-12-26', '2022-01-26', 25, 'primis in'),
(5, 'risus auctor sed tristique', '2021-12-11', '2022-01-18', 25, 'condimentum id luctus'),
(6, 'sodales scelerisque mauris sit amet', '2021-02-23', '2022-01-14', 24, 'amet justo morbi ut'),
(7, 'nisl venenatis', '2021-08-10', '2022-01-09', 25, 'vel nulla'),
(8, 'ut', '2021-06-24', '2022-01-29', 25, 'ut nulla sed accumsan'),
(9, 'in felis eu', '2021-12-08', '2022-01-14', 28, 'aliquet ultrices erat'),
(10, 'nam tristique tortor', '2021-10-21', '2022-01-01', 24, 'nulla')
(11, 'ante vivamus tortor', '2021-07-08', '2022-01-16', 27, 'nulla sed vel enim'),
(12, 'pede', '2021-06-23', '2022-01-18', 26, 'nulla facilisi cras'),
(13, 'eros', '2021-12-27', '2022-01-04', 28, 'congue elementum in'),
(14, 'et', '2021-05-08', '2022-01-03', 28, 'penatibus et'),
(15, 'non', '2021-05-15', '2022-01-27', 25, 'vivamus tortor duis'),
(16, 'quis tortor id', '2021-07-04', '2022-01-05', 28, 'justo'),
(17, 'nisl aenean lectus pellentesque', '2021-07-29', '2022-01-20', 25, 'orci'),
(18, 'duis faucibus accumsan', '2021-02-28', '2022-01-25', 24, 'sem fusce consequat'),
(19, 'ante ipsum primis', '2021-11-16', '2022-01-23', 24, 'justo lacinia eget tincidunt'),
(20, 'cubilia', '2021-09-04', '2022-01-06', 25, 'enim lorem ipsum');

insert into project_student (project_id, student_number, upload_date, document_info)


VALUES
(1, 10, '2022-01-31', false),
(2, 14, '2022-01-31', false),
(3, 10, '2022-01-31', false),
(4, 9, '2022-01-31', false),
(5, 16, '2022-01-31', false),
(6, 19, '2022-01-31', false),
(7, 4, '2022-01-31', false),
(8, 19, '2022-01-31', false),
(9, 4, '2022-01-31', false),
(10, 22, '2022-01-31', false),
(11, 6, '2022-01-31', false),
(12, 8, '2022-01-31', false),
(13, 15, '2022-01-31', false),
(14, 3, '2022-01-31', false),
(15, 19, '2022-01-31', false),
(16, 19, '2022-01-31', false),
(17, 8, '2022-01-31', false),
(18, 15, '2022-01-31', false),
(19, 18, '2022-01-31', false),
(20, 16, '2022-01-31', false);

insert into saved_job (saved_job_id, person_id, shared_date, end_date, brief, job_level,


job_type, job_offer_id)
VALUES
(1, 6, '2022-01-14', '2022-01-23', 'in faucibus orci luctus', '2 years of experience', 'Full Time',
1),
(2, 14, '2022-01-27', '2022-01-23', 'ac', '5 years of experience', 'Full Time', 2),
(3, 18, '2022-01-05', '2022-01-23', 'aliquam sit', '5 years of experience', 'Full Time', 3),
(4, 19, '2022-01-06', '2022-01-23', 'lorem integer tincidunt ante', '2 years of experience', 'Part
Time', 4),
(5, 8, '2022-01-04', '2022-01-23', 'quis', '5 years of experience', 'Full Time', 5),
(6, 2, '2022-01-04', '2022-01-23', 'justo', '2 years of experience', 'Part Time', 6),
(7, 27, '2022-01-16', '2022-01-23', 'quis', '5 years of experience', 'Full Time', 7),
(8, 3, '2022-01-07', '2022-01-23', 'tincidunt nulla mollis molestie lorem', '2 years of experience',
'Part Time', 8),
(9, 25, '2022-01-30', '2022-01-23', 'adipiscing elit proin risus', '10 years of experience', 'Full
Time', 9),
(10, 15, '2022-01-28', '2022-01-23', 'vel dapibus at diam', 'Beginner', 'Intern', 10),
(11, 11, '2022-01-26', '2022-01-23', 'nulla suspendisse', '2 years of experience', 'Part Time', 11),
(12, 23, '2022-01-20', '2022-01-23', 'orci nullam molestie nibh', 'Beginner', 'Intern', 12),
(13, 28, '2022-01-18', '2022-01-23', 'proin eu', '5 years of experience', 'Full Time', 13),
(14, 18, '2022-01-11', '2022-01-23', 'molestie sed justo', '2 years of experience', 'Part Time',
14),
(15, 19, '2022-01-10', '2022-01-23', 'et ultrices posuere cubilia', 'Beginner', 'Intern', 15),
(16, 3, '2022-01-03', '2022-01-23', 'nunc donec quis orci', 'Beginner', 'Intern', 16),
(17, 27, '2022-01-12', '2022-01-23', 'eleifend quam', '2 years of experience', 'Part Time', 17),
(18, 16, '2022-01-11', '2022-01-23', 'odio condimentum', 'Beginner', 'Part Time', 18)
(19, 26, '2022-01-22', '2022-01-23', 'aliquet massa id lobortis convallis', '5 years of experience',
'Full Time', 19),
(20, 4, '2022-01-13', '2022-01-23', 'dictumst etiam', '2 years of experience', 'Part Time', 20),
(21, 2, '2022-01-18', '2022-01-23', 'pede morbi porttitor', 'Beginner', 'Part Time', 21),
(22, 1, '2022-01-23', '2022-01-23', 'ac nibh', 'Beginner', 'Part Time', 22)
(23, 1, '2022-01-01', '2022-01-23', 'est donec odio justo sollicitudin', '2 years of experience',
'Part Time', 23),
(24, 22, '2022-01-06', '2022-01-23', 'eu', '5 years of experience', 'Full Time', 24),
(25, 19, '2022-01-27', '2022-01-23', 'in libero', 'Beginner', 'Part Time', 25)
(26, 1, '2022-01-17', '2022-01-23', 'nunc vestibulum ante ipsum', '2 years of experience', 'Part
Time', 26),
(27, 3, '2022-01-18', '2022-01-23', 'quis tortor id', '5 years of experience', 'Full Time', 27),
(28, 18, '2022-01-18', '2022-01-23', 'mauris vulputate', '2 years of experience', 'Part Time', 28)
(29, 5, '2022-01-03', '2022-01-23', 'maecenas ut', 'Beginner', 'Intern', 29),
(30, 15, '2022-01-23', '2022-01-23', 'volutpat sapien arcu sed', '10 years of experience', 'Full
Time', 30);
insert into student (student_number, mentor_id, department, faculty, university)
VALUES
(1, 27, 'Economics', 'Faculty of Economics', 'Harvard University'),
(2, 24, 'Economics', 'Faculty of Economics', 'Stanford University'),
(3, 28, 'Economics', 'Faculty of Economics', 'Harvard University'),
(4, 26, 'Economics', 'Faculty of Economics', 'University of Amsterdam'),
(5, 25, 'Economics', 'Faculty of Economics', 'Stanford University'),
(6, 28, 'Economics', 'Faculty of Economics', 'Harvard University'),
(7, 27, 'Economics', 'Faculty of Economics', 'University of Amsterdam'),
(8, 28, 'Economics', 'Faculty of Economics', 'Ege University'),
(9, 27, 'Economics', 'Faculty of Economics', 'Harvard University'),
(10, 26, 'Economics', 'Faculty of Economics', 'Ege University'),
(11, 26, 'Economics', 'Faculty of Economics', 'Stanford University'),
(12, 27, 'Economics', 'Faculty of Economics', 'Ege University'),
(13, 28, 'Economics', 'Faculty of Economics', 'University of Amsterdam'),
(14, 26, 'Economics', 'Faculty of Economics', 'Harvard University'),
(15, 26, 'Economics', 'Faculty of Economics', 'Stanford University'),
(16, 27, 'Economics', 'Faculty of Economics', 'University of Amsterdam'),
(17, 27, 'Economics', 'Faculty of Economics', 'Harvard University')
(18, 26, 'Economics', 'Faculty of Economics', 'Ege University'),
(19, 25, 'Economics', 'Faculty of Economics', 'Stanford University'),
(20, 26, 'Economics', 'Faculty of Economics', 'University of Amsterdam'),
(21, 26, 'Economics', 'Faculty of Economics', 'Harvard University'),
(22, 24, 'Economics', 'Faculty of Economics', 'Ege University'),
(23, 28, 'Economics', 'Faculty of Economics', 'Stanford University');
7-Write down 3 triggers for 3 different tables. Triggers should be meaninful.
*************************** TRIGGERS ****************************************
If you like any post, below is the trigger that will increase the total likes of that post one by
one.

DELIMITER $$
CREATE TRIGGER total_likes_update
AFTER INSERT
ON LinkedinMoodleSchema.post_like FOR EACH ROW
BEGIN
UPDATE LinkedinMoodleSchema.post
SET total_likes = total_likes + 1 WHERE
post_id = NEW.post_id ;
END$$
DELIMITER ;
----------------------------------------------------

If you have commented on someone's post, below is the trigger that will increase the number
of comments one by one.

DELIMITER $$
CREATE TRIGGER total_comments_update
AFTER INSERT
ON LinkedinMoodleSchema.post_comment FOR EACH ROW
BEGIN
UPDATE LinkedinMoodleSchema.post
SET total_comments = total_comments + 1 WHERE
post_id = NEW.post_id ;
END$$
DELIMITER ;
-----------------------------------------------------

Below is the trigger that will increase the likes of any post's comments one by one.
DELIMITER $$
CREATE TRIGGER total_comment_likes_update
AFTER INSERT
ON LinkedinMoodleSchema.comment_like FOR EACH ROW
BEGIN
UPDATE LinkedinMoodleSchema.post_comment
SET comment_likes = comment_likes + 1 WHERE
comment_id = NEW.comment_id ;
END$$
DELIMITER ;
-----------------------------------------------------

Below is the trigger that increases the total number of employees one by one when an
employee enters any company.
DELIMITER $$
CREATE TRIGGER no_of_employees_update
AFTER INSERT
ON LinkedinMoodleSchema.position_history FOR EACH ROW
BEGIN
UPDATE LinkedinMoodleSchema.company
SET no_of_employees = no_of_employees + 1 WHERE
company_id = NEW.company_id ;
END$$
DELIMITER ;
-----------------------------------------------------
Below is the trigger that keeps the total number of contacts when any user connects with
another user.

DELIMITER $$
CREATE TRIGGER no_of_connections_update
AFTER INSERT
ON LinkedinMoodleSchema.follow FOR EACH ROW
BEGIN
UPDATE LinkedinMoodleSchema.person
SET no_of_connections = no_of_connections + 1
WHERE NEW.followed_id = person_id ;
END$$
DELIMITER ;
-----------------------------------------------------

8-Write down 3 check constraints and 3 assertions. Check constraints and assertions should
be meaninful.

ALTER TABLE person


ADD CHECK (person_type = 'Student' OR person_type = 'Instructor' OR person_type =
'Other User');

ALTER TABLE project_student


ADD CONSTRAINT document_info CHECK (document_info = 0 OR document_info = 1);

ALTER TABLE direct_message


ADD CONSTRAINT direct_message CHECK (BINARY message_content = BINARY
UPPER(message_content));

ALTER TABLE LinkedinMoodleSchema.course


ADD CONSTRAINT credit_checker CHECK (course_credit > 1 AND course_credit < 11 =
0);
9-Write down the following SQL statements:
a. Write sample INSERT, DELETE and UPDATE statements for 3 of the tables you
have chosen.

Adding any course enrollment.


insert into course
values(course_id, course_name, course_credit),
(340, 'History of Modern Turkey', 3);

Updating any course record is as follows.


update course
set course.course_name = 'Microeconomics 1'
where course.course_id = 355;

The deletion of any course registration is as follows.


delete from course
where course_id = 355;

Adding students to the system is as follows.


insert into system_member
values(member_id, member_mail, member_password, member_type, joined_date),
(41, 'e.berkeaydin@gmail.com', 'hereismyfpassword', 'Person', '2022-02-02');
insert into person
values(person_id, fname, mname, lname, birth_date, sex, person_type,
no_of_connections, phone_number),
(41, 'Emin', 'Berke', 'Aydın', '1999-01-22', 'Male', 'Student', 0, '123456789');

insert into LinkedinMoodleSchema.student


values(student_number, mentor_id, department, faculty, university),
(41, 25, 'Computer Engineering', 'Engineering Faculty', 'Ege University');

The process of updating the information of any student in the system is as follows.
update student
set department = 'Faculty of Engineering'
where student_number = 41;

The process of deleting any student in the system is as follows.


delete from student
where student_number = 41;

delete from person


where person_id = 41;

delete from system_member


where member_id = 41;

/***********************************************************/

The process of adding a company to the system is as follows.


insert into system_member
values(member_id, member_mail, member_password, member_type, joined_date),
(41, 'company@gmail.com', 'hereismyfpassword', 'Person', '2022-02-02');
insert into company
values(company_id, company_name, sector, no_of_employees),
(41, 'EBACO', 'Software Development', 5);

The process of updating the information of any company in the system is as follows.
update company
set no_of_employees = 3
where company_id = 41;

The process of deleting the information of any company from the system is as follows.
delete from company
where company_id = 41;

delete from system_member


where member_id = 41;
b. Write 10 SELECT statements for the database you have implemented.

i. 3 of them should use just one table.

The query listing female employees is as follows.


SELECT DISTINCT person_id,fname,mname,lname
FROM person
WHERE sex = 'Female'

The query showing the credit of the macroeconomics course is


as follows.
SELECT course_credit
FROM course
WHERE course_name = 'Macroeconomics';

The query listing the names and dates of the events organized
by the organizer number 15 is as follows.
SELECT event_title, start_date, end_date
FROM social_event
WHERE organizator_member_id = 15;
ii. 4 of them should use minimum 2 tables.

The query that lists students studying at Harvard university is as


follows.
select person_id,fname,mname,lname
from person, student
where person.person_id = student.student_number and
student.university = 'Harvard University';

The listing of companies in the Czech republic is as follows.


SELECT DISTINCT company_name
FROM company, company_location
WHERE company_location.country = 'Czech Republic'
and company_location.company_id =
company.company_id;

The query that lists the first name information of users who are
interested in Tarkovsky movies and electric vehicles is as follows.
select distinct person.person_id ,person.fname
from person
inner join interest on interest.person_id =
person.person_id
where interest_name = 'Tarkovski' or interest_name =
'Electric Cars';
The query that lists the total number of users who have worked in
companies with locations in the United States is as follows.
select sum(no_of_employees)
from company, company_location
where company.company_id =
company_location.company_id and
company_location.country = 'United States';

iii. 3 of them should use minimum 3 tables.

The query that gives the name of the university to which the
mentors of the students studying at Ege University are affiliated,
together with the student names, is as follows.
select person.fname, instructor.university
from student, person, instructor
where student.university = 'Ege University' and
student.student_number = person.person_id and
student.mentor_id = instructor.instructor_id ;

The query that lists the talent information of users who have
worked in the Software Development sector is as follows.
select distinct person.person_id, skill.skill_name
from person, skill, company, position_history
where position_history.company_id =
company.company_id and company.sector =
'Software Development';
The query that lists the company information of kayla stewart is as
follows.
SELECT company_name, company.company_id
FROM person, company, position_history
WHERE person.fname = 'Kyla' AND person.lname = 'Stewart'
AND person.person_id = position_history.person_id AND
position_history.company_id = company.company_id;

c. Write 5 original SELECT statements that you think critical to interaction and
integration points for the database.

The query that lists the students who took the History of Economics course is
as follows.
select person.fname, person.mname, person.lname,
course.course_name
from student, person, course, course_section
where student.student_number = person.person_id and
course_section.course_id = course.course_id and
course.course_name = 'History of Economics';
The query listing the position history of the person with an ID of 27 and the
companies he worked for is as follows.
select person.person_id, company.company_id,
company.company_name, position.position_title
from person, position, position_history, company
where person.person_id = 27 and position_history.person_id =
person.person_id and position_history.company_id = com-
pany.company_id and position_history.position_id = posi-
tion.position_code;

The query listing the positions and CV codes of the person with an ID of 15
applied for job applications is as follows.

select person.person_id, job_apply.cv_code,


job_offer.job_title
from person, job_apply, job_offer
where person.person_id = 15 and job_apply.person_id = per-
son.person_id and job_apply.job_offer_id =
job_offer.offer_post_id ;

The query that lists the instructor and project description of the project
uploaded to the system by the user with ID 6 is as follows.

select project_instructor.instructor_id, project_instructor.brief,


project_student.upload_date

from person, project_instructor, project_student

where person.person_id = 6 and project_student.student_num-


ber = person.person_id and project_student.project_id = pro-
ject_instructor.project_task_id ;
The query that lists the information of the social event number 20 and the
information of the people participating in this event is as follows.

select person.person_id, person.fname, person.lname

from person, join_event, social_event

where social_event.event_id = 20 and social_event.event_id =


join_event.social_event_id and join_event.person_id = per-
son.person_id;

You might also like