Assignment 2: Database Systems And Database Models | Strayer

Assignment 2 Database Systems And Database Modelsthe Strayer Oracle

Design a query that will allow the finance department to determine the commissions paid to specific employees of the sales department for the month of December. Generate the related tables (Employee, Invoice, InvoiceLine, Product, Department, and Job) to validate your code. Provide the validated SQL query code as part of your paper.

Compare the code of the query you designed in Question one to a query showing the total compensation paid to each employee for the same month.

Determine and explain the factors necessary to ensure referential integrity within the database design.

Create an object-oriented model illustrating the relationships between the tables using graphical tools (e.g., Microsoft Visio or Dia), including relationship types such as 1:M, 1:1, or M:1. Incorporate the factors identified in the previous requirement into the diagram.

Identify which data components are entities and attributes, and depict their relationships using an object representation diagram created with graphical tools (e.g., Visio or Dia). Do not include these diagrams in the page length requirement.

Describe how Big Data can be utilized to enhance productivity and forecasting of the organization’s products and resources.

Paper For Above instruction

Introduction

The integration of database systems is essential for streamlining operations in large organizations, especially those engaged in high-end electronics sales across multiple departments. This paper addresses key aspects of database design and analysis, focusing on querying employee commissions, calculating total compensation, ensuring referential integrity, creating object-oriented models, and exploring the role of Big Data in organizational forecasting and productivity.

Designing a Query for Employee Commissions

To assist the finance department in determining the commissions paid to specific sales employees during December, a precise SQL query must be constructed. This involves joining several tables: Employee, Invoice, InvoiceLine, Product, Department, and Job. The query filters invoices dated in December, identifies employees within the sales department, and calculates commissions based on the commission rate and total units sold.

The sample SQL query might look like this:

SELECT

E.EmpNumber, E.EmpFirstName, E.EmpLastName,

SUM(IL.Quantity * P.ProductCost) AS TotalSales,

(SUM(IL.Quantity P.ProductCost) E.CommissionRate) AS CommissionPaid

FROM

Employee E

JOIN

Invoice I ON E.EmpNumber = I.EmpNumber

JOIN

InvoiceLine IL ON I.InvNumber = IL.InvNumber

JOIN

Product P ON IL.ProductNumber = P.ProductNumber

JOIN

Department D ON E.DepartmentID = D.DepartmentID

WHERE

D.DepartmentDescription = 'Sales' AND

I.InvDate BETWEEN TO_DATE('01-12-2023', 'DD-MM-YYYY') AND TO_DATE('31-12-2023', 'DD-MM-YYYY')

GROUP BY

E.EmpNumber, E.EmpFirstName, E.EmpLastName, E.CommissionRate;

This query aggregates the total sales per employee and calculates the respective commissions for December, assuming the commission rate applies to the sales amount.

Comparison with Total Compensation Query

The second query expands upon the first by calculating total compensation, including salary and benefits, along with commissions. The structure is similar but adds the base salary component:

SELECT

E.EmpNumber, E.EmpFirstName, E.EmpLastName,

E.YrlySalary,

SUM(IL.Quantity * P.ProductCost) AS TotalSales,

(SUM(IL.Quantity P.ProductCost) E.CommissionRate) AS CommissionPaid,

(E.YrlySalary + (SUM(IL.Quantity P.ProductCost) E.CommissionRate)) AS TotalCompensation

FROM

Employee E

JOIN

Invoice I ON E.EmpNumber = I.EmpNumber

JOIN

InvoiceLine IL ON I.InvNumber = IL.InvNumber

JOIN

Product P ON IL.ProductNumber = P.ProductNumber

JOIN

Department D ON E.DepartmentID = D.DepartmentID

WHERE

D.DepartmentDescription = 'Sales' AND

I.InvDate BETWEEN TO_DATE('01-12-2023', 'DD-MM-YYYY') AND TO_DATE('31-12-2023', 'DD-MM-YYYY')

GROUP BY

E.EmpNumber, E.EmpFirstName, E.EmpLastName, E.YrlySalary, E.CommissionRate;

This comprehensive query allows the organization to understand total costs associated with each employee’s compensation for December.

