Coder Social home page Coder Social logo

postgresql-project's Introduction

postgreSQL-project

Background

This was an assignment in a NoSQL course that covered the following databases: (1) PostgreSQL (2) MongoDB (3) CouchDB (4) Neo4J (5) Redis

And yes, I understand that PostgreSQL is not a "NoSQL" database. However, the course needed to include PostgreSQL as a contrast to the noSQL databases.

About this Project

In this project we were asked to populate a database with the following requirements:

  1. Create a minimum of 10,000 patients.
  2. 10% of the patients must be doctors.
  3. Doctors have a 35% chance of also being a patient.
  4. Create a minimum of 1,000 illnesses.
  5. Every patient will contract 0, 1, 2, or 3 illnesses with equal probabilities.
  6. If a patient has 1 or more illnesses, s/he must have 1 or more treatments assigned to each illness.
  7. The maximum number of treatments per illness is up to the creator.

Creating the Data

Python scripts were used to generate the 10,000 patients using the Python package Faker (https://faker.readthedocs.io/en/master/). This ensured person's identification information was realistic (instead of gobbledygook).

Faker was also used to generate diagnoses and treatments -- however in this case, the source files are real ICD-9 codes (which are used by the healthcare industry): http://www.icd9data.com

See Python scripts -- the random package was used to calculate probabilities (each doctor had a 35% probability of also being a patient), whether a patient was assigned 0-3 illnesses (these were equally weighted) and finally, randomly choosing 1000 illnesses from the ICD-9 diagnosis file.

Building the SQL database

  1. Database schema was created using files located in the Schemas folder
  2. CSV files were loaded into a postgreSQL database

Sample Queries

postgresql-project's People

Contributors

msgouros avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.