1 / 15

Team D SQL Application for Business

Team D SQL Application for Business. Justin Perro Mike Hemara Thach. POS 410 SQL for Business Ashish Gulati. Business Description. Small startup business named JM Cellular.

Download Presentation

Team D SQL Application for Business

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Team DSQL Application for Business Justin Perro Mike Hemara Thach POS 410 SQL for Business AshishGulati

  2. Business Description • Small startup business named JM Cellular. • JM business model consist of buying new, used cellular phones and Cellular services from reputable wholesale suppliers in Phoenix area and retail sells them to consumers at very comparative prices.

  3. Problem Statement • Inventory Management • Employee Management • Queries

  4. ERD

  5. Inventory Management - Tracking • Unique by Inventory Number and Serial Number • Lookup Tables • Carrier • Suppliers • Manufacturer

  6. Inventory Management - Transaction • Unique by Inventory Number and Serial Number • Foreign Keys • Transaction Type • Employee Id • Sales Price • Tax • Transactions Date

  7. Inventory Management – Detail Tracking • Lookup Tables • Location • Manufacturer • Carrier • Supplier

  8. Employee Management • Pertinent Employee information: • Name, Position, Address, Salary Type, Phone #’s etc. • Unique by Employee # • Foreign Key of Salary Type

  9. Employee Management – Detail Tracking • Lookup Table • Salary Type • Unique Identifier • Choose Either: • Monthly • Weekly • Hourly --Salary Type CREATE TABLE dbo.tblSalaryType ( SalaryID SMALLINT Not Null, SalaryTypeDesc NVARCHAR (20) Not Null ------Monthly, Weekly, Hourly------ CONSTRAINT PK_UC_SalaryID PRIMARY KEY (SalaryID) ) GO

  10. Employee Management – Salary • Tracks Hours worked and when • Foreign Key • EmpID • Unique Identifier • Composite Key • Date • Hours -- Employee Salary CREATE TABLE dbo.tblEmpSalary ( --EmpSalaryID SMALLINT NOT NULL, EmpID SMALLINT NOT NULL, CONSTRAINT FK_EmpSalary FOREIGN KEY (EmpID) REFERENCES dbo.tblEmployee(EmpID), EmpWorkHour Numeric(5,2) NOT NULL, EmpWorkDate Date NOT NULL DEFAULT GETDATE(), EmpComment NVARCHAR(200) NULL, CONSTRAINT PK_UC_EmpExpense PRIMARY KEY (EmpID,EmpWorkDate) ) GO

  11. Query 1 Three way join to select all inventory items sold to date Displays Item Desc, PurPrice, Sale Price, Prof$, Prof%

  12. Query 2 Two way join to group inventory items by carrier and compute costs by carrier Displays Carrier, Item Counts and Total Costs by carrier.

  13. Query 3 Two way join to compute employee salaries, using case statement for salary types. Employee name,Workhrs, Salary, SalType, GrsPay, Ending Date.

  14. Query 4 Three way join to select inventory items sold by employees Employee name, itemsold, PurPrice, Soldfor, Profit$

  15. Questions?

More Related