
🌾 Agriculture · Database ERD
A schema for a farm management app: farmers, plots, crop cycles, inputs applied, activities and harvests.
Drawing diagram…
ERD for farm records: Farmer owns Plots with area and soil type; CropCycle is one crop on a Plot in a season; InputApplication records seeds, fertilisers and pesticides applied with quantity and cost; Activity records sowing, irrigation and weeding with labour cost; Harvest records yield and sale price per cycle.
erDiagram
FARMER ||--o{ PLOT : owns
PLOT ||--o{ CROP_CYCLE : grows
CROP ||--o{ CROP_CYCLE : "planted as"
CROP_CYCLE ||--o{ INPUT_APPLICATION : uses
CROP_CYCLE ||--o{ ACTIVITY : includes
CROP_CYCLE ||--o| HARVEST : ends
PLOT {
int id PK
int farmer_id FK
decimal area_acres
string soil_type
}
CROP_CYCLE {
int id PK
int plot_id FK
int crop_id FK
string season
date sown_on
}
INPUT_APPLICATION {
int id PK
int cycle_id FK
string input_type
decimal quantity
decimal cost
}
HARVEST {
int cycle_id FK
decimal yield_quintals
decimal sale_price
}Where each part of a precision farming system runs: soil and weather sensors in the field, a solar-powered LoRaWAN gateway, and cloud services for irrigation and advice.
How produce moves from the farm to the buyer: harvest, grading, collection centre, mandi or online market, and payment to the farmer.
How satellite and drone imagery plus field sensors become crop health alerts and advice for farmers.
The states of an automated drip irrigation controller: idle, scheduled watering, moisture-based watering, rain delay and fault handling.
How a farmer checks crop prices across nearby mandis and books a sale: live prices, transport cost, best net price and booking.
A platform farmers use to plan crops, record field work and inputs, and get advisory and market prices.