This project analyzes agricultural data to understand the impact of rainfall, fertilizer usage, and season on crop yield and farmer profit. The goal is to help farmers and policymakers make data-driven decisions using SQL.
- Database: MySQL 8.0
- Tool: MySQL Workbench
- Visualization: Microsoft Excel
- Concepts Used: JOIN, GROUP BY, AVG, ORDER BY, LIMIT, Aggregate Functions
The database agrianalytics contains 4 tables:
- farmers - Farmer details like name, district, land_acres
- crops - Crop details like crop_name, season
- yield - Yield data, fertilizer_used, market_price
- weather_data - Rainfall and temperature data
- District wise Yield: Thanjavur district has the highest Rice yield of 4.5 tons/acre
- Weather Impact: Higher rainfall 120.5mm correlated with higher yield
- Fertilizer vs Profit: Farmers using 90kg fertilizer earned highest income of ₹1,54,000
- Season Analysis: Kharif season crops have better average yield than Rabi
- Top Performers: Top farmer profit recorded was ₹12,32,000
ER Diagram is used to visualize the relationships between Farmers, Crops, Yield, Rainfall, and Fertilizer tables.

- 5 Tables: Farmers, Crops, Yield, Rainfall, Fertilizer
- 5 SQL Queries: JOINs, Aggregations, Subqueries for data analysis
- Insights: Top profitable crops, low rainfall areas, fertilizer ROI
- MySQL
- ER Diagram
All query outputs are available in the Screenshots folder.
- Import
agri_analytics_sql_project.sqlin MySQL - Run the queries and compare with screenshots