GloSolar CompanySchema/ EERDatabaseQueriesNormalization
GloSolar is a small Startup Solar Installer Headquarters: Downtown Berkeley Market: Business done primarily in Bay Area/Sonoma County Company Size: Eight employees total; three work in the Berkeley Office. Company Overview Schema/ EERDatabaseQueriesNormalization
Existing Database Structure First 3 Months: Began with customer tracking by storing its customer data on a single sheet of a large Google Spreadsheet. Current customer resource management database: Google Apps & Relational Database based on Excel for orders Need for Project Management as well as data tracking No existing relational database structure to track the physical Solar Systems and the different customers from start to finish state, as well as each and every single order. Company Difficulties: Operations are spread out throughout California Database must be able to both track projects as well as entire company operations including payroll and purchases Schema/ EERDatabaseQueriesNormalization
CompanySchema/ EERDatabaseQueriesNormalization
Final Relational Schema CompanySchema/ EERDatabaseQueriesNormalization
Final Relational Schema CompanySchema/ EERDatabaseQueriesNormalization
Final Relational Schema CompanySchema/ EERDatabaseQueriesNormalization
Table Relationships
Switchboard CompanySchema/ EERDatabaseQueriesNormalization
Forms CompanySchema/ EERDatabaseQueriesNormalization
Query 1 Give a list of sales representatives and their number of paying customers, from highest to lowest. CompanySchema/ EERDatabaseQueriesNormalization
Query 2 Which advertisement generates the most revenue per dollar spent on that advertisement? CompanySchema/ EERDatabaseQueriesNormalization
Query 3 In what months are the most projects started? Order months from those with the most projects to those with the fewest? CompanySchema/ EERDatabaseQueriesNormalization
Query 4 Which customers have given the most referrals? CompanySchema/ EERDatabaseQueriesNormalization
Query 4 Provides a clean report for list of referrals CompanySchema/ EERDatabaseQueriesNormalization
Query 5 Which projects that have not yet been completed have been in progress the longest? CompanySchema/ EERDatabaseQueriesNormalization
Normalization Analysis Person BCNF Person BCNF Person(Person_id, Last_Name, First_Name, MI, Address, Phone_Number, _Address) Functional Dependencies: Person_id First_Name, Last_Name, MI, Address, Phone_Number, _Address CompanySchema/ EERDatabaseQueriesNormalization
Normalization Analysis CreditCard 2NF CreditCard 2NF CreditCard(Payment_id, CreditCardNumber, CreditcardCompany, CCV) Functional Dependencies: Payment_id CreditCardNumber, CreditCardCompany, CCV CreditCardNumber CreditCardCompany, CCV Normalized into BCNF: Normalized into BCNF: CreditCard(Payment_id, CreditCardNumber) CreditCard(CreditCardNumber, CreditCardCompany, CCV) CompanySchema/ EERDatabaseQueriesNormalization
Normalization Analysis Project BCNF Project BCNF Project(Project_id, Cutsomter_id 1b, Completion_Date, Start_Date, Total_Price) Functional Dependencies: Project_id Customer_id, Total_Price, Start_Date, Completion_Date CompanySchema/ EERDatabaseQueriesNormalization
Normalization Analysis Order BCNF Order BCNF Order(Order_id, Employee_id 1a, Project_id 4, Order_time, Payment_id 22, Shipper_id 18,Product_id 19 ) Functional Dependencies: Order_id Employee_id, Project_id, Order_time, Amount, Payment_Method_id, Shipper_id. Product_id CompanySchema/ EERDatabaseQueriesNormalization
Normalization Analysis Supplier 3NF Supplier 3NF Supplier(Supplier_id, Name, Address, _Address, Phone) Functional Dependencies: Supplier_id Name, Address, _Address, Phone Phone Supplier_id Can be normalized into BCNF: Can be normalized into BCNF: Supplier(Supllier_id, Name, Address, _Address) Supplier_Phone(Supplier_id, Phone) CompanySchema/ EERDatabaseQueriesNormalization
Questions? Thank you! CompanySchema/ EERDatabaseQueriesNormalization