https://github.com/panoschron97/company_project_pl_pg_sql
A company management system with PL/pgSQL.
https://github.com/panoschron97/company_project_pl_pg_sql
pgadmin4 plpgsql postgresql sql
Last synced: 6 months ago
JSON representation
A company management system with PL/pgSQL.
- Host: GitHub
- URL: https://github.com/panoschron97/company_project_pl_pg_sql
- Owner: panoschron97
- Created: 2025-03-01T13:51:30.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-10-22T17:49:30.000Z (6 months ago)
- Last Synced: 2025-10-22T18:25:23.753Z (6 months ago)
- Topics: pgadmin4, plpgsql, postgresql, sql
- Language: PLpgSQL
- Homepage:
- Size: 50.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Company project PL/pgSQL
This repository contains PL/pgSQL code for a company project. It provides a structured database schema and sample data for managing companies, locations, departments, projects and employees along with logging and access control mechanisms.
## Features
- Database schema creation for `Companies`, `Locations`, `Departments`, `Projects` and `Employees`.
- Logging tables and triggers to track data manipulation statements.
- Functions and procedures for data retrieval and manipulation.
- User roles and access control using views and grants.
- Sample data insertion for demonstration purposes.
## Table of Contents
- [Installation](#installation)
- [Usage](#usage)
- [Dependencies](#dependencies)
## Installation
To set up the project, follow these steps:
1. Clone the repository:
```bash
git clone https://github.com/panoschron97/Company_Project_PL_pg_SQL.git
cd Company_Project_PL_pg_SQL
```
2. Install PostgreSQL:
Ensure you have PostgreSQL installed and configured on your system.
3. Create the database and users:
Run the SQL script `Company_Project_PL_pg_SQL.sql` in a PostgreSQL environment to create the database, users and tables.
```bash
psql -U postgres -f Company_Project_PL_pg_SQL.sql
```
## Usage
After installation connect to the `Company_Project_PL_pg_SQL` database with the appropriate user credentials to execute queries and manage the data.
Example queries:
```sql
-- Select all companies
SELECT * FROM Companies;
-- Select all employees
SELECT * FROM Employees;
-- Call a procedure to increase salaries
CALL IncreaseSalaries(100.00);
```
## Dependencies
- **PostgreSQL:** A powerful open-source relational database system.