Job Portal Queries Completed-2

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

DBMS

CASE STUDY

VU21CSEN0400056 - ISHITHA

VU21CSEN0400190 - TIRUMALA RAO

VU21CSEN0400199 – PARMITH SAI

VU21CSEN0400212 - MANISH

VU21CSEN0400237 - CHARMIKA

VU21CSEN0400263 - SAGAR

1
JOB PORTAL CASE STUDY (DBMS)
ABSTRACT:
The online job portal, named "JobConnect," is designed to connect job seekers
with employers, providing a platform for job search, application submission,
and recruitment management. The system's database management plays a
critical role in storing, organizing, and retrieving data related to job listings,
candidate profiles, employer accounts, and application tracking.
An Entity-Relationship (ER) diagram for an online job portal typically includes
entities such as Job Listings, Candidates, Employers, Applications, and more,
along with their relationships and attributes
Based on the ER diagram, we proceed to establish a relational database
schema using appropriate tables, fields, and constraints. Each entity is
represented as a table, with attributes mapped to columns, and relationships
captured through foreign key constraints. This relational schema forms the
backbone of the online job portal , enabling the storage, retrieval, and
manipulation of data essential for seamless operation

PART -1 DATA MODELING DESIGN

ENTITY-RELATIONSHIP DIAGRAM
ENTITIES:

1. INTERNSHIPS
2. PROJECTS
3. ALUMNI
4. COMMUNITY
5. NOTIFICATION BOARD
6. EMPLOYERS
7. COMPANY

2
8. ROLE
9. DOMAIN
10. SEARCH
11. JOB PORTAL
12. APPLICATION
13. DOCUMENTATION
14. SUBSCRIPTION
15. PAYMENTS
16. PLANS
17. ABROAD JOBS
18. ABROAD PROJECTS
19. SIGNUP
20. SIGNIN
21. USER DETAILS
22. USER PROJECTS

ATTRIBUTES:
1. NAME

 U_ID
 DURATION
 REFERENCE_ID
 PAYMENT
 STIPHEND

2 .PROJECTS
 U_ID
 PROJECT_NAME
 INSTITUTE
 DOMAIN
 PROJECT_GUIDE

3. ALUMNI

3
 ALLUMNI_ID
 NAME
 COMPANY
 JOB

4. COMMUNITY
 MEMBER_ ID
 EVENT _DATE
 EVENT_TYPE

5. NOTIFICATION BOARD

 JOB ID
 APPLICATION_REVIEW
 APPLICATION_STATUS
 JOB_TYPE
 APPLICATION_REVIEW

6. EMPLOYERS

 EMP_ID
 EMP_NAME
 COMP_ID
 JOINING_DATE
 SALARY

7. COMPANY
 C_ID
 C_NAME

4
 C_LOCATION
 COM_TYPE

8. ROLE
 ROLE_NAME
 ROLE_DESCRIPTION
 ROLE_REQUIREMENTS

9. DOMAIN
 DOMAIN_TYPE
 INDUSTRY

10. JOBS
 J_ID
 JOB_NAME
 JOB_TYPE

11. SEARCH

 SEARCH RESULTS
 SEARCH FILTER

12. JOB PORTAL


 PORTAL NAME
 URL

13. APPLICATION

5
 AGE
 EMAIL
 EXPERIENCE

14. DOCUMENTATIONS

 UID
 PASSPORT
 IMG

15. SUBSCRIPTIONS

 SUBS_NAME
 SUBS_DURATON
 COST

16. PAYMENTS
 TRANSCACTION _ID
 VISA
 ADHAR_NUMBER
17. PLANS
 UID
 DISCOUNT
 COUPON

18. ABROAD JOBS

 AJOB_NAME
 AJOB_ID

6
 AP_DURATION

19. ABROAD POJECTS

 APNAME
 AP_LOCATION
 AP_COMPANY

20. SIGNUP
 NAME
 EMAIL
 PASSWORD

21. SIGN IN
 EMAIL
 PASSWORD

22. USER DETAILS


 U_ID
 USER_ AGE
 USER_ADDRESS

23. USER PROJECTS


 USERNAME
 CERTIFICATES
 RESUME

