{"id":29311511,"url":"https://github.com/marta-barea/library-system-sql","last_synced_at":"2025-07-07T08:15:05.453Z","repository":{"id":301388063,"uuid":"1009103944","full_name":"Marta-Barea/library-system-sql","owner":"Marta-Barea","description":"This repository contains a SQL project for managing a fictional library system, built with MySQL. It is designed to explore complex querying using realistic book-related data.","archived":false,"fork":false,"pushed_at":"2025-06-26T15:31:05.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-26T16:39:23.861Z","etag":null,"topics":["library-management-system","mysql","mysql-database","sql"],"latest_commit_sha":null,"homepage":"","language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Marta-Barea.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-26T15:25:00.000Z","updated_at":"2025-06-26T15:31:09.000Z","dependencies_parsed_at":"2025-06-26T16:50:35.499Z","dependency_job_id":null,"html_url":"https://github.com/Marta-Barea/library-system-sql","commit_stats":null,"previous_names":["marta-barea/library-system-sql"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Marta-Barea/library-system-sql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marta-Barea%2Flibrary-system-sql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marta-Barea%2Flibrary-system-sql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marta-Barea%2Flibrary-system-sql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marta-Barea%2Flibrary-system-sql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Marta-Barea","download_url":"https://codeload.github.com/Marta-Barea/library-system-sql/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marta-Barea%2Flibrary-system-sql/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264040974,"owners_count":23548077,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["library-management-system","mysql","mysql-database","sql"],"created_at":"2025-07-07T08:15:03.522Z","updated_at":"2025-07-07T08:15:05.447Z","avatar_url":"https://github.com/Marta-Barea.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SQL Project - Training Center Database\n\nThis repository contains a SQL project for managing a fictional **library system**, built with MySQL. It is designed to explore complex querying using realistic book-related data.\n\n---\n\n# How to use\n\n1. Clone the repository\n\n```bash\ngit clone https://github.com/yourusername/library-system-sql.git\ncd library-system-sql\n```\n\n2. Set your credentials in .env\n\nCreate a file named `.env` with your database credentials:\n\n```dotenv\nMYSQL_ROOT_PASSWORD=your_password\nMYSQL_PORT=mysql_port_here\nMYSQL_HOST=127.0.0.1\nMYSQL_DATABASE=training_centers\nMYSQL_USER=your_user\nMYSQL_PASSWORD=your_password\n```\n3. Start de Project\n\nMake sure [Docker](https://www.docker.com) is running, then run:\n\n```bash\ndocker-compose up -d\nmake all-insert\n\n```\nThis will:\n\n- Launch a MySQL 8.0 container\n- Create the database\n- Generate the schema\n- Insert fictional data\n- Run all queries in `queries/`\n- Export results as .csv files in `results/`\n\n# Requirements\n\n- [Docker](https://www.docker.com/products/docker-desktop) \n- [Docker Compose](https://docs.docker.com/compose/) \n- `make`(preinstalled on macOS/Linux)\n\n\n# Project Structure\n\n```\nlibrary-system-sql/\n├── .env\n├── .gitignore\n├── docker-compose.yml\n├── Makefile\n├── README.md\n│   ├── create_tables.sql\n│   ├── insert_sample_data.sql\n│   └── ...\n├── queries/\n│   ├── 01_complete_catalogue.sql\n│   ├── 02_top_users.sql\n│   ├── 03_top_cities.sql\n│   ├── ...\n└── results/\n    ├── 01_complete_catalogue.csv\n    ├── 02_top_users.csv\n    ├── 03_top_cities.csv\n    └── ...\n\n```\n# Queries Overview\n\n| Query                                   | Description                                                    |\n|----------------------------------------|----------------------------------------------------------------|\n| `01_complete_catalogue.sql`            | Displays full catalogue of books with their corresponding authors |\n| `02_top_users.sql`                     | Ranks users by total number of loans                           |\n| `03_top_cities.sql`                    | Ranks cities based on loan activity                            |\n| `04_books_by_return_days.sql`          | Calculates how long each book took to be returned              |\n| `05_books_not_returned.sql`            | Lists books currently not returned                             |\n| `06_most_loaned_books.sql`             | Ranks books by number of loans                                 |\n| `07_top_loaned_authors.sql`            | Ranks authors based on total number of loans                   |\n| `08_authors_books_not_loaned.sql`      | Lists authors of books that are still on loan                  |\n| `09_book_loans_with_first_last.sql`    | Shows first and last loan dates per book with loan count rank  |\n\n\n# Notes \n\nAll data is fictional and anonymized.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarta-barea%2Flibrary-system-sql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarta-barea%2Flibrary-system-sql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarta-barea%2Flibrary-system-sql/lists"}