{"id":19607379,"url":"https://github.com/margaretkhendre/employee-analysis-vs-sql-challenge","last_synced_at":"2026-02-22T04:34:52.840Z","repository":{"id":157528675,"uuid":"617715384","full_name":"margaretkhendre/Employee-Analysis-vs-SQL-Challenge","owner":"margaretkhendre","description":"SQL is used in this repository to examine the hiring process of a fictional company, Pewlett Hackard. Data modeling, data engineering, and a data analysis are displayed here.","archived":false,"fork":false,"pushed_at":"2023-05-11T01:31:45.000Z","size":8012,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-09T09:27:33.330Z","etag":null,"topics":["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/margaretkhendre.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":"2023-03-23T00:38:38.000Z","updated_at":"2023-05-19T22:32:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"9f67ed75-574a-4d4c-b938-412ab283787a","html_url":"https://github.com/margaretkhendre/Employee-Analysis-vs-SQL-Challenge","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/margaretkhendre%2FEmployee-Analysis-vs-SQL-Challenge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/margaretkhendre%2FEmployee-Analysis-vs-SQL-Challenge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/margaretkhendre%2FEmployee-Analysis-vs-SQL-Challenge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/margaretkhendre%2FEmployee-Analysis-vs-SQL-Challenge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/margaretkhendre","download_url":"https://codeload.github.com/margaretkhendre/Employee-Analysis-vs-SQL-Challenge/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240895560,"owners_count":19875007,"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":["sql"],"created_at":"2024-11-11T10:10:20.448Z","updated_at":"2025-10-15T21:12:59.976Z","avatar_url":"https://github.com/margaretkhendre.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# SQL Challenge\n\nThis challenge will display data modeling, data engineering, and data analysis of a fictional company, Pewlett Hackard.\n\nPewlett Hackard's employee and department files are to be examined to aid their hiring process. \n\n\n### Data Modeling \nQuickDBD has been used to sketch an Entity Relationship Diagram for Pewlett Hackard.\n\n![Data Modeling ](https://user-images.githubusercontent.com/121995835/228045206-e0fa6b98-1c31-425c-9127-f1cf99c88e9b.png)\n\n\n### Data Engineering \nTables have been created for each of the 6 CSV files from Pewlett Hackard in this Table Schema. (Also located in the EmployeeSQL folder.) \n\n\nTitles  \n\n\tCREATE TABLE TITLES(\n\tTitle_ID VARCHAR(20) NOT NULL,\n\tTitle VARCHAR(30) NOT NULL,\n\tPRIMARY KEY (Title_ID)\n\t);\n\tSELECT * FROM TITLES\n\nEmployees \n\n\tCREATE TABLE EMPLOYEES(\n\tEmp_no INT NOT NULL PRIMARY KEY,\n\tEmp_title_ID VARCHAR(30) NOT NULL,\n\tBirth_date VARCHAR(20) NOT NULL,\n\tFirst_name VARCHAR(20) NOT NULL,\n\tLast_name VARCHAR(20) NOT NULL,\n\tSex VARCHAR(10) NOT NULL, \n\tHire_date DATE NOT NULL,\n\tFOREIGN KEY (Emp_title_ID) REFERENCES TITLES(Title_ID)\n\t);\n\n\tSELECT * FROM EMPLOYEES\n\nDepartments \n\n\tCREATE TABLE DEPARTMENTS(\n\tDept_no VARCHAR(15) NOT NULL,\n\tDept_name VARCHAR(20) NOT NULL,\n\tPRIMARY KEY (Dept_no)\n\t);\n\n\tSELECT * FROM DEPARTMENTS\n\nDepartment Managers\n\n\tCREATE TABLE DEPT_MANAGER(\n\tDept_no VARCHAR(15) NOT NULL,\n\tEmp_no INT NOT NULL,\n\tFOREIGN KEY (Emp_no) REFERENCES EMPLOYEES(Emp_no),\n\tFOREIGN KEY (Dept_no) REFERENCES DEPARTMENTS(Dept_no),\n\tPRIMARY KEY (Dept_no, Emp_no)\n\t);\n\n\tSELECT * FROM DEPT_MANAGER\n\nDepartment Employees\n\n\tCREATE TABLE DEPT_EMP(\n\tEmp_no INT NOT NULL,\n\tDept_no VARCHAR(15) NOT NULL,\n\tFOREIGN KEY (Emp_no) REFERENCES EMPLOYEES(Emp_no),\n\tFOREIGN KEY (Dept_no) REFERENCES DEPARTMENTS(Dept_no),\n\tPRIMARY KEY (Emp_no, Dept_no)\n\t);\n\n\tSELECT * FROM DEPT_EMP\n\nSalaries \n\n\tCREATE TABLE SALARIES(\n\tEmp_no INT NOT NULL PRIMARY KEY,\n\tSalary INT NOT NULL,\n\tFOREIGN KEY (Emp_no) REFERENCES EMPLOYEES(Emp_no)\n\t);\n\n\tSELECT * FROM SALARIES\n\t\n\n### Data Analysis\nList the employee number, last name, first name, sex, and salary of each employee.\n\n\tSELECT EMPLOYEES.Emp_no, EMPLOYEES.Last_name, EMPLOYEES.First_name, EMPLOYEES.Sex, SALARIES.Salary \n\tFROM EMPLOYEES\n\tLEFT JOIN SALARIES \n\tON EMPLOYEES.Emp_no = SALARIES.Emp_no;\n\t\nList the first name, last name, and hire date for the employees who were hired in 1986.\n\n\tSELECT First_name, Last_name, Hire_date\n\tFROM EMPLOYEES\n\tWHERE Hire_date LIKE '%1986%'\n\tORDER BY Hire_date;\n\nList the manager of each department along with their department number, department name, employee number, last name, and first name.\n\n\tSELECT DEPT_MANAGER.Dept_no, DEPT_MANAGER.Emp_no, DEPARTMENTS.Dept_name, EMPLOYEES.Last_name, EMPLOYEES.First_name\n\tFROM DEPT_MANAGER\n\tJOIN DEPARTMENTS\n\tON DEPT_MANAGER.Dept_no = DEPARTMENTS.Dept_no\n\tJOIN  EMPLOYEES\n\tON DEPT_MANAGER.Emp_no = EMPLOYEES.Emp_no\n\tORDER BY Dept_no ASC;\n\nList the department number for each employee along with that employee’s employee number, last name, first name, and department name.\n\n\tSELECT DEPT_EMP.Dept_no, DEPT_EMP.Emp_no, EMPLOYEES.Last_name, EMPLOYEES.First_name, DEPARTMENTS.Dept_name\n\tFROM DEPT_EMP\n\tJOIN EMPLOYEES\n\tON DEPT_EMP.Emp_no = EMPLOYEES.Emp_no\n\tJOIN DEPARTMENTS\n\tON DEPT_EMP.Dept_no = DEPARTMENTS.Dept_no\n\tORDER BY Dept_no ASC;\n\nList first name, last name, and sex of each employee whose first name is Hercules and whose last name begins with the letter B.\n\n\tSELECT First_name, Last_name, Sex\n\tFROM EMPLOYEES\n\tWHERE First_name LIKE '%Hercules%' AND Last_name LIKE 'B%'\n\tORDER BY First_name;\n\nList each employee in the Sales department, including their employee number, last name, and first name.\n\n\tSELECT DEPT_EMP.Emp_no, EMPLOYEES.Last_name, EMPLOYEES.First_name, DEPARTMENTS.Dept_name\n\tFROM EMPLOYEES\n\tJOIN DEPT_EMP\n\tON EMPLOYEES.EMP_no = DEPT_EMP.Emp_no \n\tJOIN DEPARTMENTS\n\tON DEPT_EMP.Dept_no = DEPARTMENTS.Dept_no\n\tWHERE Dept_name LIKE '%Sales%'\n\tORDER BY Emp_no ASC;\n\nList each employee in the Sales and Development departments, including their employee number, last name, first name, and department name.\n\n\tSELECT DEPT_EMP.Emp_no, EMPLOYEES.Last_name, EMPLOYEES.First_name, DEPARTMENTS.Dept_name\n\tFROM EMPLOYEES\n\tJOIN DEPT_EMP\n\tON EMPLOYEES.EMP_no = DEPT_EMP.Emp_no \n\tJOIN DEPARTMENTS\n\tON DEPT_EMP.Dept_no = DEPARTMENTS.Dept_no\n\tWHERE Dept_name LIKE '%Sales%' OR Dept_name LIKE '%Development%'\n\tORDER BY Emp_no ASC;\n\nList the frequency counts, in descending order, of all the employee last names (that is, how many employees share each last name).\n\n\tSELECT Last_name, COUNT(Last_name) \n\tFROM EMPLOYEES\n\tGROUP BY Last_name\n\tORDER BY COUNT(Last_name) Desc;\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmargaretkhendre%2Femployee-analysis-vs-sql-challenge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmargaretkhendre%2Femployee-analysis-vs-sql-challenge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmargaretkhendre%2Femployee-analysis-vs-sql-challenge/lists"}