We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17
101 Practice SQL Questions: Basic to Advanced
The Adventure Works Company
Data Dictionary *See Questions 2 and 10
Schema Name Table Name Column Name Definition
HumanResources Department DepartmentID Primary key for Department records. HumanResources Department Name Name of the department. Name of the group to which the department HumanResources Department GroupName belongs. HumanResources Department ModifiedDate Date and time the record was last updated. Primary key for Employee records. Foreign key HumanResources Employee BusinessEntityID to BusinessEntity.BusinessEntityID. Unique national identification number such as a HumanResources Employee NationalIDNumber social security number. HumanResources Employee LoginID Network login. Where the employee is located in corporate HumanResources Employee OrganizationNode hierarchy. The depth of the employee in the corporate HumanResources Employee OrganizationLevel hierarchy. HumanResources Employee JobTitle Work title such as Buyer or Sales Representative. HumanResources Employee BirthDate Date of birth. HumanResources Employee MaritalStatus M = Married, S = Single HumanResources Employee Gender M = Male, F = Female HumanResources Employee HireDate Employee hired on this date. Job classification. 0 = Hourly, not exempt from collective bargaining. 1 = Salaried, exempt from HumanResources Employee SalariedFlag collective bargaining. HumanResources Employee VacationHours Number of available vacation hours. HumanResources Employee SickLeaveHours Number of available sick leave hours. HumanResources Employee CurrentFlag 0 = Inactive, 1 = Active ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication HumanResources Employee rowguid sample. HumanResources Employee ModifiedDate Date and time the record was last updated. Employee identification number. Foreign key to HumanResources EmployeeDepartmentHistory BusinessEntityID Employee.BusinessEntityID. Department in which the employee worked including currently. Foreign key to HumanResources EmployeeDepartmentHistory DepartmentID Department.DepartmentID. Identifies which 8-hour shift the employee HumanResources EmployeeDepartmentHistory ShiftID works. Foreign key to Shift.Shift.ID. Date the employee started work in the HumanResources EmployeeDepartmentHistory StartDate department. Date the employee left the department. NULL = HumanResources EmployeeDepartmentHistory EndDate Current department. HumanResources EmployeeDepartmentHistory ModifiedDate Date and time the record was last updated. Employee identification number. Foreign key to HumanResources EmployeePayHistory BusinessEntityID Employee.BusinessEntityID. HumanResources EmployeePayHistory RateChangeDate Date the change in pay is effective HumanResources EmployeePayHistory Rate Salary hourly rate. 1 = Salary received monthly, 2 = Salary received HumanResources EmployeePayHistory PayFrequency biweekly HumanResources EmployeePayHistory ModifiedDate Date and time the record was last updated. HumanResources JobCandidate JobCandidateID Primary key for JobCandidate records. Employee identification number if applicant was HumanResources JobCandidate BusinessEntityID hired. Foreign key to Employee.BusinessEntityID. HumanResources JobCandidate Resume Résumé in XML format. HumanResources JobCandidate ModifiedDate Date and time the record was last updated. HumanResources Shift ShiftID Primary key for Shift records. HumanResources Shift Name Shift description. HumanResources Shift StartTime Shift start time. HumanResources Shift EndTime Shift end time. HumanResources Shift ModifiedDate Date and time the record was last updated. Person Address AddressID Primary key for Address records. Person Address AddressLine1 First street address line. Person Address AddressLine2 Second street address line. Person Address City Name of the city. Unique identification number for the state or Person Address StateProvinceID province. Foreign key to StateProvince table. Person Address PostalCode Postal code for the street address. Person Address SpatialLocation Latitude and longitude of this address. ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication Person Address rowguid sample. Person Address ModifiedDate Date and time the record was last updated. Person AddressType AddressTypeID Primary key for AddressType records. Address type description. For example, Billing, Person AddressType Name Home, or Shipping. ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication Person AddressType rowguid sample. Person AddressType ModifiedDate Date and time the record was last updated. Primary key for all customers, vendors, and Person BusinessEntity BusinessEntityID employees. ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication Person BusinessEntity rowguid sample. Person BusinessEntity ModifiedDate Date and time the record was last updated. Primary key. Foreign key to Person BusinessEntityAddress BusinessEntityID BusinessEntity.BusinessEntityID. Person BusinessEntityAddress AddressID Primary key. Foreign key to Address.AddressID. Primary key. Foreign key to Person BusinessEntityAddress AddressTypeID AddressType.AddressTypeID. ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication Person BusinessEntityAddress rowguid sample. Person BusinessEntityAddress ModifiedDate Date and time the record was last updated. Primary key. Foreign key to Person BusinessEntityContact BusinessEntityID BusinessEntity.BusinessEntityID. Primary key. Foreign key to Person BusinessEntityContact PersonID Person.BusinessEntityID. Primary key. Foreign key to Person BusinessEntityContact ContactTypeID ContactType.ContactTypeID. ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication Person BusinessEntityContact rowguid sample. Person BusinessEntityContact ModifiedDate Date and time the record was last updated. Person ContactType ContactTypeID Primary key for ContactType records. Person ContactType Name Contact type description. Person ContactType ModifiedDate Date and time the record was last updated. Person CountryRegion CountryRegionCode ISO standard code for countries and regions. Person CountryRegion Name Country or region name. Person CountryRegion ModifiedDate Date and time the record was last updated. Primary key. Person associated with this email Person EmailAddress BusinessEntityID address. Foreign key to Person.BusinessEntityID Person EmailAddress EmailAddressID Primary key. ID of this email address. Person EmailAddress EmailAddress E-mail address for the person. ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication Person EmailAddress rowguid sample. Person EmailAddress ModifiedDate Date and time the record was last updated. Person Password PasswordHash Password for the e-mail account. Random value concatenated with the password Person Password PasswordSalt string before the password is hashed. ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication Person Password rowguid sample. Person Password ModifiedDate Date and time the record was last updated. Person Person BusinessEntityID Primary key for Person records. Primary type of person: SC = Store Contact, IN = Individual (retail) customer, SP = Sales person, EM = Employee (non-sales), VC = Vendor Person Person PersonType contact, GC = General contact 0 = The data in FirstName and LastName are stored in western style (first name, last name) order. 1 = Eastern style (last name, first name) Person Person NameStyle order. Person Person Title A courtesy title. For example, Mr. or Ms. Person Person FirstName First name of the person. Person Person MiddleName Middle name or middle initial of the person. Person Person LastName Last name of the person. Person Person Suffix Surname suffix. For example, Sr. or Jr. 0 = Contact does not wish to receive e-mail promotions, 1 = Contact does wish to receive e- mail promotions from AdventureWorks, 2 = Contact does wish to receive e-mail promotions Person Person EmailPromotion from AdventureWorks and selected partners. Additional contact information about the person Person Person AdditionalContactInfo stored in xml format. Personal information such as hobbies, and income collected from online shoppers. Used for Person Person Demographics sales analysis. ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication Person Person rowguid sample. Person Person ModifiedDate Date and time the record was last updated. Business entity identification number. Foreign Person PersonPhone BusinessEntityID key to Person.BusinessEntityID. Person PersonPhone PhoneNumber Telephone number identification number. Kind of phone number. Foreign key to Person PersonPhone PhoneNumberTypeID PhoneNumberType.PhoneNumberTypeID. Person PersonPhone ModifiedDate Date and time the record was last updated. Person PhoneNumberType PhoneNumberTypeID Primary key for telephone number type records. Person PhoneNumberType Name Name of the telephone number type Person PhoneNumberType ModifiedDate Date and time the record was last updated. Person StateProvince StateProvinceID Primary key for StateProvince records. Person StateProvince StateProvinceCode ISO standard state or province code. ISO standard country or region code. Foreign key Person StateProvince CountryRegionCode to CountryRegion.CountryRegionCode. 0 = StateProvinceCode exists. 1 = StateProvinceCode unavailable, using Person StateProvince IsOnlyStateProvinceFlag CountryRegionCode. Person StateProvince Name State or province description. ID of the territory in which the state or province is located. Foreign key to Person StateProvince TerritoryID SalesTerritory.SalesTerritoryID. ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication Person StateProvince rowguid sample. Person StateProvince ModifiedDate Date and time the record was last updated. Production BillOfMaterials BillOfMaterialsID Primary key for BillOfMaterials records. Parent product identification number. Foreign Production BillOfMaterials ProductAssemblyID key to Product.ProductID. Component identification number. Foreign key Production BillOfMaterials ComponentID to Product.ProductID. Date the component started being used in the Production BillOfMaterials StartDate assembly item. Date the component stopped being used in the Production BillOfMaterials EndDate assembly item. Standard code identifying the unit of measure Production BillOfMaterials UnitMeasureCode for the quantity. Indicates the depth the component is from its Production BillOfMaterials BOMLevel parent (AssemblyID). Quantity of the component needed to create the Production BillOfMaterials PerAssemblyQty assembly. Production BillOfMaterials ModifiedDate Date and time the record was last updated. Production Culture CultureID Primary key for Culture records. Production Culture Name Culture description. Production Culture ModifiedDate Date and time the record was last updated. Production Document DocumentNode Primary key for Document records. Production Document DocumentLevel Depth in the document hierarchy. Production Document Title Title of the document. Employee who controls the document. Foreign Production Document Owner key to Employee.BusinessEntityID Production Document FolderFlag 0 = This is a folder, 1 = This is a document. Production Document FileName File name of the document File extension indicating the document type. For Production Document FileExtension example, .doc or .txt. Production Document Revision Revision number of the document. Production Document ChangeNumber Engineering change approval number. 1 = Pending approval, 2 = Approved, 3 = Production Document Status Obsolete Production Document DocumentSummary Document abstract. Production Document Document Complete document. ROWGUIDCOL number uniquely identifying the Production Document rowguid record. Required for FileStream. Production Document ModifiedDate Date and time the record was last updated. Production Illustration IllustrationID Primary key for Illustration records. Illustrations used in manufacturing instructions. Production Illustration Diagram Stored as XML. Production Illustration ModifiedDate Date and time the record was last updated. Production Location LocationID Primary key for Location records. Production Location Name Location description. Standard hourly cost of the manufacturing Production Location CostRate location. Work capacity (in hours) of the manufacturing Production Location Availability location. Production Location ModifiedDate Date and time the record was last updated. Production Product ProductID Primary key for Product records. Production Product Name Name of the product. Production Product ProductNumber Unique product identification number. 0 = Product is purchased, 1 = Product is Production Product MakeFlag manufactured in-house. 0 = Product is not a salable item. 1 = Product is Production Product FinishedGoodsFlag salable. Production Product Color Product color. Production Product SafetyStockLevel Minimum inventory quantity. Inventory level that triggers a purchase order or Production Product ReorderPoint work order. Production Product StandardCost Standard cost of the product. Production Product ListPrice Selling price. Production Product Size Product size. Production Product SizeUnitMeasureCode Unit of measure for Size column. WeightUnitMeasureCo Production Product de Unit of measure for Weight column. Production Product Weight Product weight. Number of days required to manufacture the Production Product DaysToManufacture product. R = Road, M = Mountain, T = Touring, S = Production Product ProductLine Standard Production Product Class H = High, M = Medium, L = Low Production Product Style W = Womens, M = Mens, U = Universal Product is a member of this product subcategory. Foreign key to Production Product ProductSubcategoryID ProductSubCategory.ProductSubCategoryID. Product is a member of this product model. Production Product ProductModelID Foreign key to ProductModel.ProductModelID. Production Product SellStartDate Date the product was available for sale. Date the product was no longer available for Production Product SellEndDate sale. Production Product DiscontinuedDate Date the product was discontinued. ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication Production Product rowguid sample. Production Product ModifiedDate Date and time the record was last updated. Production ProductCategory ProductCategoryID Primary key for ProductCategory records. Production ProductCategory Name Category description. ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication Production ProductCategory rowguid sample. Production ProductCategory ModifiedDate Date and time the record was last updated. Product identification number. Foreign key to Production ProductCostHistory ProductID Product.ProductID Production ProductCostHistory StartDate Product cost start date. Production ProductCostHistory EndDate Product cost end date. Production ProductCostHistory StandardCost Standard cost of the product. Production ProductCostHistory ModifiedDate Date and time the record was last updated. Production ProductDescription ProductDescriptionID Primary key for ProductDescription records. Production ProductDescription Description Description of the product. ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication Production ProductDescription rowguid sample. Production ProductDescription ModifiedDate Date and time the record was last updated. Product identification number. Foreign key to Production ProductDocument ProductID Product.ProductID. Document identification number. Foreign key to Production ProductDocument DocumentNode Document.DocumentNode. Production ProductDocument ModifiedDate Date and time the record was last updated. Product identification number. Foreign key to Production ProductInventory ProductID Product.ProductID. Inventory location identification number. Production ProductInventory LocationID Foreign key to Location.LocationID. Storage compartment within an inventory Production ProductInventory Shelf location. Storage container on a shelf in an inventory Production ProductInventory Bin location. Production ProductInventory Quantity Quantity of products in the inventory location. ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication Production ProductInventory rowguid sample. Production ProductInventory ModifiedDate Date and time the record was last updated. Product identification number. Foreign key to Production ProductListPriceHistory ProductID Product.ProductID Production ProductListPriceHistory StartDate List price start date. Production ProductListPriceHistory EndDate List price end date Production ProductListPriceHistory ListPrice Product list price. Production ProductListPriceHistory ModifiedDate Date and time the record was last updated. Production ProductModel ProductModelID Primary key for ProductModel records. Production ProductModel Name Product model description. Detailed product catalog information in xml Production ProductModel CatalogDescription format. Production ProductModel Instructions Manufacturing instructions in xml format. ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication Production ProductModel rowguid sample. Production ProductModel ModifiedDate Date and time the record was last updated. Primary key. Foreign key to Production ProductModelIllustration ProductModelID ProductModel.ProductModelID. Primary key. Foreign key to Production ProductModelIllustration IllustrationID Illustration.IllustrationID. Production ProductModelIllustration ModifiedDate Date and time the record was last updated. ProductModelProductDescriptionCult Primary key. Foreign key to Production ure ProductModelID ProductModel.ProductModelID. ProductModelProductDescriptionCult Primary key. Foreign key to Production ure ProductDescriptionID ProductDescription.ProductDescriptionID. ProductModelProductDescriptionCult Culture identification number. Foreign key to Production ure CultureID Culture.CultureID. ProductModelProductDescriptionCult Production ure ModifiedDate Date and time the record was last updated. Production ProductPhoto ProductPhotoID Primary key for ProductPhoto records. Production ProductPhoto ThumbNailPhoto Small image of the product. ThumbnailPhotoFileNa Production ProductPhoto me Small image file name. Production ProductPhoto LargePhoto Large image of the product. Production ProductPhoto LargePhotoFileName Large image file name. Production ProductPhoto ModifiedDate Date and time the record was last updated. Product identification number. Foreign key to Production ProductProductPhoto ProductID Product.ProductID. Product photo identification number. Foreign Production ProductProductPhoto ProductPhotoID key to ProductPhoto.ProductPhotoID. 0 = Photo is not the principal image. 1 = Photo is Production ProductProductPhoto Primary the principal image. Production ProductProductPhoto ModifiedDate Date and time the record was last updated. Production ProductReview ProductReviewID Primary key for ProductReview records. Product identification number. Foreign key to Production ProductReview ProductID Product.ProductID. Production ProductReview ReviewerName Name of the reviewer. Production ProductReview ReviewDate Date review was submitted. Production ProductReview EmailAddress Reviewer's e-mail address. Product rating given by the reviewer. Scale is 1 Production ProductReview Rating to 5 with 5 as the highest rating. Production ProductReview Comments Reviewer's comments Production ProductReview ModifiedDate Date and time the record was last updated. Production ProductSubcategory ProductSubcategoryID Primary key for ProductSubcategory records. Product category identification number. Foreign Production ProductSubcategory ProductCategoryID key to ProductCategory.ProductCategoryID. Production ProductSubcategory Name Subcategory description. ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication Production ProductSubcategory rowguid sample. Production ProductSubcategory ModifiedDate Date and time the record was last updated. Production ScrapReason ScrapReasonID Primary key for ScrapReason records. Production ScrapReason Name Failure description. Production ScrapReason ModifiedDate Date and time the record was last updated. Production TransactionHistory TransactionID Primary key for TransactionHistory records. Product identification number. Foreign key to Production TransactionHistory ProductID Product.ProductID. Purchase order, sales order, or work order Production TransactionHistory ReferenceOrderID identification number. Line number associated with the purchase order, Production TransactionHistory ReferenceOrderLineID sales order, or work order. Production TransactionHistory TransactionDate Date and time of the transaction. W = WorkOrder, S = SalesOrder, P = Production TransactionHistory TransactionType PurchaseOrder Production TransactionHistory Quantity Product quantity. Production TransactionHistory ActualCost Product cost. Production TransactionHistory ModifiedDate Date and time the record was last updated. Primary key for TransactionHistoryArchive Production TransactionHistoryArchive TransactionID records. Product identification number. Foreign key to Production TransactionHistoryArchive ProductID Product.ProductID. Purchase order, sales order, or work order Production TransactionHistoryArchive ReferenceOrderID identification number. Line number associated with the purchase order, Production TransactionHistoryArchive ReferenceOrderLineID sales order, or work order. Production TransactionHistoryArchive TransactionDate Date and time of the transaction. W = Work Order, S = Sales Order, P = Purchase Production TransactionHistoryArchive TransactionType Order Production TransactionHistoryArchive Quantity Product quantity. Production TransactionHistoryArchive ActualCost Product cost. Production TransactionHistoryArchive ModifiedDate Date and time the record was last updated. Production UnitMeasure UnitMeasureCode Primary key. Production UnitMeasure Name Unit of measure description. Production UnitMeasure ModifiedDate Date and time the record was last updated. Production WorkOrder WorkOrderID Primary key for WorkOrder records. Product identification number. Foreign key to Production WorkOrder ProductID Product.ProductID. Production WorkOrder OrderQty Product quantity to build. Production WorkOrder StockedQty Quantity built and put in inventory. Production WorkOrder ScrappedQty Quantity that failed inspection. Production WorkOrder StartDate Work order start date. Production WorkOrder EndDate Work order end date. Production WorkOrder DueDate Work order due date. Production WorkOrder ScrapReasonID Reason for inspection failure. Production WorkOrder ModifiedDate Date and time the record was last updated. Primary key. Foreign key to Production WorkOrderRouting WorkOrderID WorkOrder.WorkOrderID. Production WorkOrderRouting ProductID Primary key. Foreign key to Product.ProductID. Primary key. Indicates the manufacturing Production WorkOrderRouting OperationSequence process sequence. Manufacturing location where the part is Production WorkOrderRouting LocationID processed. Foreign key to Location.LocationID. Production WorkOrderRouting ScheduledStartDate Planned manufacturing start date. Production WorkOrderRouting ScheduledEndDate Planned manufacturing end date. Production WorkOrderRouting ActualStartDate Actual start date. Production WorkOrderRouting ActualEndDate Actual end date. Production WorkOrderRouting ActualResourceHrs Number of manufacturing hours used. Production WorkOrderRouting PlannedCost Estimated manufacturing cost. Production WorkOrderRouting ActualCost Actual manufacturing cost. Production WorkOrderRouting ModifiedDate Date and time the record was last updated. Purchasing ProductVendor ProductID Primary key. Foreign key to Product.ProductID. Primary key. Foreign key to Purchasing ProductVendor BusinessEntityID Vendor.BusinessEntityID. The average span of time (in days) between placing an order with the vendor and receiving Purchasing ProductVendor AverageLeadTime the purchased product. Purchasing ProductVendor StandardPrice The vendor's usual selling price. Purchasing ProductVendor LastReceiptCost The selling price when last purchased. Date the product was last received by the Purchasing ProductVendor LastReceiptDate vendor. Purchasing ProductVendor MinOrderQty The maximum quantity that should be ordered. Purchasing ProductVendor MaxOrderQty The minimum quantity that should be ordered. Purchasing ProductVendor OnOrderQty The quantity currently on order. Purchasing ProductVendor UnitMeasureCode The product's unit of measure. Purchasing ProductVendor ModifiedDate Date and time the record was last updated. Primary key. Foreign key to Purchasing PurchaseOrderDetail PurchaseOrderID PurchaseOrderHeader.PurchaseOrderID. Primary key. One line number per purchased Purchasing PurchaseOrderDetail PurchaseOrderDetailID product. Purchasing PurchaseOrderDetail DueDate Date the product is expected to be received. Purchasing PurchaseOrderDetail OrderQty Quantity ordered. Product identification number. Foreign key to Purchasing PurchaseOrderDetail ProductID Product.ProductID. Purchasing PurchaseOrderDetail UnitPrice Vendor's selling price of a single product. Per product subtotal. Computed as OrderQty * Purchasing PurchaseOrderDetail LineTotal UnitPrice. Purchasing PurchaseOrderDetail ReceivedQty Quantity actually received from the vendor. Purchasing PurchaseOrderDetail RejectedQty Quantity rejected during inspection. Quantity accepted into inventory. Computed as Purchasing PurchaseOrderDetail StockedQty ReceivedQty - RejectedQty. Purchasing PurchaseOrderDetail ModifiedDate Date and time the record was last updated. Purchasing PurchaseOrderHeader PurchaseOrderID Primary key. Incremental number to track changes to the Purchasing PurchaseOrderHeader RevisionNumber purchase order over time. Order current status. 1 = Pending; 2 = Approved; Purchasing PurchaseOrderHeader Status 3 = Rejected; 4 = Complete Employee who created the purchase order. Purchasing PurchaseOrderHeader EmployeeID Foreign key to Employee.BusinessEntityID. Vendor with whom the purchase order is placed. Purchasing PurchaseOrderHeader VendorID Foreign key to Vendor.BusinessEntityID. Shipping method. Foreign key to Purchasing PurchaseOrderHeader ShipMethodID ShipMethod.ShipMethodID. Purchasing PurchaseOrderHeader OrderDate Purchase order creation date. Purchasing PurchaseOrderHeader ShipDate Estimated shipment date from the vendor. Purchase order subtotal. Computed as SUM(PurchaseOrderDetail.LineTotal)for the Purchasing PurchaseOrderHeader SubTotal appropriate PurchaseOrderID. Purchasing PurchaseOrderHeader TaxAmt Tax amount. Purchasing PurchaseOrderHeader Freight Shipping cost. Total due to vendor. Computed as Subtotal + Purchasing PurchaseOrderHeader TotalDue TaxAmt + Freight. Purchasing PurchaseOrderHeader ModifiedDate Date and time the record was last updated. Purchasing ShipMethod ShipMethodID Primary key for ShipMethod records. Purchasing ShipMethod Name Shipping company name. Purchasing ShipMethod ShipBase Minimum shipping charge. Purchasing ShipMethod ShipRate Shipping charge per pound. ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication Purchasing ShipMethod rowguid sample. Purchasing ShipMethod ModifiedDate Date and time the record was last updated. Primary key for Vendor records. Foreign key to Purchasing Vendor BusinessEntityID BusinessEntity.BusinessEntityID Purchasing Vendor AccountNumber Vendor account (identification) number. Purchasing Vendor Name Company name. 1 = Superior, 2 = Excellent, 3 = Above average, 4 Purchasing Vendor CreditRating = Average, 5 = Below average 0 = Do not use if another vendor is available. 1 = Preferred over other vendors supplying the Purchasing Vendor PreferredVendorStatus same product. 0 = Vendor no longer used. 1 = Vendor is actively Purchasing Vendor ActiveFlag used. PurchasingWebService Purchasing Vendor URL Vendor URL. Purchasing Vendor ModifiedDate Date and time the record was last updated. ISO code for countries and regions. Foreign key Sales CountryRegionCurrency CountryRegionCode to CountryRegion.CountryRegionCode. ISO standard currency code. Foreign key to Sales CountryRegionCurrency CurrencyCode Currency.CurrencyCode. Sales CountryRegionCurrency ModifiedDate Date and time the record was last updated. Sales CreditCard CreditCardID Primary key for CreditCard records. Sales CreditCard CardType Credit card name. Sales CreditCard CardNumber Credit card number. Sales CreditCard ExpMonth Credit card expiration month. Sales CreditCard ExpYear Credit card expiration year. Sales CreditCard ModifiedDate Date and time the record was last updated. Sales Currency CurrencyCode The ISO code for the Currency. Sales Currency Name Currency name. Sales Currency ModifiedDate Date and time the record was last updated. Sales CurrencyRate CurrencyRateID Primary key for CurrencyRate records. Sales CurrencyRate CurrencyRateDate Date and time the exchange rate was obtained. Exchange rate was converted from this currency Sales CurrencyRate FromCurrencyCode code. Exchange rate was converted to this currency Sales CurrencyRate ToCurrencyCode code. Sales CurrencyRate AverageRate Average exchange rate for the day. Sales CurrencyRate EndOfDayRate Final exchange rate for the day. Sales CurrencyRate ModifiedDate Date and time the record was last updated. Sales Customer CustomerID Primary key. Sales Customer PersonID Foreign key to Person.BusinessEntityID Sales Customer StoreID Foreign key to Store.BusinessEntityID ID of the territory in which the customer is located. Foreign key to Sales Customer TerritoryID SalesTerritory.SalesTerritoryID. Unique number identifying the customer Sales Customer AccountNumber assigned by the accounting system. ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication Sales Customer rowguid sample. Sales Customer ModifiedDate Date and time the record was last updated. Business entity identification number. Foreign Sales PersonCreditCard BusinessEntityID key to Person.BusinessEntityID. Credit card identification number. Foreign key to Sales PersonCreditCard CreditCardID CreditCard.CreditCardID. Sales PersonCreditCard ModifiedDate Date and time the record was last updated. Primary key. Foreign key to Sales SalesOrderDetail SalesOrderID SalesOrderHeader.SalesOrderID. Primary key. One incremental unique number Sales SalesOrderDetail SalesOrderDetailID per product sold. Shipment tracking number supplied by the Sales SalesOrderDetail CarrierTrackingNumber shipper. Sales SalesOrderDetail OrderQty Quantity ordered per product. Product sold to customer. Foreign key to Sales SalesOrderDetail ProductID Product.ProductID. Promotional code. Foreign key to Sales SalesOrderDetail SpecialOfferID SpecialOffer.SpecialOfferID. Sales SalesOrderDetail UnitPrice Selling price of a single product. Sales SalesOrderDetail UnitPriceDiscount Discount amount. Per product subtotal. Computed as UnitPrice * (1 Sales SalesOrderDetail LineTotal - UnitPriceDiscount) * OrderQty. ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication Sales SalesOrderDetail rowguid sample. Sales SalesOrderDetail ModifiedDate Date and time the record was last updated. Sales SalesOrderHeader SalesOrderID Primary key. Incremental number to track changes to the Sales SalesOrderHeader RevisionNumber sales order over time. Sales SalesOrderHeader OrderDate Dates the sales order was created. Sales SalesOrderHeader DueDate Date the order is due to the customer. Sales SalesOrderHeader ShipDate Date the order was shipped to the customer. Order current status. 1 = In process; 2 = Approved; 3 = Backordered; 4 = Rejected; 5 = Sales SalesOrderHeader Status Shipped; 6 = Cancelled 0 = Order placed by sales person. 1 = Order Sales SalesOrderHeader OnlineOrderFlag placed online by customer. Sales SalesOrderHeader SalesOrderNumber Unique sales order identification number. Sales SalesOrderHeader PurchaseOrderNumber Customer purchase order number reference. Sales SalesOrderHeader AccountNumber Financial accounting number reference. Customer identification number. Foreign key to Sales SalesOrderHeader CustomerID Customer.BusinessEntityID. Sales person who created the sales order. Sales SalesOrderHeader SalesPersonID Foreign key to SalesPerson.BusinessEntityID. Territory in which the sale was made. Foreign Sales SalesOrderHeader TerritoryID key to SalesTerritory.SalesTerritoryID. Customer billing address. Foreign key to Sales SalesOrderHeader BillToAddressID Address.AddressID. Customer shipping address. Foreign key to Sales SalesOrderHeader ShipToAddressID Address.AddressID. Shipping method. Foreign key to Sales SalesOrderHeader ShipMethodID ShipMethod.ShipMethodID. Credit card identification number. Foreign key to Sales SalesOrderHeader CreditCardID CreditCard.CreditCardID. CreditCardApprovalCod Approval code provided by the credit card Sales SalesOrderHeader e company. Currency exchange rate used. Foreign key to Sales SalesOrderHeader CurrencyRateID CurrencyRate.CurrencyRateID. Sales subtotal. Computed as SUM(SalesOrderDetail.LineTotal)for the Sales SalesOrderHeader SubTotal appropriate SalesOrderID. Sales SalesOrderHeader TaxAmt Tax amount. Sales SalesOrderHeader Freight Shipping cost. Total due from customer. Computed as Subtotal Sales SalesOrderHeader TotalDue + TaxAmt + Freight. Sales SalesOrderHeader Comment Sales representative comments. ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication Sales SalesOrderHeader rowguid sample. Sales SalesOrderHeader ModifiedDate Date and time the record was last updated. Primary key. Foreign key to Sales SalesOrderHeaderSalesReason SalesOrderID SalesOrderHeader.SalesOrderID. Primary key. Foreign key to Sales SalesOrderHeaderSalesReason SalesReasonID SalesReason.SalesReasonID. Sales SalesOrderHeaderSalesReason ModifiedDate Date and time the record was last updated. Primary key for SalesPerson records. Foreign key Sales SalesPerson BusinessEntityID to Employee.BusinessEntityID Territory currently assigned to. Foreign key to Sales SalesPerson TerritoryID SalesTerritory.SalesTerritoryID. Sales SalesPerson SalesQuota Projected yearly sales. Sales SalesPerson Bonus Bonus due if quota is met. Sales SalesPerson CommissionPct Commision percent received per sale. Sales SalesPerson SalesYTD Sales total year to date. Sales SalesPerson SalesLastYear Sales total of previous year. ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication Sales SalesPerson rowguid sample. Sales SalesPerson ModifiedDate Date and time the record was last updated. Sales person identification number. Foreign key Sales SalesPersonQuotaHistory BusinessEntityID to SalesPerson.BusinessEntityID. Sales SalesPersonQuotaHistory QuotaDate Sales quota date. Sales SalesPersonQuotaHistory SalesQuota Sales quota amount. ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication Sales SalesPersonQuotaHistory rowguid sample. Sales SalesPersonQuotaHistory ModifiedDate Date and time the record was last updated. Sales SalesReason SalesReasonID Primary key for SalesReason records. Sales SalesReason Name Sales reason description. Sales SalesReason ReasonType Category the sales reason belongs to. Sales SalesReason ModifiedDate Date and time the record was last updated. Sales SalesTaxRate SalesTaxRateID Primary key for SalesTaxRate records. State, province, or country/region the sales tax Sales SalesTaxRate StateProvinceID applies to. 1 = Tax applied to retail transactions, 2 = Tax applied to wholesale transactions, 3 = Tax applied to all sales (retail and wholesale) Sales SalesTaxRate TaxType transactions. Sales SalesTaxRate TaxRate Tax rate amount. Sales SalesTaxRate Name Tax rate description. ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication Sales SalesTaxRate rowguid sample. Sales SalesTaxRate ModifiedDate Date and time the record was last updated. Sales SalesTerritory TerritoryID Primary key for SalesTerritory records. Sales SalesTerritory Name Sales territory description ISO standard country or region code. Foreign key Sales SalesTerritory CountryRegionCode to CountryRegion.CountryRegionCode. Geographic area to which the sales territory Sales SalesTerritory Group belong. Sales SalesTerritory SalesYTD Sales in the territory year to date. Sales SalesTerritory SalesLastYear Sales in the territory the previous year. Sales SalesTerritory CostYTD Business costs in the territory year to date. Sales SalesTerritory CostLastYear Business costs in the territory the previous year. ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication Sales SalesTerritory rowguid sample. Sales SalesTerritory ModifiedDate Date and time the record was last updated. Primary key. The sales rep. Foreign key to Sales SalesTerritoryHistory BusinessEntityID SalesPerson.BusinessEntityID. Primary key. Territory identification number. Sales SalesTerritoryHistory TerritoryID Foreign key to SalesTerritory.SalesTerritoryID. Primary key. Date the sales representive started Sales SalesTerritoryHistory StartDate work in the territory. Date the sales representative left work in the Sales SalesTerritoryHistory EndDate territory. ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication Sales SalesTerritoryHistory rowguid sample. Sales SalesTerritoryHistory ModifiedDate Date and time the record was last updated. Sales ShoppingCartItem ShoppingCartItemID Primary key for ShoppingCartItem records. Sales ShoppingCartItem ShoppingCartID Shopping cart identification number. Sales ShoppingCartItem Quantity Product quantity ordered. Product ordered. Foreign key to Sales ShoppingCartItem ProductID Product.ProductID. Sales ShoppingCartItem DateCreated Date the time the record was created. Sales ShoppingCartItem ModifiedDate Date and time the record was last updated. Sales SpecialOffer SpecialOfferID Primary key for SpecialOffer records. Sales SpecialOffer Description Discount description. Sales SpecialOffer DiscountPct Discount precentage. Sales SpecialOffer Type Discount type category. Group the discount applies to such as Reseller or Sales SpecialOffer Category Customer. Sales SpecialOffer StartDate Discount start date. Sales SpecialOffer EndDate Discount end date. Sales SpecialOffer MinQty Minimum discount percent allowed. Sales SpecialOffer MaxQty Maximum discount percent allowed. ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication Sales SpecialOffer rowguid sample. Sales SpecialOffer ModifiedDate Date and time the record was last updated. Sales SpecialOfferProduct SpecialOfferID Primary key for SpecialOfferProduct records. Product identification number. Foreign key to Sales SpecialOfferProduct ProductID Product.ProductID. ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication Sales SpecialOfferProduct rowguid sample. Sales SpecialOfferProduct ModifiedDate Date and time the record was last updated. Primary key. Foreign key to Sales Store BusinessEntityID Customer.BusinessEntityID. Sales Store Name Name of the store. ID of the sales person assigned to the customer. Sales Store SalesPersonID Foreign key to SalesPerson.BusinessEntityID. Demographic informationg about the store such as the number of employees, annual sales and Sales Store Demographics store type. ROWGUIDCOL number uniquely identifying the record. Used to support a merge replication Sales Store rowguid sample. Sales Store ModifiedDate Date and time the record was last updated.