Ensuring Referential Integrity

Referential integrity refers to the accuracy and consistency of data within a relational database. To guarantee this, several factors are essential:

  • Primary and Foreign Keys: Clearly defined primary keys uniquely identify each record, while foreign keys establish valid links between related tables.
  • Constraints: Implementing foreign key constraints enforces referential integrity by restricting updates or deletions that would lead to orphaned records.
  • Cascade Actions: Using cascade delete and update options ensures consistent data across related tables during modifications.
  • Validation Rules: Data validation at the application and database level prevents invalid data entry that could violate relationships.
  • Regular Audits: Routine checks ensure that referential links remain intact and violations are promptly addressed.

By observing these factors, organizations can maintain a reliable and consistent database environment, crucial for accurate reporting and decision-making.

Object-Oriented Model of the Database

Developing an object-oriented model involves illustrating how tables relate through graphical tools like Visio or Dia. Entities such as Employee, Invoice, Product, Department, and Job are represented as objects, with relationships indicating how they interact:

  • Employee to Department: M:1 relationship; multiple employees belong to one department.
  • Employee to Job: M:1 relationship; each employee has one job title.
  • Invoice to Employee: M:1; each invoice is associated with one employee.
  • InvoiceLine to Invoice and Product: M:1 relationships; each invoice line relates to one invoice and one product.

The graphical model would depict these relationships with appropriate symbols indicating cardinality, clarifying how data elements are interconnected and ensuring clarity in database design.

Entities, Attributes, and Relationships Representation

In the context of object modeling, entities like Employee, Invoice, Product, Department, and Job are represented as objects in diagrams, with attributes such as EmpNumber, EmpFirstName, etc. Relationships such as 'works for', 'contains', and 'sold by' illustrate the connections between these entities. For instance, the 'Employee' entity is linked to 'Invoice' via a one-to-many relationship, representing that one employee can process multiple invoices.

Big Data’s Role in Enhancing Organizational Productivity

Big Data analytics plays a transformative role in organizations by enabling more accurate forecasting, optimized resource allocation, and deeper insights into market and operational trends. Leveraging large data sets, organizations can predict customer preferences, identify high-performing products, and optimize supply chain operations. For this electronics company, analyzing customer purchase behaviors, market trends, and product performance data can inform strategic decisions about inventory management, marketing campaigns, and product development.

Tools like Hadoop and Spark facilitate the processing of vast amounts of structured and unstructured data, allowing real-time analytics and predictive modeling. These capabilities enable organizations to react swiftly to market demands and forecast future sales with high precision. Furthermore, Big Data assists in identifying operational bottlenecks and inefficiencies, leading to improved productivity and cost savings.

Integrating Big Data into organizational strategies enhances competitive edge by providing actionable insights, improving customer satisfaction, and fostering innovation. It aligns departmental objectives with data-driven decision-making, ensuring that organizational resources are effectively utilized to maximize profitability.

Conclusion

This paper outlined critical components of database management and analysis within an organization selling high-end electronics. From designing precise SQL queries to calculating total compensation and ensuring referential integrity, each element contributes to an effective database environment. The development of object-oriented models visually encapsulates data relationships, supporting better database architecture understanding. Moreover, leveraging Big Data presents significant opportunities for strategic planning, operational efficiency, and competitive advantage. Implementing these principles ensures robust data management, deeper insights, and sustainable organizational growth.

References

  • Elmasri, R., & Navathe, S. B. (2016). Fundamentals of Database Systems (7th ed.). Pearson.
  • Business Intelligence Technologies: Techniques and Applications. Pearson.
  • SQL for Beginners: A Crash Course. O'Reilly Media. The Data Warehouse Toolkit: The Definitive Guide to Dimensional Modeling. Wiley. Oracle Database SQL Language Reference. Oracle Corporation. NoSQL Databases: A Guide to the Used Data Models. O'Reilly Media. IEEE Internet Computing, 18(5), 18-25. Big Data: A Revolution That Will Transform How We Live, Work, and Think. Houghton Mifflin Harcourt. Journal of Business Analytics, 3(2), 146–161. Apache Hadoop Documentation. Apache Software Foundation.