7
 WORK_EXPERIENCE

RELATIONSHIPS:

JOB PORTAL , PROJECTS, INTERNSHIPS – PROVIDES


JOB PORTAL, NOTIFICATION BOARD – CONTAINS
JOB PORTAL, SEARCH – FILTERS BY
JOB PORTAL, ABROAD JOBS – LINKS WITH
JOB PORTAL, ACCOUNT – REGISTER
JOB PORTAL, ABROAD PROJECTS – LINKS WITH
ABROAD JOBS, DOCUMENTATION – NEEDS
PLANS, SUBSCRIPTION – CONSISTS OF
SUBSCRIPTION, PAYMENT – DETAILS
EMPLOYEES, INTERVIEWS – CONDUCTS
EMPLOYERS,COMPANY – WORKS FOR
COMPANY, DOMAIN- DETAILS
JOB PORTAL, JOBS – LISTS
JOB PORTAL, SKILL DEVELOPMENT,MENTORSHIP - GUIDANCE
USER,USER PROFILE – CREATES
USER, USER DETAILS – PROVIDES
JOBS, ROLE – DETAILS
COMMUNITY,ALLUMNI – MEMBER SINCE

8
ER DIAGRAM

9
PART-2 REALATIONAL DATABASE
SCHEMA DEVELOPMENT
CONCEPTUAL SCHEMA:

 Internships (userid integer, internship_name varchar(100), type


varchar(100), duration varchar(50), reference_id integer,
payment integer, stiphend integer)
 Projects (user_id integer, project_name varchar(100), project-
guide varchar(100),team_name varchar(100), institute
varchar(100), domain varchar(100))
 Alumni (alumni_id integer, name varchar(100), company
varchar(100), job varchar(100))
 Community (member_id integer,event_name varchar(100),
event_date date, event_type varchar(100))
 Notification board (time Time, job_id integer, job_type
varchar(100), deadline varchar(100), application_review
varchar(100), application_status varchar(100))
 Employers (emp_id integer, emp_name varchar(100), comp_id
integer, salary integr, joining_date date, position varchar(100))
 Company (company_id integer, comp_name varchar(100),
comp_location varchar(100), comp_type varchar(100),
comp_valuation integer)
 Role (role_name varchar(100), role_description varchar(100),
role_requirements varchar(100), role_salary integer,
role_location varchar(100))
 Domain (domain_type varchar(100), industry varchar(100),
description varchar(100), company_name varchar(100))
 Jobs (job_id integer, job_name varchar(100), job_type
varchar(100), job_shift varchar(100), job_location varchar(100))
 Search (search type varchar(100), search filter varchar(100))

10
 Job portal (portal name varchar(100), portal url varchar(100))
 Application (name varchar(100), age integer, email
varchar(100), phn num integer, education varchar(100), work
experience varchar(100), image varchar, achievements
varchar(100))

PART 3: RELATIONAL DATABASE


IMPLEMENTATION:

Create table Internships(userid integer PRIMARY KEY, internship_name


varchar(100) NOT NULL, type varchar(100), duration varchar(50),
reference_idinteger, payment integer, stiphend integer);
INSERT INTO Internships (userid, internship_name, type, duration,
reference_id, payment, stiphend) VALUES
(56, 'cybersecurity', 'offline', 'one month', 102, 0, 2000),
(253, 'AI', 'online', '1 month', 103, 1000, 0),
(263, 'ML', 'offline', '2 months', 104, 1500, 1200),
(199, 'marketing', 'online', '2 months', 105, 2000, 500),
(212, 'data science', 'online', '1 month', 106, 3000, 200);

11
Create table Community(member_id integer PRIMARY KEY
,event_name varchar(100) NOT NULL, event_date date,
event_type varchar(100));
INSERT INTO Community (member_id, event_name, event_date,
event_type) VALUES
(102, 'Infosys', '2023-10-12', 'offline'),
(56, 'unout', '2008-09-02', 'online'),
(237, 'Infosys', '2023-10-12', 'offline'),
(199, 'Microsoft', '2024-02-12', 'Online'),
(106, 'Amazon', '2023-09-09', 'online');

