You are on page 1of 5

Placement System

A placement Agency maintains this is a system that stores the details about the
candidates who are interested in applying for jobs. Their Qualification, Skill set,
no. of years of experience, city of preference which they wish to work, the salary
expected is acquired through this system and stored in the database. By default
the city of preference is set to ANY which means the candidates can work in any
city. When their record is created for the first time their record status is set to U
meaning Unblocked that means the candidate has not got any job offer. When
they get atleast one offer their detail record is created in the placed candidates
table with status as O standing for Offer and if the candidate has 3 records with
O then the rec_stat is set to B meaning Blocked. If a candidate accepts atleast
one offer then the status is set to A meaning accepted then the rec_stat is set to
B- blocked. The table Companies stores the jobs database of different
companies.
Table name: Candidates
Reg_id Primary Key
C_Name
City
Qualification
Skillset
Experience ------ no. of years
ExpectedSalary
Pref_city default ‘ANY’
Rec_stat varchar(1)

Constraints Rec_stat should be by default set to U –Unblocked


A- Archive
B- Blocked
Reg_id C_name City Qualific Skill set Exp Pref_city Exp_sa Rec_s
ation lary tat
R00101 Rama Mumbai M.E JAVA 2 Chennai 20000 U
R00102 Krishna Bangalore MBA C++, Lynx 1 Bangalore 18000 U
R00103 Jyothi Pune MCom Oracle 0 Pune 12000 A
R00104 Vishnu Noida BCom, Oracle, 3 Delhi 22000 A
DBM Tally
R00105 Kapil Mumbai MSc C,JAVA 2 Mumbai 20000 U
R00106 Snehal Chennai MCA JAVA 1 Chennai 22000 B
R00107 Kriti Bangalore B.E VC++ 2 Bangalore 20000 U
R00108 Anand Hyderabad B.E ORACLE 3 Chennai 18000 B
Table name: Companies
Comp_id Primary Key
Position Primary key
Date_of_ad date
Company
City
E_Skillset
E_Qualification
Min_Experience - minimum number of years of experience
Max_Experience – maximum number of years of experience expected
Comp_id Company Position Date of City E_Qual Skill Min Max
Advt set Exp Exp
C00101 Infosys Software 10-10-08 Mumbai B.E JAVA 2 2
Engg
C00102 Wipro Trainee 02-10-08 Noida Graduate Any 0 1
Programmer
C00103 Wipro Software 03-10-08 Bangalore Any Post Oracle 0 2
Engg Graduate
C00104 Patni System 07-09-08 Noida B.E Oracle 0 3
Analyst
C00105 Digital eye System 07-10-08 Mumbai Any Post JAVA 1 4
Analyst Graduate
C00106 Digital Eye Programmer 02-10-08 Delhi MCA JAVA 2 5
C00107 L&T Software 03-10-08 Delhi B.E Any 2 4
Infotech Engg
C00108 3i Infotech Programmer 03-10-08 Hyderabad B.E, MCA, 1 2
MSc

Table name: Placed_Candidates


Placed_id PK
Reg_id FK
Comp_id FK
Position FK
Salaryoffered
City
Status Varchar(1) check constraint – default – O or A

1. Create the above tables with the mentioned constraints


