1. Summary
This analysis explores the Iris dataset, which contains sepal and petal measurements for three species of iris flowers: Setosa, Versicolor, and Virginica. Using SQL, we examined distribution patterns, calculated species-specific statistics, identified outliers, and established a quartile-based clustering structure. This report highlights key findings that provide foundational insights for classification and clustering applications.
2. Dataset Overview
The dataset includes 150 records with measurements for:
- Sepal and Petal Length (cm)
- Sepal and Petal Width (cm)
- Species (Setosa, Versicolor, Virginica)
3. Analysis and Key Findings
3.1 Species Distribution
The dataset is evenly distributed across the three species, with each species represented by 50 samples. This balanced composition allows for unbiased comparative analysis.



3.2 Descriptive Statistics by Species
Distinctive size characteristics were observed for each species:
- Setosa: Exhibits smaller petal measurements compared to the other species, with narrower ranges across all attributes.
- Versicolor: Shows intermediate values, serving as a midpoint between Setosa and Virginica.
- Virginica: Has the largest average measurements for both sepals and petals, making it the most distinctive in terms of size.

3.3 Sepal and Petal Dimension Deviations
Within each species, deviations between sepal and petal dimensions were analyzed:
- Moderate deviations in measurements indicate some within-species variability.
- Consistent measurement relationships were found within certain species, which could support species classification efforts.

3.4 Quartile-Based Clustering
Each species’ samples were divided into quartiles based on sepal and petal dimensions:
- Quartile Clustering: This basic clustering approach can be foundational for classification models by segmenting samples into size-based clusters.
- Quartile groups highlight variations within species and can inform future clustering algorithms.

3.5 Outlier Detection Using IQR
Outliers were identified using the interquartile range (IQR) method:
- Certain samples in each species were detected as high or low outliers in either sepal or petal measurements.
- These outliers may represent unusual samples or possible data issues and warrant further examination if the dataset is to be used for predictive modeling.

4. Conclusions
The Iris dataset analysis revealed clear measurement distinctions between species and highlighted the usefulness of quartile-based segmentation for basic clustering. This analysis demonstrates foundational SQL techniques suitable for data segmentation and statistical exploration.
Explore more:
- View the full code for the project on Github