12
Create table Notification_board (time Time, job_id integer,
job_type varchar(100), deadline varchar(100), application_review
varchar(100), application_status varchar(100));
INSERT INTO Notification_board (time, job_id, job_type PRIMARY KEY ,
deadline,application_review, application_status) VALUES
('08:00:00', 204, 'Accenture', '2024-04-05', 'done', '80%'),
('21:30:00', 203, 'Amazon', '2024-04-08', 'not done', '70%'),
('16:30:00', 201, 'Infosys', '2032-08-02', 'done', '40%'),
('06:00:00', 205, 'Capgemini', '2022-06-02', 'done', '85%'),
('11:00:00', 202, 'TCS', '2024-04-10', 'not done', '98%');

13
Create table Employers(emp_id integer PRIMARYKEY, emp_name
varchar(100) NOTNULL, comp_id integer, salary integr, joining_date
date,position varchar(100));
INSERT INTO Employers (emp_id, emp_name, comp_id, salary,
joining_date, position) VALUES
(102, 'srinu', 301, 20000, '2004-01-01', 'Software Engineer'),
(103, 'Vishnu', 302, 25000, '2006-01-01', 'Manager'),
(104, 'alekhya', 303, 45000, '2008-01-01', 'Data Analyst'),
(105, 'Bob', 304, 35000, '2010-01-01', 'Security Analyst'),
(106, 'Tony', 305, 800000, '2012-01-01', 'Data Miner');

14
Create table Company(company_id integer PRIMARY KEY ,
comp_name varchar(100)NOT NULL, comp_location varchar(100),
comp_type varchar(100),comp_valuation integer UNIQUE);
INSERT INTO Company (company_id, comp_name, comp_location,
comp_type, comp_valuation) VALUES
(301, 'Infosys', 'Hyderabad', 'Product', 1200000000),
(302, 'Tcs', 'Chennai', 'Service', 1500000000),
(303, 'Amazon', 'Bangalore', 'Product', 1800000000),
(304, 'Accenture', 'Mumbai', 'service', 2800000000),
(305, 'Capgemini', 'Delhi', 'services', 5500000000);

15
Create table Role(role_name varchar(100)PRIMARY KEY,
role_requirementsvarchar(100), role_salary integer, role_location
varchar(100));
INSERT INTO Role (role_name, role_requirements, role_salary,
role_location) VALUES
('Software Engineer', 'cse', 30000, 'Hyderabad'),
('Manager', 'mba', 70000, 'Chennai'),
('Data Analyst', 'Mtech', 60000, 'Bangalore'),
('Security Analyst', 'Mtech', 60000, 'Mumbai'),
('Data Miner', 'mtech', 75000, 'Delhi');

