vet-clinic-database is a database which is reletional database created with postgreSQL. It create animal database and store the data in diffrent tables and fetch the data when required with the necessary queries.
-
- PostgreSQL
- [Create animals database]
- [Create Table with animal data]
- [Get data from the database]
To get a local copy of this project up and running, follow these steps.
-
- You need to have
PostgreSQLinstalled, you can follow the PostgreSQL Tutorial to install it on your machine.
- You need to have
-
Clone this repository to your desired folder:
git clone https://github.com/getssh/vet-clinic-database cd vet-clinic-database -
Start your
PostgreSQLCLI:psql postgres
PostgreSQLwill show theprompt:postgres=#Now you can start typing
SQLsentences. Happy querying! -
This repository includes files with plain SQL that can be used to recreate a database:
- Use schema.sql to create all tables.
CREATE DATABASE vet_clinic;
CREATE TABLE animals ( id INT GENERATED ALWAYS AS IDENTITY, name VARCHAR(50), date_of_birth DATE, escape_attempts INT, neutered BOOLEAN, weight_kg DECIMAL, PRIMARY KEY(id) );
- Use data.sql to populate tables with sample data.
INSERT INTO animals(name, date_of_birth, escape_attempts, neutered, weight_kg) VALUES ('Agumon', '02/03/2020', 0, true, 10.23);
- Check queries.sql for examples of queries that can be run on a newly created database.
SELECT * from animals WHERE name LIKE '%mon';
⚠️ Important note: this file might include queries that make changes in the database (e.g., remove records). Use them responsibly!
- Use schema.sql to create all tables.
👨💻 Getayawkal Tamrat
- GitHub: @getssh
- Twitter: @GetayawkalT
- LinkedIn: @getayawkal-tamrat
- Add more data to the database
- Write complex schema and quires
- Work with multiple tables
Contributions, issues, typos, and feature requests are welcome!
Feel free to check the issues page.
If you like the project please give it a start
- I would like to thank my mentors and follow students and coding partners
This project is MIT licensed.