# Vehicle Database - Getting Started Guide

## Overview
This project provides a comprehensive database system for storing information about vehicle brands, models, years, and engines. The database is built using SQLite and managed through Python scripts.

## Database Structure
The database consists of five main tables:
- **brands**: Vehicle manufacturers (Toyota, Ford, etc.)
- **models**: Vehicle models (Camry, F-150, etc.)
- **engines**: Engine specifications (2JZ-GTE, EcoBoost, etc.)
- **years**: Calendar years for vehicle production
- **model_year_engine**: Junction table linking all entities with trim levels and specifications

## Setup and Usage

### 1. Initial Setup
Run the setup script to initialize the database:
```bash
cd vehicle_database
./setup.sh
```

### 2. Querying the Database
Use the interactive query interface:
```bash
python3 scripts/query_interface.py
```

The query interface allows you to:
- Search for vehicles by brand, model, year, or engine
- Browse all available brands
- View models for specific brands
- See production years for specific models

### 3. Managing the Database
Use the database manager for programmatic access:
```bash
python3 scripts/database_manager.py
```

### 4. Importing Data
To import data from CSV files:
1. Prepare your data in the required CSV format
2. Use the CSV importer functionality in your own scripts

Sample CSV files are provided in the `data/` directory.

## Example Queries

The system supports various search options:
- Find all vehicles by a specific brand
- Search for a specific model across all years
- Filter by engine type or specifications
- Look up trim levels and drivetrain configurations

## Extending the Database

To add more data:
1. Use the Python API in `scripts/database_manager.py`
2. Directly execute SQL commands on the SQLite database
3. Import data from CSV files using the structure provided

## File Structure
```
vehicle_database/
├── sql/
│   └── schema.sql          # Database schema
├── scripts/
│   ├── database_manager.py # Main database manager
│   ├── query_interface.py  # Interactive query interface
│   └── csv_importer.py     # CSV import functionality
├── data/                   # Sample CSV data files
├── vehicle_database.db     # SQLite database file
├── setup.sh               # Setup script
└── README.md              # Project documentation
```

## Next Steps
1. Explore the database using the query interface
2. Add your own vehicle data
3. Customize the schema if needed for your specific requirements
4. Extend the Python scripts with additional functionality