Search⌘ K

Learn Data Presentation Through Practice

Explore how to present and transform data using SQL by applying aliases, writing stored procedures for sales forecasting, and creating views to control data access. This lesson equips you with practical skills to manage and query sales data effectively while ensuring security and clarity in data presentation.

Problem

Refer to the “Sales.ProductSales” table to solve the problems presented in this lesson.

Sales.ProductSales Table

TransactionID

ProductID

UnitPrice

Quantity

CustomerID

Supt_PkgID

Supt_PkgCost

1

1

1000.00

1

1

1

0.00

2

1

1000.00

1

2

1

0.00

3

2

1500.00

2

3

2

250.00

4

3

750.00

1

4

2

250.00

5

4

2500.00

1

5

2

250.00

6

1

1000.00

1

5

2

250.00

Part A

Let’s suppose there is a need to create a query for an end user so that they can see some basic information. Write a query that obtains the following information and uses aliases for each:

  • ProductID: This should be an accidental alias with no spaces or underscores and be called ModuleId.
  • Quantity: This should have an alias of a string and be called
...