https://github.com/getssh/vet-clinic-database
https://github.com/getssh/vet-clinic-database
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/getssh/vet-clinic-database
- Owner: getssh
- Created: 2023-05-10T22:28:03.000Z (almost 3 years ago)
- Default Branch: dev
- Last Pushed: 2023-05-15T15:32:20.000Z (almost 3 years ago)
- Last Synced: 2025-07-06T03:05:46.014Z (9 months ago)
- Language: PLpgSQL
- Size: 23.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 📗 Table of Contents
- [� Table of Contents](#-table-of-contents)
- [vet-clinic-database ](#vet-clinic-database-)
- [🛠 Built With ](#-built-with-)
- [💻 Getting Started ](#-getting-started-)
- [👥 Author(s) ](#-authors-)
- [🔭 Future Features ](#-future-features-)
- [🤝 Contributing ](#-contributing-)
- [⭐️ Show your support ](#️-show-your-support-)
- [🙏 Acknowledgments ](#-acknowledgments-)
- [📝 License ](#-license-)
**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
- ### Key Features
- **[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.
- ### Prerequisites
- You need to have `PostgreSQL` installed, you can follow the [PostgreSQL Tutorial](https://www.postgresqltutorial.com/) to install it on your machine.
- ### Setup
Clone this repository to your desired folder:
```sh
git clone https://github.com/getssh/vet-clinic-database
cd vet-clinic-database
```
- ### Run
Start your `PostgreSQL` CLI:
```sh
psql postgres
```
`PostgreSQL` will show the `prompt`:
```postgresql
postgres=#
```
Now you can start typing `SQL` sentences. Happy querying!
- ### Usage
This repository includes files with plain SQL that can be used to recreate a database:
- Use [schema.sql](./schema.sql) to create all tables.
```sql
CREATE DATABASE vet_clinic;
```
```sql
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](./data.sql) to populate tables with sample data.
```sql
INSERT INTO animals(name, date_of_birth, escape_attempts, neutered, weight_kg)
VALUES ('Agumon', '02/03/2020', 0, true, 10.23);
```
- Check [queries.sql](./queries.sql) for examples of queries that can be run on a newly created database.
```sql
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!*_
👨💻 **Getayawkal Tamrat**
- GitHub: [@getssh](https://github.com/getssh)
- Twitter: [@GetayawkalT](https://twitter.com/GetayawkalT)
- LinkedIn: [@getayawkal-tamrat](https://www.linkedin.com/in/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](https://github.com/getssh/vet-clinic-database/issues/).
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](./MIT.md) licensed.