Guru Gobind Singh Indraprastha
University
Practical File
Database Management
Lab
Code - “ PC - 251”
Submitted by-
Garv Chawla
01616451924
[Link]
CSE - DS
3rd Semester
Experiment - 1
Title: Writing the installation steps for PostgreSQL(custom
installation)
● Required Tools and Dependencies
1. Compiler Suite
2.Strawberry Perl
3.Bison and Flex
1. Obtain the Source code:
● Download the latest stable release tarball from
[Link] (choose
[Link] or [Link].bz2).
● Unpack the file using a tool like 7-Zip
● Change into the source directory: cd postgresql-version.
2.Open the Developer Command Prompt
Search for and open the "x64 Native Tools Command
Prompt for VS 2022". This has all the necessary environment
variables for the compiler.
3.Run the Build Script
Navigate to the postgres\src\tools\msvc directory within
the command prompt. Run the build script.
4.Install the Compiled Files
Once the build is complete, run the install script. For this,
you must provide a path where the final program files will
be placed.
5.Add the Bin Directory to your PATH
In this, you have to manually add the bin directory of your
new installation (e.g., C:\pgsql\bin) to your Windows PATH
environment variable.
6. Manually Initialise and Start the Server
● Create a data directory: mkdir C:\pgsql\data
● Initialise the cluster: [Link] -D C:\pgsql\data
-U postgres -W
● Start the server: pg_ctl.exe -D C:\pgsql\data -l
[Link] start
● Create a database: [Link] -U postgres
mydatabase
● Connect: [Link] -U postgres mydatabase
Experiment - 2
Title: To draw the ER Diagram for EMPLOYEE Management
System.
A company is organised into DEPARTMENTS, each with a unique
name, annual budget, department type, and multiple possible
locations. Each department is managed by one employee at a
time, but to handle changes such as firing, promotions, or
reassignments, the management tenure is tracked with a start
date and an end date.
Each department controls multiple PROJECTS. Projects have a
unique name, project number, budget, start date, end date,
status, and a single primary location. Projects may also be
associated with external CLIENTS for contract-based work.
For EMPLOYEES, the company records: first name, middle initial,
last name, social security number (SSN as primary key), address,
salary, sex, birth date, hire date, termination date, position/title,
and a multivalued set of skills. Each employee is assigned to
one primary department but can work on multiple projects (not
necessarily controlled by their department). To accurately track
and calculate work hours—especially if an employee switches
projects mid-week or mid-month—the daily hours worked on
each project are recorded, along with assignment start and end
dates for each project engagement. This allows computation of
weekly totals, monthly aggregates, overall working hours per
employee, or per-project contributions. Employees have an
immediate supervisor (another employee), and this supervision
relationship includes a start date and end date to track
changes in reporting structure.
For health insurance and benefits purposes, DEPENDENTS of
employees are tracked, including: dependent name, birth date,
sex, relationship to the employee, and insurance coverage
status. An employee can have multiple dependents, and
dependents may be shared in cases of joint custody, but
primarily linked to one employee for benefits.
CLIENTS as an entity: each client has a unique ID, name,
address, contact person, phone number, and email. Clients can
sponsor multiple projects, and projects can have one or more
clients (e.g., joint ventures). Additionally, LOCATIONS are now a
separate entity to handle shared or detailed tracking: each
location has an address, city, state, zip code, and capacity (e.g.,
number of employees it can support). Departments can be
associated with multiple locations, projects with one primary
location, and employees may have a preferred work location.
WORK_LOGS to granularly track daily work: tied to the
employee's project assignments, with date, hours worked, and
notes (e.g., task description). This enables precise calculations
for payroll, performance reviews, and project costing.
ER Diagram representation of Employee Management
System
Conclusion: The ER diagram provides a structured overview of
a library management system, showing how each entity is
related to others.