A relational database schema for tracking produce, producers and markets in Kenya.
# Horticultural-Produce-Market-SQL-Database-Project
A relational database schema for tracking produce, producers and markets in Kenya.
# 📗 Table of Contents
- My SQL Project
- 📗 Table of Contents
- 📖 My SQL Project
- 🛠 Built With
- Tech Stack
- Key Features
- 💻 Getting Started
- Prerequisites
- Setup
- Usage
- 👥 Authors
- 🔭 Future Features
- 🤝 Contributing
# 📖 My SQL Project
**My SQL Project** is a simple Database that uses SQL, Postgres via Supabase to create, query and secure a **Horticulture Produce, Producers, and Markets** database.
## 🛠 Built With
### Tech Stack
- SQL
- Postgres DB
### Key Features
- [ ] **Tables**
- [ ] **Schema**
- [ ] **Access control**
( back to top )
## 💻 Getting Started
To rebuild this DB, follow these steps.
### Prerequisites
To run this project, you need:
- A Supabase account
- Knowledge on SQL
- A schema for creating your tables in the DB
### Setup
Copy the contents of this Readme.md to your Project's file
OR
Clone this repository to your desired folder:
```sh
git clone [
github.com]
```
### DB Schema
- The DB is made up of 3 tables. Each table has 5 entries.
- To create the table, you will need a schema as shown below:
```sql
-- Drop old tables if they exist
DROP TABLE IF EXISTS producers CASCADE;
DROP TABLE IF EXISTS product CASCADE;
DROP TABLE IF EXISTS markets CASCADE;
-- create farm producers table
create table public.producers (
id serial primary key,
farm_name varchar (100) not null,
location varchar (100) not null,
produce_type varchar (50) not null,
contact_email varchar (100) not null
);
-- Create product catalog table
create table public.products (
id serial primary key,
product_name varchar (100) not null,
variety varchar (100),
harvest_season varchar (50) not null,
price_per_unit numeric (6, 2) not null,
producer_id int references public.producers(id) on delete cascade
);
-- Create markets table
create table public.markets …