Giter Site home page Giter Site logo

vet-clinic-database's Introduction

Vet clinic database

A database SQL file for vet clinic visitors and pets

In this exercise we are implementing performance improvements on the sql databases

screenshot screenshot screenshot

Built With

  • postgreSQL
  • SQL
  • Pg Admin

Getting Started

To get a local copy up and running follow these simple example steps.

Prerequisites

  • Postgres
  • PG Admin
  • Terminal

Usage

Clone the project by typing in your terminal git clone https://github.com/SunnySparks/Vet-clinic-database.git.

  • Change directory cd into the folder just created from the project.

  • Open postgreSQL

  • Create the database using the schema.sql file

  • Add the email column inside the owners table by typing ALTER TABLE owners ADD COLUMN email VARCHAR(120);

  • Populate your database by adding the following commands INSERT INTO visits (animal_id, vet_id, date_of_visit) SELECT * FROM (SELECT id FROM animals) animal_ids, (SELECT id FROM vets) vets_ids, generate_series('1980-01-01'::timestamp, '2021-01-01', '4 hours') visit_timestamp; and insert into owners (full_name, email) select 'Owner ' || generate_series(1,2500000), 'owner_' || generate_series(1,2500000) || '@mail.com';

  • To check the performance, run

explain analyze SELECT COUNT(*) FROM visits where animal_id = 4;

explain analyze SELECT * FROM visits where vet_id = 2;

explain analyze SELECT * FROM owners where email = '[email protected]';

Authors

๐Ÿ‘ค Sunny Dรญaz

๐Ÿ‘ค Rocio Martinez

Contributions, issues, and feature requests are welcome!

Feel free to check the issues page.

Show your support

Give a โญ๏ธ if you like this project!

Acknowledgments

  • Use of SQL databases
  • Improvement on database queries performance

๐Ÿ“ License

This project is MIT licensed.

vet-clinic-database's People

Contributors

sunnysparks avatar rocio01 avatar

Stargazers

 avatar

Watchers

James Cloos 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.