Final DBMS Report
Final DBMS Report
PROJECT REPORT
Submitted by
BACHELOR OF TECHNOLOGY
in
COMPUTER SCIENCE ENGINEERING
SCHOOL OF COMPUTING
2
TABLE OF CONTENTS
3
1. Problem Statement
6
2. ER Diagram
16
3. Relational Tables and Schema
24
4. Complex queries based on the concepts of constraints,
sets, joins, views, Triggers and Cursors
31
5. identifying the dependencies, and applying
normalizations and anomalies
36
6. Code for the project
52
7. Result and Discussion
58
8. Online course certificate
3
1. PROBLEM STATEMENT
Manual Training and Placement which is done at various colleges is by human intervention due to
which there is a maximum chance of errors. The major problem is searching and updating of the
student data. Placement officers have to manage the student’s profile and their documents.
Placement Officer has to collect the information of various companies who comes for recruitment.
They have to arrange profiles of students according to various streams and notify them each time
according to company requirements. Placement officers submit the information of students and if
any changes or updates are required in the profile of any student, it has to be done manually. This
process is so difficult and tedious when the number of users increases. This is tedious and time
consuming. Chances of missing data are also possible. It is also difficult for collecting, managing,
and updating student data as the number of students increases. Placement Management System’
like many other placement management web sites, provides information on placement providers
and the placements and also keeps up to date information of all students. It is a platform where
students can view and assess their opportunities. The system will be having different types of
accounts for different types of users such as Admin, Student, HODs, and tutor. A profile for each
student is created with the necessary credentials for the portal. The system uses MySQL for
database management and will sort the data of the student based on eligibility criteria demanded by
the respective companies and a list of eligible candidates will be prepared and they can choose if
they are interested to attend that particular drive or test. Based on this a final data-set is created and
the interested candidates will be registered automatically by the system. This way it reduces the
work of college staff or faculty from the problems caused by human error and wastage of time
doing all processes manually.
Manual system in the colleges requires a lot of manpower and time. With this project we aim to
develop a web portal to solve this issue. The project is aimed at developing an application for the
placement department of the college. The system is an application which will be accessed and
effectively used throughout the organization with proper login enabled. It can also be used as an
application for the Placement Officers in the college to manage the student information about
placement thus reducing the manual work and consumes less paperwork. The system also provides
the facility of viewing the personal and academic information of the student. The system gets the
requested list of candidates for the companies who would like to recruit the people according to
their eligibility criteria.
4
1.1 Project Overview
Placement Management System manages student information in the college with regard to
placement. It improves existing system .It has the facility of maintaining the details of the student,
thereby reducing the manual work. It will save time and energy which are spending in making
reports and collecting data. Placement Management System can be accessed throughout the college
with proper login provided.
The main objective of the placement management system is to reduce manual work and time. It is
difficult and time-consuming to collect all the details from each student. To avoid this problem we
have planned to develop a web-based placement management system. Easy to find out the list of
eligible students attending the drives.It manages the details of student records, placement training,
different placements happening in and out of the college. Saves the time of placement officer and
faculties. Reduces the manual works. This system makes student information more secure.
In colleges the records were stored in excel sheets hence sorting the data is always a problem. The
excel sheets are also less advanced. Hence sorting and searching problems arises. Updating Records
is another tedious task. Due to the above problems the updating was very difficult and ambiguous.
Data redundancy also occurs due to the duplication of files and records. The files were not stored in
a hierarchical format, hence searching the eligible students was the greatest problem . The
placement officer has to find out the eligible students by looking at the excel sheet. He/she has to
see the marks of every student and their eligibility. Another problem students face is that they are
not made aware of the Training and Placement activity held in their institutions, hence there might
have been a loss of opportunities. There is also a large communication gap between students and
the placement officers as it is difficult to maintain coordination between them. The existing system
is also inefficient as it could not take acknowledgment from the students attending a particular
drive. Hence lots of confusion at the last moment also arises. As all this is done manually, there is a
lot of workload on the placement officer. The existing method used for placement management is
not computerized [2]. All the records are main- trained manually. The departments or the
management carry out this job manually making it more complicated and tedious most of the time.
The best solution here is to computerize the current environment.
2.ER Diagram
5
2.1 Entity and Their Attributes
1.Recruiters (Employers):
Represents employer organizations recruiting for job positions.
Attributes: Company Name, Company ID (Primary Key), Contact Information (Multi-
valued), Company rank.
3.Departments:
Represents organizational units within academic institutions or companies.
Attributes: Department ID (Primary key), Head of Department Name (BreakDown),
Department Contact (Multivalues).
4.Jobs:
Represents available job positions.
Attributes: Job ID (Primary Key), Application number (Foreign Key), salary, Job titles
(Multivalued), Position, Job requirements (Multivalued), Status.
5.Resumes/CVs:
Represents documents containing educational and professional background.
Attributes: Student ID (Foreign Key), Resume ID (Primary Key), Projects, Education,
Experience.
6.Placement Offers:
6
Represents offers extended to students for job positions.
Attributes: Offer ID (Primary Key), Company ID (Foreign Key), Salary, Acceptance Status,
Start Date, Position.
9.Events:
Represents career-related events.
Attributes: Event ID (Primary Key), Company ID (Foreign Key), Event Name, Event
Location, Event Date.
10.Applications:
Represents submissions made by students for job positions.
Attributes: Application Number (Primary Key), Student ID (Foreign Key), Application
Date.
11.Roles:
Represents roles assigned to students within companies.
Attributes: Role ID (Primary Key), Student ID (Foreign Key), Company ID (Foreign Key)
7
2.2 Relationships in ER along with their cardinalities:
An employee working in recruitment can recruit many students for various job openings.
A job opening typically offers a single specific position within a company (e.g., Software
Engineer).
A job opening can have many required roles (e.g., software engineer needs skills in Java
and Python).
A company might have various roles across different departments (e.g., marketing,
engineering).. This means that post can contain any number of likes and tags.
8
ER Diagram :
9
3. Relational Tables and Schema
10
3.1.1 Schema
Entities :
1.Student Entity:
Student ID (Primary key), Date of Birth, Skills (Multi-Valued), CGPA, Name (First Name
and Last Name).
2.Employer Entity:
Company Name, Company ID (Primary Key), Contact Information (Multi-valued),
Company rank.
5.Resume/CV Entity:
Student ID (Foreign Key), Resume ID (Primary Key), Projects, Education, Experience.
11
9.Events Entity:
Event ID (Primary Key), Company ID (Foreign Key), Event Name, Event Location, Event
Date.
10.Applications Entity:
Application Number (Primary Key), Student ID (Foreign Key), Application Date.
11.Roles Entity:
Role ID (Primary Key), Student ID (Foreign Key), Company ID (Foreign Key), Student
Role, Company Role.
Student Table:
Employer Table:
12
PlacementCoordinator Table:
Job Table:
ResumeCV Table:
PlacementOffer Table:
13
CREATE TABLE PlacementOffer (
OfferID INT PRIMARY KEY,
CompanyID INT,
Salary DECIMAL(10, 2),
AcceptanceStatus VARCHAR(50),
StartDate DATE,
Position VARCHAR(100)
);
Feedback Table:
PlacementRecord Table:
Events Table:
14
);
Applications Table:
Roles Table:
15
3.2 Relational Tables Structure and Content :
3.2.1 SKILLS
3.2.2DEPARTMENT
16
3.2.3 DEPARTMENT CONTACT
3.2.4 JOB
17
3.2.5.JOBTITLES
3.2.6.REQUIREMENTS
3.2.8.PLACEMENT_OFFERS
19
3.2.9.FEEDBACK
3.2.10.RECORDS
20
3.2.11EVENT
3.2.12APPLICATION
21
3.2.13.ROLE
3.2.14.COMPANY
22
3.2.15.COMPANY_CONTACT
3.2.16.STUDENT
23
4.Complex Queries
4. 1.Nested Queries
SQL command
Retrieve students who applied for jobs offered by companies ranked higher than 5
Result
SQL command
Retrieve the names of students who have applied for jobs
Result
24
4.2.Correlated Quires
SQL command
Find all companies along with the count of placement offers they have made:
Result
4.3 Trigger
SQL command
calculate the number of companies a student has applied to and updates a column in the
students table accordingly
25
SQL command
Trigger to log changes made to the applications table
SQL command
Trigger to update a student's age when their date of birth is modified
26
4.4 Cursor
SQL command
cursor to find the number of events held by each company
SQL command
Get all events along with the corresponding company name:
Resultt
27
4.6 Left Join
SQL command
Retrieve all records of placement offers along with the corresponding student's name and the
company name. Include records without associated students or companies:
Result
SQL command
Get all students along with the corresponding feedbacks. Include students without associated
feedbacks:
Result
28
4.8 Set Operation: UNION ALL
SQL command
Merge data from events and job titles with a common column 'event_id' and 'job_title_id':
Result
4.9 PL SQL
SQL command
retrieves the count of applications for each student and stores the result in a separate table
29
4.10 View
SQL command
Result
30
5 Identifying Functional Dependencies
31
6. In the PlacementOffer table:
32
5.1 Normalization
4.12.1 1 NF
Event Table
Result
In the Event table, normalization has been applied by decomposing the event location
into separate attributes: event_place and event_pincode, along with event_city.
4.12.2 2NF
Result
To achieve second normal form (2NF) in the offer table, a separate company table is
created with the attributes cmp_id, cmp_name, and cmp_rank, where cmp_id acts as a
foreign key in the offer table.
4.12.3 3NF
33
Result
To ensure data consistency and reduce redundancy, the Student table has been
normalized to the third normal form (3NF). A separate Department table has been
created, containing unique department identifiers (dept_id) and corresponding
department names (dept_name).
4.12.4 4NF
Company Contact
Result
34
dependencies.
5.2 Anomalies
1. Insertion Anomalies:
Functional Dependency Violation: If the jobs_applied table has a functional dependency between
app_number and job_id, inserting a new job application without a corresponding job ID could lead
to an inconsistency.
inserting a new record in the placement_offers table with a cmp_id that does not exist in the
companies table would lead to such an anomaly.
2.Deletion Anomalies:
deleting a record from the students table might result in the loss of information about the student's
past applications, skills, or roles.
deleting a record from the companies table without considering the related records in the
company_contact table could leave orphaned records.
3.Update Anomalies:
if a student's contact information is updated in the students table but not in the records table, the
data would become inconsistent.
35
6.Code for Project
import tkinter as tk
from tkinter import messagebox
import mysql.connector
from datetime import datetime
class PlacementManagementSystem:
def __init__(self, root):
self.root = root
self.root.title("Placement Management System")
self.root.geometry("300x200")
# Database connection
self.db_connection = mysql.connector.connect(host="localhost", user="root",
passwd="Noone@121003", auth_plugin='mysql_native_password', db="placement-management")
self.cursor = self.db_connection.cursor()
def student_login_page(self):
# Clear main menu frame
self.main_menu_frame.destroy()
36
# Create student login frame
self.student_login_frame = tk.Frame(self.root)
self.student_login_frame.pack()
def recruiter_login_page(self):
# Clear main menu frame
self.main_menu_frame.destroy()
37
self.password_label.grid(row=1, column=0)
self.password_entry = tk.Entry(self.recruiter_login_frame, show="*")
self.password_entry.grid(row=1, column=1)
def student_login(self):
username = self.username_entry.get()
password = self.password_entry.get()
if student:
messagebox.showinfo("Success", "Student Login successful!")
self.show_student_dashboard()
else:
messagebox.showerror("Error", "Invalid student username or password")
def show_student_dashboard(self):
# Clear student login frame
self.student_login_frame.destroy()
38
self.profile_button.grid(row=0, column=0)
def edit_student_profile(self):
# Fetch student's username from the database
query = "SELECT username FROM student_login"
self.cursor.execute(query)
student_username = self.cursor.fetchone()
if student_username:
# Fetch student's profile information from the database
query = "SELECT * FROM students WHERE student_id = %s"
self.cursor.execute(query, (student_username[0],))
student_profile = self.cursor.fetchone()
if student_profile:
# Create a new window for editing the profile
edit_window = tk.Toplevel(self.root)
39
edit_window.title("Edit Student Profile")
else:
messagebox.showerror("Error", "Failed to fetch student profile")
else:
messagebox.showerror("Error", "Student username not found in the database")
40
self.db_connection.commit()
if student_username:
# Fetch student's profile information from the database
query = "SELECT * FROM students WHERE student_id = %s"
self.cursor.execute(query, (student_username[0],))
student_profile = self.cursor.fetchone()
if student_profile:
messagebox.showinfo("Student Profile", f"Student ID: {student_profile[0]}\n"
f"Student CGPA: {student_profile[1]}\n"
f"Student First Name: {student_profile[2]}\n"
f"Student Last Name: {student_profile[4]}\n"
f"Student Age: {student_profile[3]}\n"
f"Student DOB: {student_profile[5]}\n"
f"Department ID: {student_profile[6]}\n")
else:
messagebox.showerror("Error", "Failed to fetch student profile")
else:
messagebox.showerror("Error", "Student username not found in the database")
def recruiter_login(self):
username = self.username_entry.get()
password = self.password_entry.get()
41
# Check recruiter login credentials
query = "SELECT * FROM recruiter_login WHERE username = %s AND password = %s"
self.cursor.execute(query, (username, password))
recruiter = self.cursor.fetchone()
if recruiter:
self.recruiter_username = username # Store recruiter's username
messagebox.showinfo("Success", "Recruiter Login successful!")
self.show_recruiter_dashboard()
else:
messagebox.showerror("Error", "Invalid recruiter username or password")
def show_recruiter_dashboard(self):
# Clear recruiter login frame
self.recruiter_login_frame.destroy()
42
self.view_offers_button = tk.Button(self.recruiter_dashboard_frame, text="View Offers
Posted", command=self.view_recruiter_jobs)
self.view_offers_button.grid(row=0, column=3)
def show_company_profile(self):
# Fetch company details from the database
query = "SELECT * FROM company_contact"
self.cursor.execute(query)
company_profile = self.cursor.fetchone()
if company_profile:
messagebox.showinfo("Company Profile", f"Company Name: {company_profile[0]}\n"
f"Company Email: {company_profile[1]}\n"
f"Company Phone: {company_profile[2]}")
else:
messagebox.showerror("Error", "Company profile not found")
def edit_company_profile(self):
# Fetch recruiter's username from the database
query = "SELECT username FROM recruiter_login"
self.cursor.execute(query)
recruiter_username = self.cursor.fetchone()
if recruiter_username:
# Fetch company profile information from the database
query = "SELECT * FROM company_contact WHERE cmp_id = %s"
self.cursor.execute(query, (recruiter_username[0],))
43
company_profile = self.cursor.fetchone()
if company_profile:
# Create a new window for editing the company profile
edit_window = tk.Toplevel(self.root)
edit_window.title("Edit Company Profile")
else:
messagebox.showerror("Error", "Failed to fetch company profile")
else:
messagebox.showerror("Error", "Recruiter username not found in the database")
44
query = "UPDATE company_contact SET cmp_mail_id = %s, cmp_phone_number = %s
WHERE cmp_id = %s"
self.cursor.execute(query, (updated_profile[1], updated_profile[2], updated_profile[0]))
self.db_connection.commit()
def post_job_offer(self):
# Create a new window for posting job offers
post_window = tk.Toplevel(self.root)
post_window.title("Post Job Offer")
# Submit button
submit_button = tk.Button(post_window, text="Submit", command=lambda:
self.submit_job_offer(entries))
submit_button.grid(row=len(labels), columnspan=2)
45
# Insert job offer into placement_offers table
query = "INSERT INTO placement_offers (cmp_id, offer_salary, offer_status,
offer_start_date, offer_position) VALUES (%s, %s, %s, %s, %s)"
self.cursor.execute(query, (company_id, salary, status, start_date, position))
self.db_connection.commit()
if recruiter_username:
# Fetch job offers posted by the recruiter from the database
query = "SELECT * FROM placement_offers WHERE cmp_id = %s"
self.cursor.execute(query, (recruiter_username[0],))
recruiter_jobs = self.cursor.fetchall()
if recruiter_jobs:
# Display job offers in a new window
jobs_window = tk.Toplevel(self.root)
jobs_window.title("Recruiter Jobs")
46
# Display job offers in the text widget
for job in recruiter_jobs:
jobs_text.insert(tk.END, f"Salary: {job[1]}\n")
jobs_text.insert(tk.END, f"Status: {job[2]}\n")
jobs_text.insert(tk.END, f"Start Date: {job[3]}\n")
jobs_text.insert(tk.END, f"Position: {job[4]}\n\n")
def view_all_job_offers(self):
# Fetch all job offers from the database
query = "SELECT * FROM placement_offers"
self.cursor.execute(query)
all_job_offers = self.cursor.fetchall()
if all_job_offers:
# Display job offers in a new window
job_offers_window = tk.Toplevel(self.root)
job_offers_window.title("All Job Offers")
47
job_offers_text.insert(tk.END, f"Offer ID: {job_offer[0]}\n")
job_offers_text.insert(tk.END, f"Company Name: {job_offer[5]}\n")
job_offers_text.insert(tk.END, f"Salary: {job_offer[1]}\n")
job_offers_text.insert(tk.END, f"Status: {job_offer[2]}\n")
job_offers_text.insert(tk.END, f"Start Date: {job_offer[3]}\n")
job_offers_text.insert(tk.END, f"Position: {job_offer[4]}\n\n")
def apply_for_job_window(self):
# Create a new window for applying for a job
apply_window = tk.Toplevel(self.root)
apply_window.title("Apply for Job")
48
student_username = self.cursor.fetchone()
if student_username:
# Get the current date and time
current_date = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
def view_applied_companies(self):
# Get student's username from the database
query = "SELECT username FROM student_login"
self.cursor.execute(query)
student_username = self.cursor.fetchone()
if student_username:
# Fetch companies applied by the student
query = """
SELECT DISTINCT companies.cmp_name
FROM applications
JOIN placement_offers ON applications.offer_id = placement_offers.offer_id
JOIN companies ON placement_offers.cmp_id = companies.cmp_id
WHERE applications.student_id = %s
"""
self.cursor.execute(query, (student_username[0],))
49
applied_companies = self.cursor.fetchall()
if applied_companies:
company_names = [company[0] for company in applied_companies]
messagebox.showinfo("Applied Companies", "\n".join(company_names))
else:
messagebox.showinfo("Applied Companies", "You haven't applied to any companies
yet.")
else:
messagebox.showerror("Error", "Student username not found in the database")
def view_applied_students(self):
if self.recruiter_username:
# Fetch students who have applied for jobs posted by the recruiter
query = """
SELECT DISTINCT students.student_id, students.student_first_name,
students.student_last_name
FROM applications
JOIN students ON applications.student_id = students.student_id
JOIN placement_offers ON applications.offer_id = placement_offers.offer_id
WHERE placement_offers.cmp_id = %s
"""
self.cursor.execute(query, (self.recruiter_username,))
applied_students = self.cursor.fetchall()
if applied_students:
student_info = [f"{student[0]} - {student[1]} {student[2]}" for student in
applied_students]
messagebox.showinfo("Applied Students", "\n".join(student_info))
else:
50
messagebox.showinfo("Applied Students", "No students have applied for jobs posted by
you yet.")
else:
messagebox.showerror("Error", "Recruiter username not found. Please log in again.")
if __name__ == "__main__":
root = tk.Tk()
app = PlacementManagementSystem(root)
root.mainloop()
51
7.Result and Discussion
The frontend features a homepage with distinct buttons for accessing the student and recruiter login
portals, providing streamlined access for respective users.
Upon selection of either the student or recruiter login button, users are directed to a login page
prompting entry of username and password credentials.
52
Figure 7.3 User Dashboard Page
For student login, options encompass viewing the profile, editing it, applying for jobs, accessing all
job offers, and viewing applied companies.
For recruiter login, options include editing the company profile, posting job offers, viewing posted
offers, and reviewing applied students.
53
Figure 7.5 Post Job Offer Page
To post a job offer, recruiters are required to input company ID along with details such as salary,
status, start date, and position.
Recruiter jobs are updated with changes to salary, start date, position, and status, ensuring accurate
representation of job offers.
54
Figure 7.7Successful Login pop up
Upon successful login, a pop-up message confirms the user's successful authentication, providing
immediate feedback to the user.
The "All Jobs Offered" page displays a comprehensive list of job offers, including offer ID,
company name, salary, status, start date, and position, providing users with detailed information
about available employment opportunities.
55
Figure 7.9 Apply Page
To apply for a job, users are prompted to enter the offer ID corresponding to the desired position,
facilitating a streamlined application process.
The "User Details" page showcases essential student information, featuring fields such as student
ID, registration number, GPA, and department affiliation, providing comprehensive insights into
individual student profiles.
56
Figure 7.11 Entities and Views
57
8. Online course certificate
Reg No:RA2211026010312
Name:Khushi Upadhyay
58
Reg No:RA2211026010316
Name:Naman Nanda
59