An AI-powered web application that allows users to query financial data using natural language and get results directly from a SQL Server database with charts and KPIs.
- 🧠 Natural Language → SQL conversion
- 🗄️ SQL Server (SSMS) integration
- 📊 Interactive charts (Bar, Pie, Line)
- 📈 KPI dashboard (Total Rows, Max, Min)
- 📥 CSV export
- ⚡ Works without AI using fallback queries
- 🔐 SQL validation (only SELECT queries allowed)
- Frontend: HTML, CSS, JavaScript
- Backend: Python (Flask)
- Database: SQL Server (SSMS)
- Libraries: Pandas, PyODBC
- Visualization: Chart.js
- AI (Optional): Gemini API
- User enters a question in plain English
- System converts it into an SQL query
- SQL is validated to allow only safe operations
- Query runs on SQL Server database
- Results are displayed as:
- Table
- Charts
- KPI cards
- show top 10 records
- count by sentiment
- show company and sentiment
- top companies by news count
- sector wise sentiment count
AI-Financial-Data-Engineer-Chat/ │ ├── app.py ├── ai_to_sql.py ├── db_connect.py ├── validator.py ├── requirements.txt │ ├── templates/ │ └── index.html │ ├── static/ │ ├── style.css │ └── script.js
- Collected financial news dataset from Kaggle
- Loaded raw data into staging tables
- Cleaned and transformed data (null handling, formatting, type conversion)
- Created dimension tables:
- DimCompany
- DimDate
- DimSentiment
- DimSource
- DimSector
- DimImpactLevel
- DimMarketEvent
- Loaded fact table:
- FactNewsImpact
- Connected database with Flask application
- Visualized results using charts and KPI dashboard