This project contains the SQL commands to create a table called animals, populate it with sample items and filter depending on multiple parameters. Try it out
PostgreSQL must be installed :(
Clone this repository by running:
git clone https://github.com/eduardosancho/vet-clinic.git
This repository includes files with plain SQL that can be used to recreate a database:
- Run this in your bash terminal to gain access to postgres command line
$ psql postgres
- Create a new database with any name ('vet-clinic' is suggested), and connect to that database.
# CREATE DATABASE <database_name>;
# \c <database_name>
- Use schema.sql to create all tables. Copy and paste the content of this file into the postgres command line. That should create the tables in your database. Now verify it. The following command displays all tables in your database:
# \d
- Use data.sql to populate tables with sample data. Copy and paste the content of this file into the postgres command line. That should create the tables in your database. Now verify it. The following command displays all content in your selected table:
# SELECT * FROM <table_name>;
- Check queries.sql for examples of queries that can be run on a newly created database. Copy and paste the content of this file into the postgres command line. That should create the display an enormous list of queries that I prepared. It's recommended to run them individually for better understanding. Important note: this file might include queries that make changes in the database (e.g., remove records). Use them responsibly!
Social | Username |
---|---|
GitHub | @eduardosancho |
@sanchitoblog | |
Eduardo Sancho Solano |
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
Give a ⭐️ if you like this project!
This project is MIT licensed.