Skip to content

About

PostgreSQL database and Bash script for a salon appointment booking system.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Salon Database

This repository contains the PostgreSQL database dump and the Bash script for a salon appointment booking system.

Database Structure

The salon database contains 3 tables with relational links (Primary & Foreign Keys):

  • customers: Salon customers (customer_id SERIAL primary key, phone UNIQUE, name).
  • services: Services that the salon provides (service_id SERIAL primary key, name).
  • appointments: Booked appointments (appointment_id SERIAL primary key, customer_id and service_id as foreign keys to customers and services, time).

How to Rebuild the Database

To restore the database from the SQL dump, execute the following command in a terminal where PostgreSQL is installed:

psql -U postgres < salon.sql

Usage

Make the script executable and run it:

chmod +x salon.sh
./salon.sh

How It Works

  1. The script shows a numbered list of services taken from the database.
  2. The customer selects a service, enters a phone number and a preferred time.
  3. If the phone number is not in the database yet, the script asks for the customer's name and saves the new customer.
  4. The appointment is saved and the script prints a confirmation, for example: I have put you down for a Cut at 10:30, Ivan.

Project Structure

.
├── salon.sh      # Interactive script
├── salon.sql     # Database dump
└── README.md

Technologies

PostgreSQL, Bash, SQL

About

PostgreSQL database and Bash script for a salon appointment booking system.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages