{"id":15002522,"url":"https://github.com/mrjaid23/quantum-analytics-sql-capstone-project","last_synced_at":"2026-03-15T02:44:27.013Z","repository":{"id":251617624,"uuid":"837932132","full_name":"mrjaid23/Quantum-Analytics-SQL-Capstone-Project","owner":"mrjaid23","description":"SQL Capstone Project","archived":false,"fork":false,"pushed_at":"2024-08-04T14:14:04.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-18T12:16:03.154Z","etag":null,"topics":["mssql","sql"],"latest_commit_sha":null,"homepage":"","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/mrjaid23.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-08-04T13:28:48.000Z","updated_at":"2024-08-04T14:31:51.000Z","dependencies_parsed_at":"2024-08-04T15:33:47.492Z","dependency_job_id":null,"html_url":"https://github.com/mrjaid23/Quantum-Analytics-SQL-Capstone-Project","commit_stats":null,"previous_names":["mrjaid23/quantum-analytics-sql-capstone-project"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrjaid23%2FQuantum-Analytics-SQL-Capstone-Project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrjaid23%2FQuantum-Analytics-SQL-Capstone-Project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrjaid23%2FQuantum-Analytics-SQL-Capstone-Project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrjaid23%2FQuantum-Analytics-SQL-Capstone-Project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrjaid23","download_url":"https://codeload.github.com/mrjaid23/Quantum-Analytics-SQL-Capstone-Project/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243146849,"owners_count":20243740,"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":["mssql","sql"],"created_at":"2024-09-24T18:50:57.712Z","updated_at":"2025-12-25T02:37:29.483Z","avatar_url":"https://github.com/mrjaid23.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Quantum-Analytics-SQL-Capstone-Project\n\n## This is a SQL database Exploration Project for my Data Analytics Certification\n\n- It contains a set of business problems that requires the retrieval of datasets from the database.\n\n[Project Brief](https://github.com/mrjaid23/Quantum-Analytics-SQL-Capstone-Project/blob/f65fbaa9dc5e08c1dfdcdec6803921619259e70e/QA%20SQL%20Capstone%20Project.docx)\n\n\u003e Solutions \n\n**Question 1**\n```\nSELECT ProductID, Name, Color, ListPrice, StandardCost AS Price\nFROM Production.Product\nWHERE COLOR IS NOT NULL AND COLOR NOT IN ('RED', 'SILVER/BLACK', 'WHITE') AND ListPrice BETWEEN 75 AND 750\nORDER BY ListPrice DESC;\n```\n**Question 2**\n```\nSELECT BusinessEntityID, JobTitle, BirthDate, Gender, HireDate\nFROM HumanResources.Employee\nWHERE (Gender = 'M' AND BirthDate BETWEEN '1962-01-01' AND '1970-12-31' AND HireDate \u003e '2001-12-31') \nOR (Gender = 'F' AND BirthDate BETWEEN '1972-01-01' AND '1975-12-31' AND HireDate BETWEEN '2001-01-01' AND '2002-12-31');\n```\n**Question 3**\n```\nSELECT TOP 10 ProductID, Name, Color\nFROM Production.Product\nWHERE ProductNumber LIKE 'BK%';\n```\n**Question 4**\n```\nSELECT BusinessEntityID, FirstName, LastName, EMailAddress, CONCAT(FirstName, ' ', LastName) AS FullName, LEN(CONCAT(FirstName, ' ', LastName)) AS FullNameLength\nFROM Person.vAdditionalContactInfo;\n```\n**Question 5**\n```\nSELECT PS.ProductSubcategoryID, PS.Name AS ProductSubcategoryName, PP.DaystoManufacture\nFROM Production.Product AS PP\nINNER JOIN Production.ProductSubcategory AS PS\nON PP.ProductSubcategoryID = PS.ProductSubcategoryID\nWHERE PP.DaystoManufacture \u003e= 3;\n```\n**Question 7**\n```\nSELECT COUNT(DISTINCT JobTitle) AS DistinctJobTitle\nFROM HumanResources.Employee;\n```\n**Question 8**\n```\nSELECT BusinessEntityID, BirthDate, HireDate, DATEDIFF(YEAR, BirthDate, HireDate) AS AgeAtHiring\nFROM HumanResources.Employee;\n```\n**Question 9**\n```\nSELECT COUNT(*) AS NoOfEmployeesDueForAward\nFROM HumanResources.Employee\nWHERE HireDate \u003c= DATEADD(YEAR, 20, GETDATE()) AND HireDate \u003e DATEADD(YEAR, 25, GETDATE());\n```\n**Question 10**\n```\nSELECT BusinessEntityID, BirthDate, HireDate, DATEDIFF(YEAR, BirthDate, HireDate) AS AgeAtHiring, DATEDIFF(YEAR, HireDate, GETDATE()) AS NoOfYearsinService, DATEDIFF(YEAR, BirthDate, HireDate) + DATEDIFF(YEAR, HireDate, GETDATE()) AS CurrentAge,\nCASE WHEN DATEDIFF(YEAR, BirthDate, GETDATE()) \u003c 65 THEN 65 - DATEDIFF(YEAR, BirthDate, GETDATE())\n        ELSE 0\n    END AS YearsUntilSentiment\nFROM HumanResources.Employee;\n```\n**Question 11**\n```\n-- Create a temporary table to store the new prices and commission\nSELECT\n    ProductID,\n    Name,\n    Color,\n    ListPrice,\n    CASE\n        WHEN Color = 'White' THEN ListPrice * 1.08\n        WHEN Color = 'Yellow' THEN ListPrice * 0.925\n        WHEN Color = 'Black' THEN ListPrice * 1.172\n        WHEN Color IN ('Multi', 'Silver', 'Silver/Black', 'Blue') THEN SQRT(ListPrice) * 2\n        ELSE ListPrice\n    END AS NewPrice,\n    CASE\n        WHEN Color = 'White' THEN ListPrice * 1.08 * 0.375\n        WHEN Color = 'Yellow' THEN ListPrice * 0.925 * 0.375\n        WHEN Color = 'Black' THEN ListPrice * 1.172 * 0.375\n        WHEN Color IN ('Multi', 'Silver', 'Silver/Black', 'Blue') THEN SQRT(ListPrice) * 2 * 0.375\n        ELSE ListPrice * 0.375\n    END AS Commission\nINTO #TempNewPrices\nFROM\n    Production.Product;\n```\n\n-- Select the results from the temporary table\n```\nSELECT\n    ProductID,\n    Name,\n    Color,\n    ListPrice,\n    NewPrice,\n    Commission\nFROM\n    #TempNewPrices;\n```\n**Question 12**\n```\nSELECT SS.BusinessEntityID, SS.SalesQuota, PP.BusinessEntityID, PP.FirstName, PP.LastName, HE.BusinessEntityID, HE.HireDate, HE.SickLeaveHours, ST.Name AS Region\nFROM Sales.SalesPerson AS SS\nINNER JOIN Person.Person AS PP\nON SS.BusinessEntityID = PP.BusinessEntityID\nINNER JOIN HumanResources.Employee AS HE\nON SS.BusinessEntityID = HE.BusinessEntityID\nINNER JOIN Sales.SalesTerritory AS ST\nON ST.TerritoryID = SS.TerritoryID;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrjaid23%2Fquantum-analytics-sql-capstone-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrjaid23%2Fquantum-analytics-sql-capstone-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrjaid23%2Fquantum-analytics-sql-capstone-project/lists"}