2. Write a trigger so that when a candidate gets 3 offers then do not allow to
insert any more records in the placed_candidates table for that Reg_id,
3. After 3 offers make the rec_stat field of the candidates as B meaning this
record is blocked.
4. If a candidate accepts his job then in the table placed_candidates make
the status as ‘A’ meaning he has accepted one offer. Also make the
candidate’s record rec_stat =’A’ Accepted .
5. Find how many candidates have the skill set and experience matching
with the company “Infosys” for the Systems Analyst position.
6. Find how many candidates have got atleast one job offer.
7. Find the candidates who have got salary more than the expected salary
but not in the city of their choice.
8. Find the candidates who have got a job in the same city as they live.
9. Find the candidates who do not fit with the skill set and experience of any
of the companies.
10. Find the company which is located in a city where there are no candidates
11. Find the company whose skill set and experience matches with none of
the candidates
12. Find the candidate who has a job in the city of their but has got a salary
less than their choice.
13. Find the average salary offered by companies for the position of Software
Engg for the candidates with experience between 2 to 4 years.
14. A company wants Engg candidates to work for their Delhi branch, in JAVA
with 3years and above experience and the salary offered is 20,000 Rs.
Short list the candidates who can be sent for the interview.
15. How many candidates are ready to work in any city
16. How many candidates are freshers?
17. Candidates who have given the same city as the preferred city
18. Candidates who want the same city as their preference as the city they
live in.
19. Candidates who have given a different city of preference as they live in.
20. No. of companies who have requirements for JAVA programmers
21. Companies who are ready to take freshers
22. companies who offer less than Rs 15000 salary
23. No. of companies based in Chennai
24. Company which offered jobs to the maximum number of candidates
25. City where maximum number of jobs were offered
26. Positions that were filled the most.
27. Find the total number of jobs that are available for “Software Engg”
position in the city of Bangalore.
28. Find total number of jobs that are posted by the company “Digital Eye”
29. Find the average salary offered in the city of “ Noida” by companies.
30. List out all the candidates who have accepted their jobs and the job
details that they have accepted.
Travel Agency

This system caters to the needs of a travel agency. The agency books flights
for customers. Currently we are only maintaining the job of querying as per
the request of the customers or booking the seats. Payment amounts are
saved but mode of payment and status is not being taken care of. The table
Passengers stores the details of the customer. The Table bookings stores the
booking details like no. of seats and amount made against the customer id.
The table airlines stores the deals offered by the various airlines. A_id + F_id
is the joint primary key. Since one airlines may have many flights.

Passengers

P_id (PK)
P_name
City

Airlines

A_id-----PK
F_id-----PK
A_name
From_Dest
To_Dest
Dep_Time Datetime
Arrival_Time Datetime
Seats_Available
Rate

Bookings

B_id PK
P_id FK
F_id FK
Date_of_travel
No_of_seats
Total_amount
1. Find the passengers who have booked flight on the date 5/10/2008 for
the destination Delhi
2. Find the passengers who have booked flights by the airlines “Delta” .
3. Find the Airways which offer the lowest fare for the flights to Cochin
4. Find the destination which has the maximum number airways.
5. find the flights for ’03-Nov-2008’ departing between 5:00 AM and 1:00
PM and have atleast 4 seats available.
6. Find all the day flights to destination Mumbai from Chennai
7. Find all the night flights to destination Cochin from Hyderabad.
8. Find the number of seats booked by the passenger “Ajay” to Delhi on
the date 20-Nov-2008
9. Find the airline which has sold out all its tickets to the destination
“Chennai” for the month of Nov.
10. Find the destination that has been sold out for the month of November.
11. Find the total number of tickets sold out for the destination ‘Goa’ during
the month of October.
12. Find all the passengers who have booked atleast one seat to any
destination.
13. Find the passengers who have not booked any ticket to any destination
14. Find the airlines which do not fly to destination Kolkota at all.
15. Find the airlines which has no day flights from Chennai to Trivandrum
16. Find the airlines which no night flights flying out of the city of Mumbai
17. Find the customers who have flown by the same airlines more than
once by the same airlines.
18. Find the airlines that has sold out below 15 seats during the first
quarter of the year. (1st quarter means Jan to March)
19. Find the airlines that flies to the maximum number of destinations.
20. Find the most flown airlines for the year.
21. Find the frequently flown destination for the year.
22. Find the total number of flights being flown from Mumbai for the date
’20-10-2008’
23. Find the city from where maximum number of flights are departing.
24. Find the airlines that have flights departing from a destination and
arriving to another destination and back to the same destination.
25. Find the customers who are departing and going to a destination and
arriving back to the same destination on the same day.
26. Find the passengers who are flying to a destination by one airline and
returning back to the same destination by another airline.
27. Find the airlines which has flights to different destinations but departing
at the same time.
28. Calculate the bill for a passenger who has booked a flight from Delhi to
Kolkota by Jet Airways and flightid= F108 for 3 seats and update this
amount in the booking table.
29. What is cost to travel to Delhi from Mumbai and back by Jetairways for
one seat?
30. Write a trigger so that when a flight of a particular airline is being
deleted then if there exists records for that flight for a future date in the
bookings table then do not allow this records to be deleted. If there are
no records for the future date then allow the deletion.

You might also like