Skip to content

This project involves structuring a heart attack risk dataset from Kaggle into a relational SQL database with multiple tables, setting primary and foreign keys for data integrity, and adjusting data types for optimized analysis and application use.

License

Notifications You must be signed in to change notification settings

lsawfa/HeartRiskDB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Heart Attack Risk Database

This project involves the segmentation of a dataset into multiple tables, which are then imported into an SQL database, with primary and foreign keys set up for relational integrity. The dataset was sourced from Kaggle and is structured to facilitate efficient data analysis.

Table Structure

1. HealthMetrics

  • Columns:
    • PatientID (VARCHAR, Primary Key, Foreign Key)
    • Cholesterol (INT)
    • BloodPressure (VARCHAR)
    • HeartRate (INT)
    • Triglycerides (INT)
    • BMI (DOUBLE)

2. Lifestyle

  • Columns:
    • PatientID (VARCHAR, Primary Key, Foreign Key)
    • Smoking (BOOLEAN)
    • Obesity (BOOLEAN)
    • AlcoholConsumption (BOOLEAN)
    • Diet (VARCHAR)
    • PhysicalActivityDaysPerWeek (INT)
    • SleepHoursPerDay (DOUBLE)
    • SedentaryHoursPerDay (DOUBLE)
    • ExerciseHoursPerWeek (DOUBLE)

3. MedicalHistory

  • Columns:
    • PatientID (VARCHAR, Primary Key, Foreign Key)
    • Diabetes (BOOLEAN)
    • PreviousHeartProblems (BOOLEAN)
    • MedicationUse (BOOLEAN)
    • StressLevel (INT)

4. Patients

  • Columns:
    • PatientID (VARCHAR, Primary Key)
    • Age (INT)
    • Sex (VARCHAR)
    • FamilyHistory (BOOLEAN)
    • Country (VARCHAR)
    • Continent (VARCHAR)
    • Hemisphere (VARCHAR)

5. RiskAssessment

  • Columns:
    • PatientID (VARCHAR, Primary Key, Foreign Key)
    • HeartAttackRisk (BOOLEAN)

6. SocioeconomicStatus

  • Columns:
    • PatientID (VARCHAR, Primary Key, Foreign Key)
    • Income (INT)

Relationships

  • Primary Keys:

    • Each table has a PatientID as the primary key, ensuring that each record is uniquely identifiable.
  • Foreign Keys:

    • The PatientID in HealthMetrics, Lifestyle, MedicalHistory, RiskAssessment, and SocioeconomicStatus tables serves as a foreign key that references the PatientID in the Patients table. This enforces referential integrity across the database.

Dataset Source

The dataset used in this project was sourced from Kaggle. It was split into several tables to normalize the data structure, improve query performance, and make the data easier to manage.

Database Modifications

  • The data types were adjusted to match the intended use case (e.g., converting certain integer columns to BOOLEAN where applicable).
  • Primary keys and foreign keys were established to maintain data integrity and relationships between tables.

How to Use

  1. Import the SQL files into your database management system.
  2. The database is ready for use with any SQL-based queries for analysis, reporting, or application development.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18

About

This project involves structuring a heart attack risk dataset from Kaggle into a relational SQL database with multiple tables, setting primary and foreign keys for data integrity, and adjusting data types for optimized analysis and application use.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published