{"id":19947030,"url":"https://github.com/alekrish-12/online_retailer-database","last_synced_at":"2026-06-02T21:32:49.705Z","repository":{"id":244713455,"uuid":"815950393","full_name":"Alekrish-12/Online_Retailer-Database","owner":"Alekrish-12","description":"WINAIM BACKEND DATABASE ASSIGNMENT: The Online Retailer Database project aims to evaluate the ability to work with transactional data, aggregate functions, and subqueries. By designing a comprehensive database schema and writing SQL queries","archived":false,"fork":false,"pushed_at":"2024-07-02T10:01:51.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-01T14:17:59.635Z","etag":null,"topics":["commands","database","gitbash","github-config","schema","sql"],"latest_commit_sha":null,"homepage":"https://github.com/Alekrish-12/Online_Retailer-Database","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Alekrish-12.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-06-16T16:16:11.000Z","updated_at":"2024-07-02T10:01:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"852ba0fb-0382-4d2b-9e99-26bd7aed649f","html_url":"https://github.com/Alekrish-12/Online_Retailer-Database","commit_stats":null,"previous_names":["alekrish-12/online_retailer-database"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Alekrish-12/Online_Retailer-Database","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alekrish-12%2FOnline_Retailer-Database","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alekrish-12%2FOnline_Retailer-Database/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alekrish-12%2FOnline_Retailer-Database/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alekrish-12%2FOnline_Retailer-Database/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Alekrish-12","download_url":"https://codeload.github.com/Alekrish-12/Online_Retailer-Database/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alekrish-12%2FOnline_Retailer-Database/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33838216,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-02T02:00:07.132Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["commands","database","gitbash","github-config","schema","sql"],"created_at":"2024-11-13T00:34:01.155Z","updated_at":"2026-06-02T21:32:49.688Z","avatar_url":"https://github.com/Alekrish-12.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# WINAIM-Assignment - Online_Retailer-Database\nObjective\nThe Online Retailer Database project aims to evaluate the ability to work with transactional data, aggregate functions, and subqueries. By designing a comprehensive database schema and writing SQL queries to perform various operations on the data, this project assesses proficiency in database management and querying.\n\nDatabase Schema Design\nThe database schema includes tables for customers, orders, products, and order_items:\n\ncustomers: Contains information about customers, including customer_id, first_name, last_name, and email.\norders: Stores details of orders placed, such as order_id, customer_id, and order_date.\nproducts: Holds information about products available for purchase, with fields like product_id, product_name, and price.\norder_items: Records the items included in each order, including order_item_id, order_id, product_id, quantity, and price.\nSQL Queries\nThe following SQL queries demonstrate the functionality of the Online Retailer Database:\n\nTotal Number of Orders per Customer:\n\nSELECT c.customer_id, c.first_name, c.last_name, COUNT(o.order_id) AS total_orders\nFROM customers c\nLEFT JOIN orders o ON c.customer_id = o.customer_id\nGROUP BY c.customer_id, c.first_name, c.last_name;\nProducts Never Ordered:\n\n\nSELECT p.product_id, p.product_name\nFROM products p\nLEFT JOIN order_items oi ON p.product_id = oi.product_id\nWHERE oi.order_item_id IS NULL;\nCustomer Who Spent the Most in Last Month:\n\n\nSELECT c.customer_id, c.first_name, c.last_name, SUM(oi.quantity * oi.price) AS total_spent\nFROM customers c\nJOIN orders o ON c.customer_id = o.customer_id\nJOIN order_items oi ON o.order_id = oi.order_id\nWHERE o.order_date \u003e= DATE_SUB(CURDATE(), INTERVAL 1 MONTH)\nGROUP BY c.customer_id, c.first_name, c.last_name\nORDER BY total_spent DESC\nLIMIT 1;\n\n#OUTPUT :\n\n![Screenshot (82)](https://github.com/Alekrish-12/Online_Retailer-Database/assets/170092296/a35907fa-de81-4de7-ba75-c394213895b1)\n\nConclusion\nThe Online Retailer Database project demonstrates proficiency in database design and SQL querying techniques. By implementing the specified requirements, it provides a foundation for managing transactional data efficiently in an online retail environment.\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falekrish-12%2Fonline_retailer-database","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falekrish-12%2Fonline_retailer-database","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falekrish-12%2Fonline_retailer-database/lists"}