16
Create table Domain(domain_type varchar(100) PRIMARY
KEY, industryvarchar(100), description varchar(100),
company_name varchar(100));
INSERT INTO Domain (domain_type, industry, description,
company_name) VALUES
('Information Technology', 'Software Development', 'IT consulting
services', 'Tech Solutions Inc'),
('Healthcare', 'Pharmaceuticals', 'Medical equipment manufacturing',
'MedTech Innovations'),
('Finance', 'Banking and Finance', 'Investment banking', 'Capital
Partners LLC'),
('Education', 'Higher Education', 'Online learning platform', 'EduTech
Ventures'),
('Retail', 'E-commerce', 'Clothing and accessories retail', 'Fashion
Haven Ltd');

17
Create table Jobs(job id integer PRIMARY KEY , job name
varchar(100)UNIQUE, job typevarchar(100), job shift varchar(100), job
location varchar(100));

INSERT INTO Jobs (job id, jobname, job type, job location) VALUES
(201, 'Software Engineer', 'offline', 'on site'),
(202, 'Manager', 'offline', 'on site'),
(203, 'Data Analyst', 'online', 'offsite'),
(204, 'Security Analyst', 'online', 'offsite'),
(205, 'Data Miner', 'offline', 'on site');

18
Create table Search(search type varchar(100) PRIMARY
KEY, search filtervarchar(100));

INSERT INTO Search (search, search filter) VALUES


('Salary', 'Location'),
('Company', 'Domain'),
('Role', 'role name');

19
Create table Job portal(portal name varchar(100), portal url
varchar(100));
INSERT INTO Job portal (portal name, portal url) VALUES
('jobs for india','Www.Udiyog.com');

20
Create table Application(username varchar(100) PRIMARY KEY, age
integer, emailvarchar(100) UNIQUE, phn num integer UNIQUE, education
varchar(100) NOT NULL, work_experience varchar(100), image varchar,
achievements varchar(100),cv varchar(100), resume varchar(100));

INSERT INTO Application (username, age, email, phn_num,


education, work_experience, image, achievements, cv, resume)
VALUES
('Ishita', 21, '[email protected]', 7285977876, 'Btech', '0',
'JPG', 'CEH certification', 'uploaded', 'uploaded'),
('Charmi', 19, '[email protected]', 7285977976, 'Btech', '0',
'jpg', 'AI certification', 'uploaded', 'uploaded'),
('Sagar', 20, '[email protected]', 7285977476, 'Btech', 'two years',
'Jpg', 'Machine learning', 'uploaded', 'not uploaded'),

21
('Permit', 20, '[email protected]', 728597576, 'Btech', '2 years',
'Jpg', 'Machine learning marketing certification', 'uploaded', 'not
uploaded'),
('Manish', 19, '[email protected]', 7285977776, 'Btech', 'one year',
'jpg', 'Data science certification', 'not uploaded', 'uploaded');

22
Create table Documentation(user_id integer PRIMARY KEY, visa
varchar(100), passport varchar(100), bank_statement varchar(100),
adhar numinteger, health_checkup integer);
INSERT INTO Documentation (user_id, visa, passport,
bank_statement, adharnum, health_checkup) VALUES
(56, 'approved', 'approved', '400000', '7838045', 'checked'),
(102, 'Approved', 'approved', '4000000', '35446', 'not checked'),
(103, 'not approved', 'not approved', '500000', '736748', 'Not
checked'),
(119, 'approved', 'not Approved', '3500000', '67364356', 'not
checked'),
(105, 'Not proved', 'approved', '600000', '63545345', 'checked');

23
Create table Subscription( subs_name varchar(100)PRIMARYKEY ,
subs_duration varchar(100)UNIQUE, num_devices integer, cost integer
NOTNULL);

INSERT INTO Subscription (subs_name, subs_duration, num_devices,


cost) VALUES
('Bronze', 'one month', '1', '300'),
('Silver', 'three months', '2', '500'),
('Gold', '6 months', '5', '1500'),
('Platinum', 'one year unlimited', '2000');

24
Create table Payments(transaction_id integer PRIMARY KEY,
payment_method varchar(100)NOTNULL, payment_type varchar(100),
receipt varchar(100));

INSERT INTO Payments (transaction_id, payment_method,


payment_type, receipt) VALUES
(501, 'Debit', 'emi', 'downloaded'),
(502, 'credit card', 'direct', 'downloaded'),
(503, 'upi', 'direct', 'downloaded'),
(504, 'visa', 'emi', 'downloaded'),
(505, 'net banking', 'direct', 'downloaded');

25
Create table Plans(user_id integer PRIMARYKEY, discounts integer,
coupons integer,points varchar(100));

INSERT INTO Plans (user_id, discounts, coupons, points) VALUES


(212, '10', 'silver', '50'),
(105, '5', 'bronze', '25'),
(119, '20', 'gold', 'hundred'),
(237, '25', 'platinum', '500'),
(102, '10', 'silver', '50');

26
Create table Abroad_jobs (ajob_name varchar(100) NOT NULL,
ajob_id integer PRIMARY KEY,ajob_type varchar(100),
ajob_description varchar(100), ajob_company varchar(100));

INSERT INTO Abroad_jobs (ajob_name, ajob_id, ajob_type,


ajob_description, ajob_company) VALUES
('J001', 'Software Engineer', 'Full-time', 'Day shift', 'New York'),
('J002', 'Marketing Manager', 'Part-time', 'Night shift', 'San
Francisco'),
('J003', 'Financial Analyst', 'Contract', 'Rotating shifts', 'London'),

27
('J004', 'Customer Support Specialist', 'Freelance', 'Flexible hours',
'Tokyo'),
('J005', 'Sales Representative', 'Internship', 'Remote work', 'Sydney');

Create table Abroad_projects (ap_name varchar(100) PRIMARY KEY,


ap_locationvarchar(100), ap_duration varchar(100), ap_salary
integer, ap_comapny varchar(100));

INSERT INTO Abroad_projects (ap_name, ap_location, ap_duration,


ap_salary, ap_comapny) VALUES

28
('Global Expansion Initiative', 'New York, USA', '12 months', '70000',
'Tech Innovations Inc.'),
('Marketing Campaign Launch', 'London, UK', '6 months', '60000',
'Marketing Pro Ltd.'),
('Product Development: Version 2.0', 'San Francisco, USA', '18
months', '80000', 'Software Solutions LLC'),
('Infrastructure Upgrade Project', 'Tokyo, Japan', '24 months', '90000',
'TechWare Corporation'),
('Research & Development: AI Integration', 'Berlin, Germany', '9
months', '75000', 'AI Innovations GmbH');

Create table Sign_up (username varchar(100) NOT NULL, email


varchar(100) PRIMARYKEY,create_password varchar(100)UNIQUE);

29
Create table Sign_up (username varchar(100), email varchar(100)PRIMARY
KEY,create_password varchar(100));

INSERT INTO Sign_up (username, email, create_password) VALUES


('Ishita', '[email protected]', 'One to 3456'),
('Manish', '[email protected]', '2345612'),
('Parmit', '[email protected]', 'Permit');

30
Create table Sign in (email varchar(100) PRIMARY KEY, password
varchar(100) NOTNULL);

INSERT INTO Sign in (email, password) VALUES


('[email protected]', '2565'),
('[email protected]', '5551');

Create table User_details (user_id integerPRIMARYKEY, username


varchar(100)NOTNULL, user_age integer, user_address varchar(100),
pincode integer, gendervarchar(100), email varchar(100)UNIQUE,
phn_num integerUNIQUE);

31
INSERT INTO User_details (user_id, username, user_age,
user_address, pincode, gender, email, phn_num) VALUE

32
(56, 'Ishita', 21, 'Akeepalam', 1, 'female', '[email protected]',
7285977876),
(237, 'Charmi', 19, 'Srikakulam', 2, 'female',
'[email protected]', 7285977976),
(263, 'Sagar', 20, 'Madhurwada', 3, 'male', '[email protected]',
7285977476),
(199, 'Parmit', 20, 'Yendada', 4, 'male', '[email protected]',
728597576),
(212, 'Manish', 19, 'Pandurti', 5, 'male', '[email protected]',
7285977776),
(102, 'Srinu', 30, 'Anakapalli', 6, 'male', '[email protected]',
7285977876),
(103, 'Vishnu', 32, 'Duvvada', 7, 'male', '[email protected]',
7285977876),
(104, 'Alekhya', 28, 'Sheela Nagar', 8, 'female', '[email protected]',
7285977876);

33
Create table User_projects (user_id integerPRIMARY KEY, username
varchar(100)NOTNULL, education varchar(100), certificates
varchar(100),resume varchar(100), skills varchar(100),
work_experience
varchar(100));

INSERT INTO User_projects (username, education, certificates,


resume, skills, work_experience) VALUES
('Ishita', 'Btech', 'uploaded', 'uploaded', 'technical', '2 years'),
('Charmi', 'Cyber security', 'pending', 'pending', 'hacking', 'fresher'),
('Sagar', 'Data science', 'uploaded', 'uploaded', 'technical', '1 year'),
('Manish', 'Btech', 'uploaded', 'uploaded', 'tester', 'fresher'),
('Parmit', 'Artificial intelligence', 'not uploaded', 'not uploaded',
'creative', '2 years'),
('Rao', 'Btech', 'uploaded', 'uploaded', 'communication', '2 years');

34
PART-4 QUERIES
SELECT QUERIES:-

1. Retrieve the names and job titles of alumni who are


currently working at Amazon:

SELECT name, job


FROM Alumni
WHERE company = 'Amazon';

OUTPUT:-

35
2. Retrieve the usernames and ages of users who have
applied for internships and have not uploaded their CV:

SELECT username, user_age


FROM User_details
WHERE user_id IN (
SELECT userid
FROM Application
WHERE cv = 'not uploaded');

OUTPUT:-

36
3. Retrieve the names of users who have applied for
internships and have achieved the CEH certification:

SELECT username
FROM User_details
WHERE user_id IN (
SELECT userid
FROM Application
WHERE achievements LIKE '%CEH certification%'
);
OUTPUT:-

37
AGGREGATE OPERATORS QURIES:-

1. Count the number of events organized by each event


type in the Community table:

SELECT event_type, COUNT(*) AS event_count


FROM Community
GROUP BY event_type;

OUTPUT:-

2. Calculate the average salary of all employers:

SELECT AVG(salary) AS average_salary


FROM Employers;

38
OUTPUT:-

SUM

SELECT SUM(payment) AS total_payment


FROM Internships
WHERE type = 'offline';

39
MAX

SELECT MAX(CAST(points AS UNSIGNED)) AS max_points


FROM Plans;

40
MIN

SELECT MIN(work_experience) AS min_work_experience


FROM User_projects;

NESTED QUERIES:-

1. Retrieve the names of users who have applied for


internships and have uploaded both a CV and a
resume:

SELECT username
FROM User_details
WHERE user_id IN (
SELECT userid
FROM Application
WHERE cv = 'uploaded' AND resume = 'uploaded'
);

41
OUTPUT:-

2. Retrieve the length of the email addresses of users who


have applied for internships:

SELECT username, email, LENGTH(email) AS email_length


FROM User_details
WHERE user_id IN (
SELECT userid
FROM Application
);

42
OUTPUT:-

CORELATED NESTED QUERIES:-

1. Retrieve the event names from the Community table


where the event date is after the earliest event date in
the same event type:

SELECT event_name, event_date


FROM Community c_outer
WHERE event_type = 'offline'
OR (event_type = 'online' AND NOT EXISTS (
SELECT 1
FROM Community c_inner
WHERE c_outer.event_name = c_inner.event_name
AND c_inner.member_id > 200
));
43
OUTPUT:-

2. Retrieve the project names and locations of abroad


projects where the salary is greater than the average
salary of all abroad projects:

SELECT ap_name, ap_location


FROM Abroad_projects ap_outer
WHERE EXISTS (
SELECT 1
FROM Abroad_projects ap_inner
WHERE ap_outer.ap_salary > (
SELECT AVG(ap_salary)
FROM Abroad_projects
44
)

45
OUTPUT:-

46
SET COMPARISON QUERIES:-

1. Retrieve the names of users who have applied for


internships but have not signed in:

SELECT username FROM Application


EXCEPT
SELECT username FROM Sign_in;

47
OUTPUT:-

2. Retrieve the distinct names of companies from both


the Employers and Company tables:

SELECT emp_name FROM Employers


UNION
SELECT comp_name FROM Company;

48
OUTPUT:-

3. Find the usernames of users who have applied for


internships and also signed up on the platform:

SELECT username FROM User_details


INTERSECT
SELECT username FROM Application;

49
OUTPUT:-

GROUPBY HAVING QUERIES :-

1. Retrieve the average salary for each job type in the


Jobs table, only including job types with an average
salary greater than 40000:

SELECT job_type, AVG(role_salary) AS avg_salary


FROM Jobs j
JOIN Role r ON j.job_name = r.role_name
GROUP BY job_type
HAVING AVG(role_salary) > 40000;

50
OUTPUT:-

2. Find the names of companies with more than 2 alumni


in the Alumni table:

SELECT company
FROM Alumni
GROUP BY company
HAVING COUNT(*) > 2;

51
OUTPUT:-

RELATIONAL SET QUERIES :-

1. Retrieve the distinct job types from both the Jobs and
Role tables:

SELECT job_type FROM Jobs


UNION
SELECT role_name FROM Role;

52
OUTPUT:-

2. Find the distinct company names from both the


Employers and Alumni tables:

SELECT emp_name FROM Employers


UNION
SELECT company FROM Alumni;

53
OUTPUT:-

54
55
56
57
58
59
60
61
62

You might also like