Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
5. The Purchase table
INSERT with SELECT
Referring to other tables
INSERT, UPDATE and DELETE with JOIN
INSERT, UPDATE, and DELETE with subqueries
Summary

Instruction

Finally, we come to the last table, Purchase. Let's explore it.

Exercise

Select all columns from the Purchase table. In this store, each purchase is for one kind of product. It consists of the following columns:

  • Id – uniquely identifies each order.
  • ProductId – the ID of the product included in the order.
  • Quantity – how many of each product is in the order.
  • TotalPrice – the total amount for those products.
  • CustomerId – the ID of the customer who bought the order.
  • EmployeeId – the ID of the employee who sold the order.
  • OrderDate – the date on which the order was placed.
  • IsCompleted – a boolean value denoting if the purchase was completed (1) or not (0). Note that the values are displayed as true and false, respectively.