Property | Value |
Model name | AdventureWorks |
Description | From the AdventureWorks sample database described at https://docs.microsoft.com/en-us/sql/samples/adventureworks-install-configure?view=sql-server-ver15 |
DB vendor | MSSQLServer |
DB version | 2019 |
Property | Value |
Business Name | Name |
Type | char |
Subtype | nvarchar |
JSON Types | string |
Length | 50 |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Property | Value |
Business Name | NameStyle |
Type | numeric |
Subtype | bit |
Default | ((0)) |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Excl min | false |
Excl max | false |
Property | Value |
Business Name | Phone |
Type | char |
Subtype | nvarchar |
JSON Types | string |
Length | 25 |
Not null | false |
Sparse | false |
Primary key | false |
Unique | false |
Property | Value |
Business Name | Flag |
Type | numeric |
Subtype | bit |
Default | 1 |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Excl min | false |
Excl max | false |
Property | Value |
Business Name | OrderNumber |
Type | char |
Subtype | nvarchar |
JSON Types | string |
Length | 25 |
Not null | false |
Sparse | false |
Primary key | false |
Unique | false |
Property | Value |
Business Name | AccountNumber |
Type | char |
Subtype | nvarchar |
JSON Types | string |
Length | 15 |
Not null | false |
Sparse | false |
Primary key | false |
Unique | false |
Property | Value |
Schema name | SalesLT |
Technical name | |
Comments | |
Remarks | |
Database name | HackDBSQL |
Property | Value |
Table | Address |
Technical name | |
Id | |
Schema | SalesLT |
Additional properties | false |
Comments | |
Memory optimized | false |
Remarks |
Column | Type | Req | Key | Description | Comments |
AddressID | int | true | |||
AddressLine1 | nvarchar(60) | true | This is for house number, street, and optional apt/suite | ||
AddressLine2 | nvarchar(60) | true | |||
City | nvarchar(30) | true | |||
StateProvince | nvarchar(50) | false | |||
CountryRegion | nvarchar(50) | false | |||
PostalCode | nvarchar(15) | true | |||
rowguid | uniqueidentifier | true | |||
ModifiedDate | datetime | true |
Property | Value |
Business Name | AddressID |
Type | numeric |
Subtype | int |
Not null | true |
Identity | [object Object] |
Sparse | false |
Primary key | true |
Primary key options | [object Object] |
Unique | false |
Excl min | false |
Excl max | false |
Sample | 9 |
Property | Value |
Business Name | AddressLine1 |
Type | char |
Subtype | nvarchar |
JSON Types | string |
Length | 60 |
Comments | This is for house number, street, and optional apt/suite |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Sample | 8713 Yosemite Ct. |
Property | Value |
Business Name | AddressLine2 |
Type | char |
Subtype | nvarchar |
JSON Types | string |
Length | 60 |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Property | Value |
Business Name | City |
Type | char |
Subtype | nvarchar |
JSON Types | string |
Length | 30 |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Sample | Bothell |
Property | Value |
Business Name | StateProvince |
$ref | #model/definitions/Name |
Reference type | model |
Property | Value |
Business Name | CountryRegion |
$ref | #model/definitions/Name |
Reference type | model |
Property | Value |
Business Name | PostalCode |
Type | char |
Subtype | nvarchar |
JSON Types | string |
Length | 15 |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Sample | 98011 |
Property | Value |
Business Name | rowguid |
Type | uniqueidentifier |
Not null | true |
Sparse | false |
Primary key | false |
Unique | true |
Unique key options | |
[1] Constraint name | AK_Address_rowguid |
Partition name | PRIMARY |
Order | ASC |
Statistics no recompute | |
Statistics incremental | |
Ignore duplicate | |
Allow row locks | true |
Allow page locks | true |
Padded | |
Fill factor | |
Optimize for sequential key | |
Clustered | |
Data compression | NONE |
Default | (newid()) |
Default constraint name | DF_Address_rowguid |
Sample | 268AF621-76D7-4C78-9441-144FD139821A |
Property | Value |
Business Name | ModifiedDate |
Type | datetime |
Subtype | datetime |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Default | (getdate()) |
Default constraint name | DF_Address_ModifiedDate |
Sample | 2006-07-01T00:00:00.000Z |
Property | |
Name | IX_Address_AddressLine1_AddressLine2_City_StateProvince_PostalCode_CountryRegion |
Type | Index |
Unique | |
Clustered | |
Keys | |
AddressLine1 | |
AddressLine2 | |
City | |
StateProvince | |
PostalCode | |
CountryRegion | |
Include non-key columns | |
Description | |
Pad index | |
Fill factor | |
Ignore duplicate key | |
Included columns | |
Statistics no recompute | |
Statistics incremental | |
Allow row locks | true |
Allow page locks | true |
Optimize for sequential key | |
Compression delay (minutes) | |
Data compression | NONE |
Comments |
Property | |
Name | IX_Address_StateProvince |
Type | Index |
Unique | |
Clustered | |
Keys | |
StateProvince | |
Include non-key columns | |
Description | |
Pad index | |
Fill factor | |
Ignore duplicate key | |
Included columns | |
Statistics no recompute | |
Statistics incremental | |
Allow row locks | true |
Allow page locks | true |
Optimize for sequential key | |
Compression delay (minutes) | |
Data compression | NONE |
Comments |
CREATE DATABASE [HackDBSQL]; GO USE [HackDBSQL] GO CREATE SCHEMA [SalesLT]; GO CREATE TYPE [SalesLT].[Name] FROM NVARCHAR(50) NOT NULL GO CREATE TYPE [SalesLT].[NameStyle] FROM BIT NOT NULL GO CREATE TYPE [SalesLT].[Phone] FROM NVARCHAR(25) GO CREATE TYPE [SalesLT].[Flag] FROM BIT NOT NULL GO CREATE TYPE [SalesLT].[OrderNumber] FROM NVARCHAR(25) GO CREATE TYPE [SalesLT].[AccountNumber] FROM NVARCHAR(15) GO CREATE TABLE [SalesLT].[Address] ( [AddressID] INT IDENTITY(1, 1) NOT NULL, [AddressLine1] NVARCHAR(60) NOT NULL, [AddressLine2] NVARCHAR(60) NOT NULL, [City] NVARCHAR(30) NOT NULL, [StateProvince] [SalesLT].[Name], [CountryRegion] [SalesLT].[Name], [PostalCode] NVARCHAR(15) NOT NULL, [rowguid] UNIQUEIDENTIFIER NOT NULL, [ModifiedDate] DATETIME NOT NULL, CONSTRAINT [PK_Address_AddressID] PRIMARY KEY CLUSTERED ([AddressID] ASC) WITH ( IGNORE_DUP_KEY = ON, STATISTICS_NORECOMPUTE = ON ) ON [PRIMARY], CONSTRAINT [AK_Address_rowguid] UNIQUE NONCLUSTERED ([rowguid] ASC) ON [PRIMARY] ) GO ALTER TABLE [SalesLT].[Address] ADD CONSTRAINT [DF_Address_rowguid] DEFAULT (newid()) FOR [rowguid] GO ALTER TABLE [SalesLT].[Address] ADD CONSTRAINT [DF_Address_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate] GO CREATE INDEX IX_Address_AddressLine1_AddressLine2_City_StateProvince_PostalCode_CountryRegion ON [SalesLT].[Address] ( [AddressLine1], [AddressLine2], [City], [StateProvince], [PostalCode], [CountryRegion] ) GO CREATE INDEX IX_Address_StateProvince ON [SalesLT].[Address] ( [StateProvince] ) GO
Property | Value |
Table | Customer |
Technical name | |
Id | |
Schema | SalesLT |
Additional properties | false |
Comments | |
Memory optimized | false |
Remarks |
Column | Type | Req | Key | Description | Comments |
CustomerID | int | true | |||
NameStyle | bit | false | |||
Title | nvarchar(8) | true | |||
FirstName | nvarchar(50) | false | |||
MiddleName | nvarchar(50) | false | |||
LastName | nvarchar(50) | false | |||
Suffix | nvarchar(10) | true | |||
CompanyName | nvarchar(128) | true | |||
SalesPerson | nvarchar(256) | true | |||
EmailAddress | nvarchar(50) | true | |||
Phone | nvarchar(25) | false | |||
PasswordHash | varchar(128) | true | |||
PasswordSalt | varchar(10) | true | |||
rowguid | uniqueidentifier | true | |||
ModifiedDate | datetime | true |
Property | Value |
Business Name | CustomerID |
Type | numeric |
Subtype | int |
Not null | true |
Identity | [object Object] |
Sparse | false |
Primary key | true |
Primary key options | [object Object] |
Unique | false |
Excl min | false |
Excl max | false |
Sample | 1 |
Property | Value |
Business Name | NameStyle |
$ref | #model/definitions/NameStyle |
Reference type | model |
Property | Value |
Business Name | Title |
Type | char |
Subtype | nvarchar |
JSON Types | string |
Length | 8 |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Sample | Mr. |
Property | Value |
Business Name | FirstName |
$ref | #model/definitions/Name |
Reference type | model |
Property | Value |
Business Name | MiddleName |
$ref | #model/definitions/Name |
Reference type | model |
Property | Value |
Business Name | LastName |
$ref | #model/definitions/Name |
Reference type | model |
Property | Value |
Business Name | Suffix |
Type | char |
Subtype | nvarchar |
JSON Types | string |
Length | 10 |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Property | Value |
Business Name | CompanyName |
Type | char |
Subtype | nvarchar |
JSON Types | string |
Length | 128 |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Sample | A Bike Store |
Property | Value |
Business Name | SalesPerson |
Type | char |
Subtype | nvarchar |
JSON Types | string |
Length | 256 |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Sample | adventure-works\pamela0 |
Property | Value |
Business Name | EmailAddress |
Type | char |
Subtype | nvarchar |
JSON Types | string |
Length | 50 |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Sample | orlando0@adventure-works.com |
Property | Value |
Business Name | Phone |
$ref | #model/definitions/Phone |
Reference type | model |
Property | Value |
Business Name | PasswordHash |
Type | char |
Subtype | varchar |
JSON Types | string |
Length | 128 |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Sample | L/Rlwxzp4w7RWmEgXX+/A7cXaePEPcp+KwQhl2fJL7w= |
Property | Value |
Business Name | PasswordSalt |
Type | char |
Subtype | varchar |
JSON Types | string |
Length | 10 |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Sample | 1KjXYs4= |
Property | Value |
Business Name | rowguid |
Type | uniqueidentifier |
Not null | true |
Sparse | false |
Primary key | false |
Unique | true |
Unique key options | |
[1] Constraint name | AK_Customer_rowguid |
Partition name | PRIMARY |
Order | ASC |
Statistics no recompute | |
Statistics incremental | |
Ignore duplicate | |
Allow row locks | true |
Allow page locks | true |
Padded | |
Fill factor | |
Optimize for sequential key | |
Clustered | |
Data compression | NONE |
Default | (newid()) |
Default constraint name | DF_Customer_rowguid |
Sample | 3F5AE95E-B87D-4AED-95B4-C3797AFCB74F |
Property | Value |
Business Name | ModifiedDate |
Type | datetime |
Subtype | datetime |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Default | (getdate()) |
Default constraint name | DF_Customer_ModifiedDate |
Sample | 2005-08-01T00:00:00.000Z |
Property | |
Name | IX_Customer_EmailAddress |
Type | Index |
Unique | |
Clustered | |
Keys | |
EmailAddress | |
Include non-key columns | |
Description | |
Pad index | |
Fill factor | |
Ignore duplicate key | |
Included columns | |
Statistics no recompute | |
Statistics incremental | |
Allow row locks | true |
Allow page locks | true |
Optimize for sequential key | |
Compression delay (minutes) | |
Data compression | NONE |
Comments |
CREATE DATABASE [HackDBSQL]; GO USE [HackDBSQL] GO CREATE SCHEMA [SalesLT]; GO CREATE TYPE [SalesLT].[Name] FROM NVARCHAR(50) NOT NULL GO CREATE TYPE [SalesLT].[NameStyle] FROM BIT NOT NULL GO CREATE TYPE [SalesLT].[Phone] FROM NVARCHAR(25) GO CREATE TYPE [SalesLT].[Flag] FROM BIT NOT NULL GO CREATE TYPE [SalesLT].[OrderNumber] FROM NVARCHAR(25) GO CREATE TYPE [SalesLT].[AccountNumber] FROM NVARCHAR(15) GO CREATE TABLE [SalesLT].[Customer] ( [CustomerID] INT IDENTITY(1, 1) NOT NULL, [NameStyle] [SalesLT].[NameStyle], [Title] NVARCHAR(8) NOT NULL, [FirstName] [SalesLT].[Name], [MiddleName] [SalesLT].[Name], [LastName] [SalesLT].[Name], [Suffix] NVARCHAR(10) NOT NULL, [CompanyName] NVARCHAR(128) NOT NULL, [SalesPerson] NVARCHAR(256) NOT NULL, [EmailAddress] NVARCHAR(50) NOT NULL, [Phone] [SalesLT].[Phone], [PasswordHash] VARCHAR(128) NOT NULL, [PasswordSalt] VARCHAR(10) NOT NULL, [rowguid] UNIQUEIDENTIFIER NOT NULL, [ModifiedDate] DATETIME NOT NULL, CONSTRAINT [PK_Customer_CustomerID] PRIMARY KEY CLUSTERED ([CustomerID] ASC) ON [PRIMARY], CONSTRAINT [AK_Customer_rowguid] UNIQUE NONCLUSTERED ([rowguid] ASC) ON [PRIMARY] ) GO ALTER TABLE [SalesLT].[Customer] ADD CONSTRAINT [DF_Customer_rowguid] DEFAULT (newid()) FOR [rowguid] GO ALTER TABLE [SalesLT].[Customer] ADD CONSTRAINT [DF_Customer_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate] GO CREATE INDEX IX_Customer_EmailAddress ON [SalesLT].[Customer] ( [EmailAddress] ) GO
Property | Value |
Table | CustomerAddress |
Technical name | |
Id | |
Schema | SalesLT |
Additional properties | false |
Comments | |
Memory optimized | false |
Remarks |
Column | Type | Req | Key | Description | Comments |
CustomerID | int | true | |||
AddressID | int | true | |||
AddressType | nvarchar(50) | false | |||
rowguid | uniqueidentifier | true | |||
ModifiedDate | datetime | true |
Property | Value |
Business Name | CustomerID |
Type | numeric |
Subtype | int |
Not null | true |
Sparse | false |
Primary key | true |
Foreign table | Customer |
Foreign field | CustomerID |
Relationship type | Foreign Key |
Excl min | false |
Excl max | false |
Sample | 29485 |
Property | Value |
Business Name | AddressType |
$ref | #model/definitions/Name |
Reference type | model |
Property | Value |
Business Name | rowguid |
Type | uniqueidentifier |
Not null | true |
Sparse | false |
Primary key | false |
Unique | true |
Unique key options | |
[1] Constraint name | AK_CustomerAddress_rowguid |
Partition name | PRIMARY |
Order | ASC |
Statistics no recompute | |
Statistics incremental | |
Ignore duplicate | |
Allow row locks | true |
Allow page locks | true |
Padded | |
Fill factor | |
Optimize for sequential key | |
Clustered | |
Data compression | NONE |
Default | (newid()) |
Default constraint name | DF_CustomerAddress_rowguid |
Sample | 16765338-DBE4-4421-B5E9-3836B9278E63 |
Property | Value |
Business Name | ModifiedDate |
Type | datetime |
Subtype | datetime |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Default | (getdate()) |
Default constraint name | DF_CustomerAddress_ModifiedDate |
Sample | 2007-09-01T00:00:00.000Z |
Property | |
Constraint name | PK_CustomerAddress_CustomerID_AddressID |
Key | |
CustomerID | |
AddressID | |
Partition name | PRIMARY |
Statistics no recompute | |
Statistics incremental | |
Ignore duplicate | |
Allow row locks | true |
Allow page locks | true |
Padded | |
Fill factor | |
Optimize for sequential key | |
Clustered | true |
Data compression | NONE |
CREATE DATABASE [HackDBSQL]; GO USE [HackDBSQL] GO CREATE SCHEMA [SalesLT]; GO CREATE TYPE [SalesLT].[Name] FROM NVARCHAR(50) NOT NULL GO CREATE TYPE [SalesLT].[NameStyle] FROM BIT NOT NULL GO CREATE TYPE [SalesLT].[Phone] FROM NVARCHAR(25) GO CREATE TYPE [SalesLT].[Flag] FROM BIT NOT NULL GO CREATE TYPE [SalesLT].[OrderNumber] FROM NVARCHAR(25) GO CREATE TYPE [SalesLT].[AccountNumber] FROM NVARCHAR(15) GO CREATE TABLE [SalesLT].[CustomerAddress] ( [CustomerID] INT NOT NULL, [AddressID] INT NOT NULL, [AddressType] [SalesLT].[Name], [rowguid] UNIQUEIDENTIFIER NOT NULL, [ModifiedDate] DATETIME NOT NULL, CONSTRAINT [PK_CustomerAddress_CustomerID_AddressID] PRIMARY KEY CLUSTERED ([CustomerID] ASC, [AddressID] ASC) ON [PRIMARY], CONSTRAINT [AK_CustomerAddress_rowguid] UNIQUE NONCLUSTERED ([rowguid] ASC) ON [PRIMARY], CONSTRAINT [FK_CustomerAddress_Customer_CustomerID] FOREIGN KEY (CustomerID) REFERENCES [SalesLT].[Customer](CustomerID), CONSTRAINT [FK_CustomerAddress_Address_AddressID] FOREIGN KEY (AddressID) REFERENCES [SalesLT].[Address](AddressID) ) GO ALTER TABLE [SalesLT].[CustomerAddress] ADD CONSTRAINT [DF_CustomerAddress_rowguid] DEFAULT (newid()) FOR [rowguid] GO ALTER TABLE [SalesLT].[CustomerAddress] ADD CONSTRAINT [DF_CustomerAddress_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate] GO
Property | Value |
Table | JSONtbl |
Technical name | |
Id | |
Schema | SalesLT |
Additional properties | false |
Comments | |
Memory optimized | false |
Remarks |
Column | Type | Req | Key | Description | Comments |
ID | nchar(10) | true | |||
JSONContent | nvarchar(MAX) | false | |||
city | object | true | |||
coord | object | true | |||
lat | number | true | |||
lon | number | true | |||
country | string | true | |||
id | number | true | |||
name | string | true | |||
data | array | true | |||
[0] | object | false | |||
clouds | object | true | |||
all | number | true | |||
dt | number | true | |||
dt_txt | string | true | |||
main | object | true | |||
grnd_level | number | true | |||
humidity | number | true | |||
pressure | number | true | |||
sea_level | number | true | |||
temp | number | true | |||
temp_kf | number | false | |||
temp_max | number | true | |||
temp_min | number | true | |||
snow | object | true | |||
3h | number | true | |||
sys | object | true | |||
pod | string | true | |||
weather | array | true | |||
[0] | object | false | |||
description | string | true | |||
icon | string | true | |||
id | number | true | |||
main | string | true | |||
wind | object | true | |||
deg | number | true | |||
speed | number | true | |||
rain | object | false | |||
3h | number | true | |||
time | number | true | |||
JSON2 | nvarchar(MAX) | true | |||
videoid | string | true | |||
added_date | string | true | |||
description | string | true | |||
location | string | true | |||
location_type | number | true | |||
metadata | array | true | |||
[0] | object | false | |||
height | number | true | |||
width | number | true | |||
video_bit_rate | array | true | |||
[0] | string | false | |||
encoding | string | true | |||
name | string | true | |||
tags | array | true | |||
[0] | string | false | |||
userid | string | true |
Property | Value |
Business Name | ID |
Type | char |
Subtype | nchar |
Length | 10 |
Not null | true |
Sparse | false |
Primary key | true |
Primary key options | [object Object] |
Unique | false |
Sample | 1 |
Column | Type | Req | Key | Description | Comments |
city | jsonObject | true | |||
data | jsonArray | true | |||
time | jsonNumber | true |
Property | Value |
Business Name | JSONContent |
Type | char |
Subtype | nvarchar |
JSON Types | object |
Has max length | true |
Not null | false |
Sparse | false |
Primary key | false |
Unique | false |
Column | Type | Req | Key | Description | Comments |
coord | jsonObject | true | |||
country | jsonString | true | |||
id | jsonNumber | true | |||
name | jsonString | true |
Property | Value |
Business Name | city |
Type | jsonObject |
JSON Type | char |
Required | true |
Additional properties | false |
Column | Type | Req | Key | Description | Comments |
lat | jsonNumber | true | |||
lon | jsonNumber | true |
Property | Value |
Business Name | coord |
Type | jsonObject |
JSON Type | char |
Required | true |
Additional properties | false |
Property | Value |
Business Name | lat |
Type | jsonNumber |
Required | true |
Excl min | false |
Excl max | false |
Sample | 52.200001 |
Property | Value |
Business Name | lon |
Type | jsonNumber |
Required | true |
Excl min | false |
Excl max | false |
Sample | 8.8 |
Property | Value |
Business Name | country |
Type | jsonString |
Required | true |
Sample | DE |
Property | Value |
Business Name | id |
Type | jsonNumber |
Required | true |
Excl min | false |
Excl max | false |
Sample | 2953386 |
Property | Value |
Business Name | name |
Type | jsonString |
Required | true |
Sample | Bad Oeynhausen |
Column | Type | Req | Key | Description | Comments |
[0] | jsonObject | false |
Property | Value |
Business Name | data |
Type | jsonArray |
JSON Type | char |
Required | true |
Unique items | false |
Additional items | true |
Column | Type | Req | Key | Description | Comments |
clouds | jsonObject | true | |||
dt | jsonNumber | true | |||
dt_txt | jsonString | true | |||
main | jsonObject | true | |||
snow | jsonObject | true | |||
sys | jsonObject | true | |||
weather | jsonArray | true | |||
wind | jsonObject | true | |||
rain | jsonObject | false |
Property | Value |
Type | jsonObject |
JSON Type | char |
Additional properties | false |
Column | Type | Req | Key | Description | Comments |
all | jsonNumber | true |
Property | Value |
Business Name | clouds |
Type | jsonObject |
JSON Type | char |
Required | true |
Additional properties | false |
Property | Value |
Business Name | all |
Type | jsonNumber |
Required | true |
Excl min | false |
Excl max | false |
Sample | 88 |
Property | Value |
Business Name | dt |
Type | jsonNumber |
Required | true |
Excl min | false |
Excl max | false |
Sample | 1518987600 |
Property | Value |
Business Name | dt_txt |
Type | jsonString |
Required | true |
Sample | 2018-02-18 21:00:00 |
Column | Type | Req | Key | Description | Comments |
grnd_level | jsonNumber | true | |||
humidity | jsonNumber | true | |||
pressure | jsonNumber | true | |||
sea_level | jsonNumber | true | |||
temp | jsonNumber | true | |||
temp_kf | jsonNumber | false | |||
temp_max | jsonNumber | true | |||
temp_min | jsonNumber | true |
Property | Value |
Business Name | main |
Type | jsonObject |
JSON Type | char |
Required | true |
Additional properties | false |
Property | Value |
Business Name | grnd_level |
Type | jsonNumber |
Required | true |
Excl min | false |
Excl max | false |
Sample | 1025.75 |
Property | Value |
Business Name | humidity |
Type | jsonNumber |
Required | true |
Excl min | false |
Excl max | false |
Sample | 98 |
Property | Value |
Business Name | pressure |
Type | jsonNumber |
Required | true |
Excl min | false |
Excl max | false |
Sample | 1025.75 |
Property | Value |
Business Name | sea_level |
Type | jsonNumber |
Required | true |
Excl min | false |
Excl max | false |
Sample | 1040.95 |
Property | Value |
Business Name | temp |
Type | jsonNumber |
Required | true |
Excl min | false |
Excl max | false |
Sample | 274.338 |
Property | Value |
Business Name | temp_kf |
Type | jsonNumber |
Required | false |
Excl min | false |
Excl max | false |
Property | Value |
Business Name | temp_max |
Type | jsonNumber |
Required | true |
Excl min | false |
Excl max | false |
Sample | 274.338 |
Property | Value |
Business Name | temp_min |
Type | jsonNumber |
Required | true |
Excl min | false |
Excl max | false |
Sample | 274.338 |
Column | Type | Req | Key | Description | Comments |
3h | jsonNumber | true |
Property | Value |
Business Name | snow |
Type | jsonObject |
JSON Type | char |
Required | true |
Additional properties | false |
Property | Value |
Business Name | 3h |
Type | jsonNumber |
Required | true |
Excl min | false |
Excl max | false |
Sample | 0.06 |
Column | Type | Req | Key | Description | Comments |
pod | jsonString | true |
Property | Value |
Business Name | sys |
Type | jsonObject |
JSON Type | char |
Required | true |
Additional properties | false |
Property | Value |
Business Name | pod |
Type | jsonString |
Required | true |
Sample | n |
Column | Type | Req | Key | Description | Comments |
[0] | jsonObject | false |
Property | Value |
Business Name | weather |
Type | jsonArray |
JSON Type | char |
Required | true |
Unique items | false |
Additional items | true |
Column | Type | Req | Key | Description | Comments |
description | jsonString | true | |||
icon | jsonString | true | |||
id | jsonNumber | true | |||
main | jsonString | true |
Property | Value |
Type | jsonObject |
JSON Type | char |
Additional properties | false |
Property | Value |
Business Name | description |
Type | jsonString |
Required | true |
Sample | light rain |
Property | Value |
Business Name | icon |
Type | jsonString |
Required | true |
Sample | 10n |
Property | Value |
Business Name | id |
Type | jsonNumber |
Required | true |
Excl min | false |
Excl max | false |
Sample | 500 |
Property | Value |
Business Name | main |
Type | jsonString |
Required | true |
Sample | Rain |
Column | Type | Req | Key | Description | Comments |
deg | jsonNumber | true | |||
speed | jsonNumber | true |
Property | Value |
Business Name | wind |
Type | jsonObject |
JSON Type | char |
Required | true |
Additional properties | false |
Property | Value |
Business Name | deg |
Type | jsonNumber |
Required | true |
Excl min | false |
Excl max | false |
Sample | 280.007 |
Property | Value |
Business Name | speed |
Type | jsonNumber |
Required | true |
Excl min | false |
Excl max | false |
Sample | 2.81 |
Column | Type | Req | Key | Description | Comments |
3h | jsonNumber | true |
Property | Value |
Business Name | rain |
Type | jsonObject |
JSON Type | char |
Required | false |
Additional properties | false |
Property | Value |
Business Name | 3h |
Type | jsonNumber |
Required | true |
Excl min | false |
Excl max | false |
Sample | 0.2 |
Property | Value |
Business Name | time |
Type | jsonNumber |
Required | true |
Excl min | false |
Excl max | false |
Sample | 1518548489 |
Column | Type | Req | Key | Description | Comments |
videoid | jsonString | true | |||
added_date | jsonString | true | |||
description | jsonString | true | |||
location | jsonString | true | |||
location_type | jsonNumber | true | |||
metadata | jsonArray | true | |||
name | jsonString | true | |||
tags | jsonArray | true | |||
userid | jsonString | true |
Property | Value |
Business Name | JSON2 |
Type | char |
Subtype | nvarchar |
JSON Types | object |
Has max length | true |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Property | Value |
Business Name | videoid |
Type | jsonString |
Required | true |
Sample | 50554d6e-29bb-11e5-b345-feff819cdc9e |
Property | Value |
Business Name | added_date |
Type | jsonString |
Required | true |
Sample | 2011-02-03 04:05:00+0000 |
Property | Value |
Business Name | description |
Type | jsonString |
Required | true |
Sample | Lorem |
Property | Value |
Business Name | location |
Type | jsonString |
Required | true |
Sample | Lorem |
Property | Value |
Business Name | location_type |
Type | jsonNumber |
Required | true |
Excl min | false |
Excl max | false |
Sample | 30 |
Column | Type | Req | Key | Description | Comments |
[0] | jsonObject | false |
Property | Value |
Business Name | metadata |
Type | jsonArray |
JSON Type | char |
Required | true |
Unique items | false |
Additional items | true |
Column | Type | Req | Key | Description | Comments |
height | jsonNumber | true | |||
width | jsonNumber | true | |||
video_bit_rate | jsonArray | true | |||
encoding | jsonString | true |
Property | Value |
Type | jsonObject |
JSON Type | char |
Additional properties | false |
Property | Value |
Business Name | height |
Type | jsonNumber |
Required | true |
Excl min | false |
Excl max | false |
Sample | -17 |
Property | Value |
Business Name | width |
Type | jsonNumber |
Required | true |
Excl min | false |
Excl max | false |
Sample | -17 |
Column | Type | Req | Key | Description | Comments |
[0] | jsonString | false |
Property | Value |
Business Name | video_bit_rate |
Type | jsonArray |
JSON Type | char |
Required | true |
Unique items | false |
Additional items | true |
Property | Value |
Type | jsonString |
Sample | Lorem |
Property | Value |
Business Name | encoding |
Type | jsonString |
Required | true |
Sample | Lorem |
Property | Value |
Business Name | name |
Type | jsonString |
Required | true |
Sample | Lorem |
Column | Type | Req | Key | Description | Comments |
[0] | jsonString | false |
Property | Value |
Business Name | tags |
Type | jsonArray |
JSON Type | char |
Required | true |
Unique items | false |
Additional items | true |
Property | Value |
Type | jsonString |
Sample | Lorem |
Property | Value |
Business Name | userid |
Type | jsonString |
Required | true |
Sample | 50554d6e-29bb-11e5-b345-feff819cdc9e |
CREATE DATABASE [HackDBSQL]; GO USE [HackDBSQL] GO CREATE SCHEMA [SalesLT]; GO CREATE TYPE [SalesLT].[Name] FROM NVARCHAR(50) NOT NULL GO CREATE TYPE [SalesLT].[NameStyle] FROM BIT NOT NULL GO CREATE TYPE [SalesLT].[Phone] FROM NVARCHAR(25) GO CREATE TYPE [SalesLT].[Flag] FROM BIT NOT NULL GO CREATE TYPE [SalesLT].[OrderNumber] FROM NVARCHAR(25) GO CREATE TYPE [SalesLT].[AccountNumber] FROM NVARCHAR(15) GO CREATE TABLE [SalesLT].[JSONtbl] ( [ID] NCHAR(10) NOT NULL, [JSONContent] NVARCHAR(MAX), [JSON2] NVARCHAR(MAX) NOT NULL, CONSTRAINT [PK_JSONtbl] PRIMARY KEY CLUSTERED ([ID] ASC) ON [PRIMARY] ) GO
Property | Value |
Table | Product |
Technical name | |
Id | |
Schema | SalesLT |
Additional properties | false |
Comments | |
Memory optimized | false |
Remarks |
Column | Type | Req | Key | Description | Comments |
ProductID | int | true | |||
Name | nvarchar(50) | false | |||
ProductNumber | nvarchar(25) | true | |||
Color | nvarchar(15) | true | |||
StandardCost | money | true | |||
ListPrice | money | true | |||
Size | nvarchar(5) | true | |||
Weight | decimal(8, 2) | true | |||
ProductCategoryID | int | true | |||
ProductModelID | int | true | |||
SellStartDate | datetime | true | |||
SellEndDate | datetime | true | |||
DiscontinuedDate | datetime | true | |||
ThumbNailPhoto | varbinary(MAX) | true | |||
ThumbnailPhotoFileName | nvarchar(50) | true | |||
rowguid | uniqueidentifier | true | |||
ModifiedDate | datetime | true |
Property | Value |
Business Name | ProductID |
Type | numeric |
Subtype | int |
Not null | true |
Identity | [object Object] |
Sparse | false |
Primary key | true |
Primary key options | [object Object] |
Unique | false |
Excl min | false |
Excl max | false |
Sample | 680 |
Property | Value |
Business Name | Name |
$ref | #model/definitions/Name |
Reference type | model |
Property | Value |
Business Name | ProductNumber |
Type | char |
Subtype | nvarchar |
JSON Types | string |
Length | 25 |
Not null | true |
Sparse | false |
Primary key | false |
Unique | true |
Unique key options | |
[1] Constraint name | AK_Product_ProductNumber |
Partition name | PRIMARY |
Order | ASC |
Statistics no recompute | |
Statistics incremental | |
Ignore duplicate | |
Allow row locks | true |
Allow page locks | true |
Padded | |
Fill factor | |
Optimize for sequential key | |
Clustered | |
Data compression | NONE |
Sample | FR-R92B-58 |
Property | Value |
Business Name | Color |
Type | char |
Subtype | nvarchar |
JSON Types | string |
Length | 15 |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Sample | Black |
Property | Value |
Business Name | StandardCost |
Type | numeric |
Subtype | money |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Excl min | false |
Excl max | false |
Sample | 1059.31 |
Property | Value |
Business Name | ListPrice |
Type | numeric |
Subtype | money |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Excl min | false |
Excl max | false |
Sample | 1431.5 |
Property | Value |
Business Name | Size |
Type | char |
Subtype | nvarchar |
JSON Types | string |
Length | 5 |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Sample | 58 |
Property | Value |
Business Name | Weight |
Type | numeric |
Subtype | decimal |
Precision | 8 |
Scale | 2 |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Excl min | false |
Excl max | false |
Sample | 1016.04 |
Property | Value |
Business Name | ProductCategoryID |
Type | numeric |
Subtype | int |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Foreign table | ProductCategory |
Foreign field | ProductCategoryID |
Relationship type | Foreign Key |
Excl min | false |
Excl max | false |
Sample | 18 |
Property | Value |
Business Name | ProductModelID |
Type | numeric |
Subtype | int |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Foreign table | ProductModel |
Foreign field | ProductModelID |
Relationship type | Foreign Key |
Excl min | false |
Excl max | false |
Sample | 6 |
Property | Value |
Business Name | SellStartDate |
Type | datetime |
Subtype | datetime |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Sample | 2002-06-01T00:00:00.000Z |
Property | Value |
Business Name | SellEndDate |
Type | datetime |
Subtype | datetime |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Property | Value |
Business Name | DiscontinuedDate |
Type | datetime |
Subtype | datetime |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Property | Value |
Business Name | ThumbNailPhoto |
Type | binary |
Subtype | varbinary |
Has max length | true |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Property | Value |
Business Name | ThumbnailPhotoFileName |
Type | char |
Subtype | nvarchar |
JSON Types | string |
Length | 50 |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Sample | no_image_available_small.gif |
Property | Value |
Business Name | rowguid |
Type | uniqueidentifier |
Not null | true |
Sparse | false |
Primary key | false |
Unique | true |
Unique key options | |
[1] Constraint name | AK_Product_rowguid |
Partition name | PRIMARY |
Order | ASC |
Statistics no recompute | |
Statistics incremental | |
Ignore duplicate | |
Allow row locks | true |
Allow page locks | true |
Padded | |
Fill factor | |
Optimize for sequential key | |
Clustered | |
Data compression | NONE |
Default | (newid()) |
Default constraint name | DF_Product_rowguid |
Sample | 43DD68D6-14A4-461F-9069-55309D90EA7E |
Property | Value |
Business Name | ModifiedDate |
Type | datetime |
Subtype | datetime |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Default | (getdate()) |
Default constraint name | DF_Product_ModifiedDate |
Sample | 2008-03-11T10:01:36.826Z |
Property | |
Name | CK_Product_ListPrice |
Expression | ([ListPrice]>=(0.00)) |
Description | |
Check Existing Data | |
Enforce for Upserts | true |
Enforce for Replication | true |
Comments |
Property | |
Name | CK_Product_SellEndDate |
Expression | ([SellEndDate]>=[SellStartDate] OR [SellEndDate] IS NULL) |
Description | |
Check Existing Data | |
Enforce for Upserts | true |
Enforce for Replication | true |
Comments |
Property | |
Name | CK_Product_StandardCost |
Expression | ([StandardCost]>=(0.00)) |
Description | |
Check Existing Data | |
Enforce for Upserts | true |
Enforce for Replication | true |
Comments |
Property | |
Name | CK_Product_Weight |
Expression | ([Weight]>(0.00)) |
Description | |
Check Existing Data | |
Enforce for Upserts | true |
Enforce for Replication | true |
Comments |
CREATE DATABASE [HackDBSQL]; GO USE [HackDBSQL] GO CREATE SCHEMA [SalesLT]; GO CREATE TYPE [SalesLT].[Name] FROM NVARCHAR(50) NOT NULL GO CREATE TYPE [SalesLT].[NameStyle] FROM BIT NOT NULL GO CREATE TYPE [SalesLT].[Phone] FROM NVARCHAR(25) GO CREATE TYPE [SalesLT].[Flag] FROM BIT NOT NULL GO CREATE TYPE [SalesLT].[OrderNumber] FROM NVARCHAR(25) GO CREATE TYPE [SalesLT].[AccountNumber] FROM NVARCHAR(15) GO CREATE TABLE [SalesLT].[Product] ( [ProductID] INT IDENTITY(1, 1) NOT NULL, [Name] [SalesLT].[Name], [ProductNumber] NVARCHAR(25) NOT NULL, [Color] NVARCHAR(15) NOT NULL, [StandardCost] MONEY NOT NULL, [ListPrice] MONEY NOT NULL, [Size] NVARCHAR(5) NOT NULL, [Weight] DECIMAL(8,2) NOT NULL, [ProductCategoryID] INT NOT NULL, [ProductModelID] INT NOT NULL, [SellStartDate] DATETIME NOT NULL, [SellEndDate] DATETIME NOT NULL, [DiscontinuedDate] DATETIME NOT NULL, [ThumbNailPhoto] VARBINARY(MAX) NOT NULL, [ThumbnailPhotoFileName] NVARCHAR(50) NOT NULL, [rowguid] UNIQUEIDENTIFIER NOT NULL, [ModifiedDate] DATETIME NOT NULL, CONSTRAINT [PK_Product_ProductID] PRIMARY KEY CLUSTERED ([ProductID] ASC) ON [PRIMARY], CONSTRAINT [AK_Product_ProductNumber] UNIQUE NONCLUSTERED ([ProductNumber] ASC) ON [PRIMARY], CONSTRAINT [AK_Product_rowguid] UNIQUE NONCLUSTERED ([rowguid] ASC) ON [PRIMARY], CONSTRAINT [CK_Product_ListPrice] CHECK ([ListPrice]>=(0.00)), CONSTRAINT [CK_Product_SellEndDate] CHECK ([SellEndDate]>=[SellStartDate] OR [SellEndDate] IS NULL), CONSTRAINT [CK_Product_StandardCost] CHECK ([StandardCost]>=(0.00)), CONSTRAINT [CK_Product_Weight] CHECK ([Weight]>(0.00)), CONSTRAINT [FK_Product_ProductModel_ProductModelID] FOREIGN KEY (ProductModelID) REFERENCES [SalesLT].[ProductModel](ProductModelID), CONSTRAINT [FK_Product_ProductCategory_ProductCategoryID] FOREIGN KEY (ProductCategoryID) REFERENCES [SalesLT].[ProductCategory](ProductCategoryID) ) GO ALTER TABLE [SalesLT].[Product] ADD CONSTRAINT [DF_Product_rowguid] DEFAULT (newid()) FOR [rowguid] GO ALTER TABLE [SalesLT].[Product] ADD CONSTRAINT [DF_Product_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate] GO
Property | Value |
Table | ProductCategory |
Technical name | |
Id | |
Schema | SalesLT |
Additional properties | false |
Comments | |
Memory optimized | false |
Remarks |
Column | Type | Req | Key | Description | Comments |
ProductCategoryID | int | true | |||
ParentProductCategoryID | int | true | |||
Name | nvarchar(50) | false | |||
rowguid | uniqueidentifier | true | |||
ModifiedDate | datetime | true |
Property | Value |
Business Name | ProductCategoryID |
Type | numeric |
Subtype | int |
Not null | true |
Identity | [object Object] |
Sparse | false |
Primary key | true |
Primary key options | [object Object] |
Unique | false |
Excl min | false |
Excl max | false |
Sample | 1 |
Property | Value |
Business Name | ParentProductCategoryID |
Type | numeric |
Subtype | int |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Foreign table | ProductCategory |
Foreign field | ProductCategoryID |
Relationship type | Foreign Key |
Excl min | false |
Excl max | false |
Property | Value |
Business Name | Name |
$ref | #model/definitions/Name |
Reference type | model |
Property | Value |
Business Name | rowguid |
Type | uniqueidentifier |
Not null | true |
Sparse | false |
Primary key | false |
Unique | true |
Unique key options | |
[1] Constraint name | AK_ProductCategory_rowguid |
Partition name | PRIMARY |
Order | ASC |
Statistics no recompute | |
Statistics incremental | |
Ignore duplicate | |
Allow row locks | true |
Allow page locks | true |
Padded | |
Fill factor | |
Optimize for sequential key | |
Clustered | |
Data compression | NONE |
Default | (newid()) |
Default constraint name | DF_ProductCategory_rowguid |
Sample | CFBDA25C-DF71-47A7-B81B-64EE161AA37C |
Property | Value |
Business Name | ModifiedDate |
Type | datetime |
Subtype | datetime |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Default | (getdate()) |
Default constraint name | DF_ProductCategory_ModifiedDate |
Sample | 2002-06-01T00:00:00.000Z |
CREATE DATABASE [HackDBSQL]; GO USE [HackDBSQL] GO CREATE SCHEMA [SalesLT]; GO CREATE TYPE [SalesLT].[Name] FROM NVARCHAR(50) NOT NULL GO CREATE TYPE [SalesLT].[NameStyle] FROM BIT NOT NULL GO CREATE TYPE [SalesLT].[Phone] FROM NVARCHAR(25) GO CREATE TYPE [SalesLT].[Flag] FROM BIT NOT NULL GO CREATE TYPE [SalesLT].[OrderNumber] FROM NVARCHAR(25) GO CREATE TYPE [SalesLT].[AccountNumber] FROM NVARCHAR(15) GO CREATE TABLE [SalesLT].[ProductCategory] ( [ProductCategoryID] INT IDENTITY(1, 1) NOT NULL, [ParentProductCategoryID] INT NOT NULL, [Name] [SalesLT].[Name], [rowguid] UNIQUEIDENTIFIER NOT NULL, [ModifiedDate] DATETIME NOT NULL, CONSTRAINT [PK_ProductCategory_ProductCategoryID] PRIMARY KEY CLUSTERED ([ProductCategoryID] ASC) ON [PRIMARY], CONSTRAINT [AK_ProductCategory_rowguid] UNIQUE NONCLUSTERED ([rowguid] ASC) ON [PRIMARY], CONSTRAINT [FK_ProductCategory_ProductCategory_ParentProductCategoryID_ProductCategoryID] FOREIGN KEY (ParentProductCategoryID) REFERENCES [SalesLT].[ProductCategory](ProductCategoryID) ) GO ALTER TABLE [SalesLT].[ProductCategory] ADD CONSTRAINT [DF_ProductCategory_rowguid] DEFAULT (newid()) FOR [rowguid] GO ALTER TABLE [SalesLT].[ProductCategory] ADD CONSTRAINT [DF_ProductCategory_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate] GO
Property | Value |
Table | ProductDescription |
Technical name | |
Id | |
Schema | SalesLT |
Additional properties | false |
Comments | |
Memory optimized | false |
Remarks |
Column | Type | Req | Key | Description | Comments |
ProductDescriptionID | int | true | |||
Description | nvarchar(400) | true | |||
rowguid | uniqueidentifier | true | |||
ModifiedDate | datetime | true |
Property | Value |
Business Name | ProductDescriptionID |
Type | numeric |
Subtype | int |
Not null | true |
Identity | [object Object] |
Sparse | false |
Primary key | true |
Primary key options | [object Object] |
Unique | false |
Excl min | false |
Excl max | false |
Sample | 3 |
Property | Value |
Business Name | Description |
Type | char |
Subtype | nvarchar |
JSON Types | string |
Length | 400 |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Sample | Chromoly steel. |
Property | Value |
Business Name | rowguid |
Type | uniqueidentifier |
Not null | true |
Sparse | false |
Primary key | false |
Unique | true |
Unique key options | |
[1] Constraint name | AK_ProductDescription_rowguid |
Partition name | PRIMARY |
Order | ASC |
Statistics no recompute | |
Statistics incremental | |
Ignore duplicate | |
Allow row locks | true |
Allow page locks | true |
Padded | |
Fill factor | |
Optimize for sequential key | |
Clustered | |
Data compression | NONE |
Default | (newid()) |
Default constraint name | DF_ProductDescription_rowguid |
Sample | 301EED3A-1A82-4855-99CB-2AFE8290D641 |
Property | Value |
Business Name | ModifiedDate |
Type | datetime |
Subtype | datetime |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Default | (getdate()) |
Default constraint name | DF_ProductDescription_ModifiedDate |
Sample | 2007-06-01T00:00:00.000Z |
CREATE DATABASE [HackDBSQL]; GO USE [HackDBSQL] GO CREATE SCHEMA [SalesLT]; GO CREATE TYPE [SalesLT].[Name] FROM NVARCHAR(50) NOT NULL GO CREATE TYPE [SalesLT].[NameStyle] FROM BIT NOT NULL GO CREATE TYPE [SalesLT].[Phone] FROM NVARCHAR(25) GO CREATE TYPE [SalesLT].[Flag] FROM BIT NOT NULL GO CREATE TYPE [SalesLT].[OrderNumber] FROM NVARCHAR(25) GO CREATE TYPE [SalesLT].[AccountNumber] FROM NVARCHAR(15) GO CREATE TABLE [SalesLT].[ProductDescription] ( [ProductDescriptionID] INT IDENTITY(1, 1) NOT NULL, [Description] NVARCHAR(400) NOT NULL, [rowguid] UNIQUEIDENTIFIER NOT NULL, [ModifiedDate] DATETIME NOT NULL, CONSTRAINT [PK_ProductDescription_ProductDescriptionID] PRIMARY KEY CLUSTERED ([ProductDescriptionID] ASC) ON [PRIMARY], CONSTRAINT [AK_ProductDescription_rowguid] UNIQUE NONCLUSTERED ([rowguid] ASC) ON [PRIMARY] ) GO ALTER TABLE [SalesLT].[ProductDescription] ADD CONSTRAINT [DF_ProductDescription_rowguid] DEFAULT (newid()) FOR [rowguid] GO ALTER TABLE [SalesLT].[ProductDescription] ADD CONSTRAINT [DF_ProductDescription_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate] GO
Property | Value |
Table | ProductModel |
Technical name | |
Id | |
Schema | SalesLT |
Additional properties | false |
Comments | |
Memory optimized | false |
Remarks |
Column | Type | Req | Key | Description | Comments |
ProductModelID | int | true | |||
Name | nvarchar(50) | false | |||
CatalogDescription | xml | true | |||
rowguid | uniqueidentifier | true | |||
ModifiedDate | datetime | true |
Property | Value |
Business Name | ProductModelID |
Type | numeric |
Subtype | int |
Not null | true |
Identity | [object Object] |
Sparse | false |
Primary key | true |
Primary key options | [object Object] |
Unique | false |
Excl min | false |
Excl max | false |
Sample | 1 |
Property | Value |
Business Name | Name |
$ref | #model/definitions/Name |
Reference type | model |
Property | Value |
Business Name | CatalogDescription |
Type | xml |
Not null | true |
Sparse | false |
Property | Value |
Business Name | rowguid |
Type | uniqueidentifier |
Not null | true |
Sparse | false |
Primary key | false |
Unique | true |
Unique key options | |
[1] Constraint name | AK_ProductModel_rowguid |
Partition name | PRIMARY |
Order | ASC |
Statistics no recompute | |
Statistics incremental | |
Ignore duplicate | |
Allow row locks | true |
Allow page locks | true |
Padded | |
Fill factor | |
Optimize for sequential key | |
Clustered | |
Data compression | NONE |
Default | (newid()) |
Default constraint name | DF_ProductModel_rowguid |
Sample | 29321D47-1E4C-4AAC-887C-19634328C25E |
Property | Value |
Business Name | ModifiedDate |
Type | datetime |
Subtype | datetime |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Default | (getdate()) |
Default constraint name | DF_ProductModel_ModifiedDate |
Sample | 2007-06-01T00:00:00.000Z |
CREATE DATABASE [HackDBSQL]; GO USE [HackDBSQL] GO CREATE SCHEMA [SalesLT]; GO CREATE TYPE [SalesLT].[Name] FROM NVARCHAR(50) NOT NULL GO CREATE TYPE [SalesLT].[NameStyle] FROM BIT NOT NULL GO CREATE TYPE [SalesLT].[Phone] FROM NVARCHAR(25) GO CREATE TYPE [SalesLT].[Flag] FROM BIT NOT NULL GO CREATE TYPE [SalesLT].[OrderNumber] FROM NVARCHAR(25) GO CREATE TYPE [SalesLT].[AccountNumber] FROM NVARCHAR(15) GO CREATE TABLE [SalesLT].[ProductModel] ( [ProductModelID] INT IDENTITY(1, 1) NOT NULL, [Name] [SalesLT].[Name], [CatalogDescription] XML NOT NULL, [rowguid] UNIQUEIDENTIFIER NOT NULL, [ModifiedDate] DATETIME NOT NULL, CONSTRAINT [PK_ProductModel_ProductModelID] PRIMARY KEY CLUSTERED ([ProductModelID] ASC) ON [PRIMARY], CONSTRAINT [AK_ProductModel_rowguid] UNIQUE NONCLUSTERED ([rowguid] ASC) ON [PRIMARY] ) GO ALTER TABLE [SalesLT].[ProductModel] ADD CONSTRAINT [DF_ProductModel_rowguid] DEFAULT (newid()) FOR [rowguid] GO ALTER TABLE [SalesLT].[ProductModel] ADD CONSTRAINT [DF_ProductModel_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate] GO
Property | Value |
Table | ProductModelProductDescription |
Technical name | |
Id | |
Schema | SalesLT |
Additional properties | false |
Comments | |
Memory optimized | false |
Remarks |
Column | Type | Req | Key | Description | Comments |
ProductModelID | int | true | |||
ProductDescriptionID | int | true | |||
Culture | nchar(6) | true | |||
rowguid | uniqueidentifier | true | |||
ModifiedDate | datetime | true |
Property | Value |
Business Name | ProductModelID |
Type | numeric |
Subtype | int |
Not null | true |
Sparse | false |
Primary key | true |
Foreign table | ProductModel |
Foreign field | ProductModelID |
Relationship type | Foreign Key |
Excl min | false |
Excl max | false |
Sample | 1 |
Property | Value |
Business Name | ProductDescriptionID |
Type | numeric |
Subtype | int |
Not null | true |
Sparse | false |
Primary key | true |
Foreign table | ProductDescription |
Foreign field | ProductDescriptionID |
Relationship type | Foreign Key |
Excl min | false |
Excl max | false |
Sample | 1199 |
Property | Value |
Business Name | Culture |
Type | char |
Subtype | nchar |
Length | 6 |
Not null | true |
Sparse | false |
Primary key | true |
Sample | en |
Property | Value |
Business Name | rowguid |
Type | uniqueidentifier |
Not null | true |
Sparse | false |
Primary key | false |
Unique | true |
Unique key options | |
[1] Constraint name | AK_ProductModelProductDescription_rowguid |
Partition name | PRIMARY |
Order | ASC |
Statistics no recompute | |
Statistics incremental | |
Ignore duplicate | |
Allow row locks | true |
Allow page locks | true |
Padded | |
Fill factor | |
Optimize for sequential key | |
Clustered | |
Data compression | NONE |
Default | (newid()) |
Default constraint name | DF_ProductModelProductDescription_rowguid |
Sample | 4D00B649-027A-4F99-A380-F22A46EC8638 |
Property | Value |
Business Name | ModifiedDate |
Type | datetime |
Subtype | datetime |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Default | (getdate()) |
Default constraint name | DF_ProductModelProductDescription_ModifiedDate |
Sample | 2007-06-01T00:00:00.000Z |
Property | |
Constraint name | PK_ProductModelProductDescription_ProductModelID_ProductDescriptionID_Culture |
Key | |
ProductModelID | |
ProductDescriptionID | |
Culture | |
Partition name | PRIMARY |
Statistics no recompute | |
Statistics incremental | |
Ignore duplicate | |
Allow row locks | true |
Allow page locks | true |
Padded | |
Fill factor | |
Optimize for sequential key | |
Clustered | true |
Data compression | NONE |
CREATE DATABASE [HackDBSQL]; GO USE [HackDBSQL] GO CREATE SCHEMA [SalesLT]; GO CREATE TYPE [SalesLT].[Name] FROM NVARCHAR(50) NOT NULL GO CREATE TYPE [SalesLT].[NameStyle] FROM BIT NOT NULL GO CREATE TYPE [SalesLT].[Phone] FROM NVARCHAR(25) GO CREATE TYPE [SalesLT].[Flag] FROM BIT NOT NULL GO CREATE TYPE [SalesLT].[OrderNumber] FROM NVARCHAR(25) GO CREATE TYPE [SalesLT].[AccountNumber] FROM NVARCHAR(15) GO CREATE TABLE [SalesLT].[ProductModelProductDescription] ( [ProductModelID] INT NOT NULL, [ProductDescriptionID] INT NOT NULL, [Culture] NCHAR(6) NOT NULL, [rowguid] UNIQUEIDENTIFIER NOT NULL, [ModifiedDate] DATETIME NOT NULL, CONSTRAINT [PK_ProductModelProductDescription_ProductModelID_ProductDescriptionID_Culture] PRIMARY KEY CLUSTERED ([ProductModelID] ASC, [ProductDescriptionID] ASC, [Culture] ASC) ON [PRIMARY], CONSTRAINT [AK_ProductModelProductDescription_rowguid] UNIQUE NONCLUSTERED ([rowguid] ASC) ON [PRIMARY], CONSTRAINT [FK_ProductModelProductDescription_ProductModel_ProductModelID] FOREIGN KEY (ProductModelID) REFERENCES [SalesLT].[ProductModel](ProductModelID), CONSTRAINT [FK_ProductModelProductDescription_ProductDescription_ProductDescriptionID] FOREIGN KEY (ProductDescriptionID) REFERENCES [SalesLT].[ProductDescription](ProductDescriptionID) ) GO ALTER TABLE [SalesLT].[ProductModelProductDescription] ADD CONSTRAINT [DF_ProductModelProductDescription_rowguid] DEFAULT (newid()) FOR [rowguid] GO ALTER TABLE [SalesLT].[ProductModelProductDescription] ADD CONSTRAINT [DF_ProductModelProductDescription_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate] GO
Property | Value |
Table | SalesOrderDetail |
Technical name | |
Id | |
Schema | SalesLT |
Additional properties | false |
Comments | |
Memory optimized | false |
Remarks |
Column | Type | Req | Key | Description | Comments |
SalesOrderID | int | true | |||
SalesOrderDetailID | int | true | |||
OrderQty | smallint | true | |||
ProductID | int | true | |||
UnitPrice | money | true | |||
UnitPriceDiscount | money | true | |||
LineTotal | numeric(38, 6) | true | |||
rowguid | uniqueidentifier | true | |||
ModifiedDate | datetime | true |
Property | Value |
Business Name | SalesOrderID |
Type | numeric |
Subtype | int |
Not null | true |
Sparse | false |
Primary key | true |
Foreign table | SalesOrderHeader |
Foreign field | SalesOrderID |
Relationship type | Foreign Key |
Excl min | false |
Excl max | false |
Sample | 71774 |
Property | Value |
Business Name | SalesOrderDetailID |
Type | numeric |
Subtype | int |
Not null | true |
Identity | [object Object] |
Sparse | false |
Primary key | true |
Excl min | false |
Excl max | false |
Sample | 110562 |
Property | Value |
Business Name | OrderQty |
Type | numeric |
Subtype | smallint |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Excl min | false |
Excl max | false |
Sample | 1 |
Property | Value |
Business Name | UnitPrice |
Type | numeric |
Subtype | money |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Excl min | false |
Excl max | false |
Sample | 356.898 |
Property | Value |
Business Name | UnitPriceDiscount |
Type | numeric |
Subtype | money |
Default | ((0.0)) |
Default constraint name | DF_SalesOrderDetail_UnitPriceDiscount |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Excl min | false |
Excl max | false |
Sample | 0 |
Property | Value |
Business Name | LineTotal |
Type | numeric |
Subtype | numeric |
Precision | 38 |
Scale | 6 |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Excl min | false |
Excl max | false |
Sample | 356.898 |
Property | Value |
Business Name | rowguid |
Type | uniqueidentifier |
Not null | true |
Sparse | false |
Primary key | false |
Unique | true |
Unique key options | |
[1] Constraint name | AK_SalesOrderDetail_rowguid |
Partition name | PRIMARY |
Order | ASC |
Statistics no recompute | |
Statistics incremental | |
Ignore duplicate | |
Allow row locks | true |
Allow page locks | true |
Padded | |
Fill factor | |
Optimize for sequential key | |
Clustered | |
Data compression | NONE |
Default | (newid()) |
Default constraint name | DF_SalesOrderDetail_rowguid |
Sample | E3A1994C-7A68-4CE8-96A3-77FDD3BBD730 |
Property | Value |
Business Name | ModifiedDate |
Type | datetime |
Subtype | datetime |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Default | (getdate()) |
Default constraint name | DF_SalesOrderDetail_ModifiedDate |
Sample | 2008-06-01T00:00:00.000Z |
Property | |
Constraint name | PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID |
Key | |
SalesOrderID | |
SalesOrderDetailID | |
Partition name | PRIMARY |
Statistics no recompute | |
Statistics incremental | |
Ignore duplicate | |
Allow row locks | true |
Allow page locks | true |
Padded | |
Fill factor | |
Optimize for sequential key | |
Clustered | true |
Data compression | NONE |
Property | |
Name | IX_SalesOrderDetail_ProductID |
Type | Index |
Unique | |
Clustered | |
Keys | |
ProductID | |
Include non-key columns | |
Description | |
Pad index | |
Fill factor | |
Ignore duplicate key | |
Included columns | |
Statistics no recompute | |
Statistics incremental | |
Allow row locks | true |
Allow page locks | true |
Optimize for sequential key | |
Compression delay (minutes) | |
Data compression | NONE |
Comments |
Property | |
Name | CK_SalesOrderDetail_OrderQty |
Expression | ([OrderQty]>(0)) |
Description | |
Check Existing Data | |
Enforce for Upserts | true |
Enforce for Replication | true |
Comments |
Property | |
Name | CK_SalesOrderDetail_UnitPrice |
Expression | ([UnitPrice]>=(0.00)) |
Description | |
Check Existing Data | |
Enforce for Upserts | true |
Enforce for Replication | true |
Comments |
Property | |
Name | CK_SalesOrderDetail_UnitPriceDiscount |
Expression | ([UnitPriceDiscount]>=(0.00)) |
Description | |
Check Existing Data | |
Enforce for Upserts | true |
Enforce for Replication | true |
Comments |
CREATE DATABASE [HackDBSQL]; GO USE [HackDBSQL] GO CREATE SCHEMA [SalesLT]; GO CREATE TYPE [SalesLT].[Name] FROM NVARCHAR(50) NOT NULL GO CREATE TYPE [SalesLT].[NameStyle] FROM BIT NOT NULL GO CREATE TYPE [SalesLT].[Phone] FROM NVARCHAR(25) GO CREATE TYPE [SalesLT].[Flag] FROM BIT NOT NULL GO CREATE TYPE [SalesLT].[OrderNumber] FROM NVARCHAR(25) GO CREATE TYPE [SalesLT].[AccountNumber] FROM NVARCHAR(15) GO CREATE TABLE [SalesLT].[SalesOrderDetail] ( [SalesOrderID] INT NOT NULL, [SalesOrderDetailID] INT IDENTITY(1, 1) NOT NULL, [OrderQty] SMALLINT NOT NULL, [ProductID] INT NOT NULL, [UnitPrice] MONEY NOT NULL, [UnitPriceDiscount] MONEY NOT NULL, [LineTotal] NUMERIC(38,6) NOT NULL, [rowguid] UNIQUEIDENTIFIER NOT NULL, [ModifiedDate] DATETIME NOT NULL, CONSTRAINT [PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID] PRIMARY KEY CLUSTERED ([SalesOrderID] ASC, [SalesOrderDetailID] ASC) ON [PRIMARY], CONSTRAINT [AK_SalesOrderDetail_rowguid] UNIQUE NONCLUSTERED ([rowguid] ASC) ON [PRIMARY], CONSTRAINT [CK_SalesOrderDetail_OrderQty] CHECK ([OrderQty]>(0)), CONSTRAINT [CK_SalesOrderDetail_UnitPrice] CHECK ([UnitPrice]>=(0.00)), CONSTRAINT [CK_SalesOrderDetail_UnitPriceDiscount] CHECK ([UnitPriceDiscount]>=(0.00)), CONSTRAINT [FK_SalesOrderDetail_Product_ProductID] FOREIGN KEY (ProductID) REFERENCES [SalesLT].[Product](ProductID), CONSTRAINT [FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID] FOREIGN KEY (SalesOrderID) REFERENCES [SalesLT].[SalesOrderHeader](SalesOrderID) ) GO ALTER TABLE [SalesLT].[SalesOrderDetail] ADD CONSTRAINT [DF_SalesOrderDetail_UnitPriceDiscount] DEFAULT ((0.0)) FOR [UnitPriceDiscount] GO ALTER TABLE [SalesLT].[SalesOrderDetail] ADD CONSTRAINT [DF_SalesOrderDetail_rowguid] DEFAULT (newid()) FOR [rowguid] GO ALTER TABLE [SalesLT].[SalesOrderDetail] ADD CONSTRAINT [DF_SalesOrderDetail_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate] GO CREATE INDEX IX_SalesOrderDetail_ProductID ON [SalesLT].[SalesOrderDetail] ( [ProductID] ) GO
Property | Value |
Table | SalesOrderHeader |
Technical name | |
Id | |
Schema | SalesLT |
Additional properties | false |
Comments | |
Memory optimized | false |
Remarks |
Column | Type | Req | Key | Description | Comments |
SalesOrderID | int | true | |||
RevisionNumber | tinyint | true | |||
OrderDate | datetime | true | |||
DueDate | datetime | true | |||
ShipDate | datetime | true | |||
Status | tinyint | true | |||
OnlineOrderFlag | bit | false | |||
SalesOrderNumber | nvarchar(25) | true | |||
PurchaseOrderNumber | nvarchar(25) | false | |||
AccountNumber | nvarchar(15) | false | |||
CustomerID | int | true | |||
ShipToAddressID | int | true | |||
BillToAddressID | int | true | |||
ShipMethod | nvarchar(50) | true | |||
CreditCardApprovalCode | varchar(15) | true | |||
SubTotal | money | true | |||
TaxAmt | money | true | |||
Freight | money | true | |||
TotalDue | money | true | |||
Comment | nvarchar(MAX) | true | |||
rowguid | uniqueidentifier | true | |||
ModifiedDate | datetime | true |
Property | Value |
Business Name | SalesOrderID |
Type | numeric |
Subtype | int |
Default | (NEXT VALUE FOR [SalesLT].[SalesOrderNumber]) |
Default constraint name | DF_SalesOrderHeader_OrderID |
Not null | true |
Sparse | false |
Primary key | true |
Primary key options | [object Object] |
Unique | false |
Excl min | false |
Excl max | false |
Sample | 71774 |
Property | Value |
Business Name | RevisionNumber |
Type | numeric |
Subtype | tinyint |
Default | ((0)) |
Default constraint name | DF_SalesOrderHeader_RevisionNumber |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Excl min | false |
Excl max | false |
Sample | 2 |
Property | Value |
Business Name | OrderDate |
Type | datetime |
Subtype | datetime |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Default | (getdate()) |
Default constraint name | DF_SalesOrderHeader_OrderDate |
Sample | 2008-06-01T00:00:00.000Z |
Property | Value |
Business Name | DueDate |
Type | datetime |
Subtype | datetime |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Sample | 2008-06-13T00:00:00.000Z |
Property | Value |
Business Name | ShipDate |
Type | datetime |
Subtype | datetime |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Sample | 2008-06-08T00:00:00.000Z |
Property | Value |
Business Name | Status |
Type | numeric |
Subtype | tinyint |
Default | 1 |
Default constraint name | DF_SalesOrderHeader_Status |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Excl min | false |
Excl max | false |
Sample | 5 |
Property | Value |
Business Name | OnlineOrderFlag |
$ref | #model/definitions/Flag |
Reference type | model |
Property | Value |
Business Name | SalesOrderNumber |
Type | char |
Subtype | nvarchar |
JSON Types | string |
Length | 25 |
Not null | true |
Sparse | false |
Primary key | false |
Unique | true |
Unique key options | |
[1] Constraint name | AK_SalesOrderHeader_SalesOrderNumber |
Partition name | PRIMARY |
Order | ASC |
Statistics no recompute | |
Statistics incremental | |
Ignore duplicate | |
Allow row locks | true |
Allow page locks | true |
Padded | |
Fill factor | |
Optimize for sequential key | |
Clustered | |
Data compression | NONE |
Sample | SO71774 |
Property | Value |
Business Name | PurchaseOrderNumber |
$ref | #model/definitions/OrderNumber |
Reference type | model |
Property | Value |
Business Name | AccountNumber |
$ref | #model/definitions/AccountNumber |
Reference type | model |
Property | Value |
Business Name | CustomerID |
Type | numeric |
Subtype | int |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Foreign table | Customer |
Foreign field | CustomerID |
Relationship type | Foreign Key |
Excl min | false |
Excl max | false |
Sample | 29847 |
Property | Value |
Business Name | ShipMethod |
Type | char |
Subtype | nvarchar |
JSON Types | string |
Length | 50 |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Sample | CARGO TRANSPORT 5 |
Property | Value |
Business Name | CreditCardApprovalCode |
Type | char |
Subtype | varchar |
JSON Types | string |
Length | 15 |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Property | Value |
Business Name | SubTotal |
Type | numeric |
Subtype | money |
Default | ((0.00)) |
Default constraint name | DF_SalesOrderHeader_SubTotal |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Excl min | false |
Excl max | false |
Sample | 880.3484 |
Property | Value |
Business Name | TaxAmt |
Type | numeric |
Subtype | money |
Default | ((0.00)) |
Default constraint name | DF_SalesOrderHeader_TaxAmt |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Excl min | false |
Excl max | false |
Sample | 70.4279 |
Property | Value |
Business Name | Freight |
Type | numeric |
Subtype | money |
Default | ((0.00)) |
Default constraint name | DF_SalesOrderHeader_Freight |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Excl min | false |
Excl max | false |
Sample | 22.0087 |
Property | Value |
Business Name | TotalDue |
Type | numeric |
Subtype | money |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Excl min | false |
Excl max | false |
Sample | 972.785 |
Property | Value |
Business Name | Comment |
Type | char |
Subtype | nvarchar |
JSON Types | string |
Has max length | true |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Property | Value |
Business Name | rowguid |
Type | uniqueidentifier |
Not null | true |
Sparse | false |
Primary key | false |
Unique | true |
Unique key options | |
[1] Constraint name | AK_SalesOrderHeader_rowguid |
Partition name | PRIMARY |
Order | ASC |
Statistics no recompute | |
Statistics incremental | |
Ignore duplicate | |
Allow row locks | true |
Allow page locks | true |
Padded | |
Fill factor | |
Optimize for sequential key | |
Clustered | |
Data compression | NONE |
Default | (newid()) |
Default constraint name | DF_SalesOrderHeader_rowguid |
Sample | 89E42CDC-8506-48A2-B89B-EB3E64E3554E |
Property | Value |
Business Name | ModifiedDate |
Type | datetime |
Subtype | datetime |
Not null | true |
Sparse | false |
Primary key | false |
Unique | false |
Default | (getdate()) |
Default constraint name | DF_SalesOrderHeader_ModifiedDate |
Sample | 2008-06-08T00:00:00.000Z |
Property | |
Name | IX_SalesOrderHeader_CustomerID |
Type | Index |
Unique | |
Clustered | |
Keys | |
CustomerID | |
Include non-key columns | |
Description | |
Pad index | |
Fill factor | |
Ignore duplicate key | |
Included columns | |
Statistics no recompute | |
Statistics incremental | |
Allow row locks | true |
Allow page locks | true |
Optimize for sequential key | |
Compression delay (minutes) | |
Data compression | NONE |
Comments |
Property | |
Name | CK_SalesOrderHeader_DueDate |
Expression | ([DueDate]>=[OrderDate]) |
Description | |
Check Existing Data | true |
Enforce for Upserts | true |
Enforce for Replication | true |
Comments |
Property | |
Name | CK_SalesOrderHeader_Freight |
Expression | ([Freight]>=(0.00)) |
Description | |
Check Existing Data | true |
Enforce for Upserts | true |
Enforce for Replication | true |
Comments |
Property | |
Name | CK_SalesOrderHeader_ShipDate |
Expression | ([ShipDate]>=[OrderDate] OR [ShipDate] IS NULL) |
Description | |
Check Existing Data | true |
Enforce for Upserts | true |
Enforce for Replication | true |
Comments |
Property | |
Name | CK_SalesOrderHeader_Status |
Expression | ([Status]>=(0) AND [Status]<=(8)) |
Description | |
Check Existing Data | true |
Enforce for Upserts | true |
Enforce for Replication | true |
Comments |
Property | |
Name | CK_SalesOrderHeader_SubTotal |
Expression | ([SubTotal]>=(0.00)) |
Description | |
Check Existing Data | true |
Enforce for Upserts | true |
Enforce for Replication | true |
Comments |
Property | |
Name | CK_SalesOrderHeader_TaxAmt |
Expression | ([TaxAmt]>=(0.00)) |
Description | |
Check Existing Data | true |
Enforce for Upserts | true |
Enforce for Replication | true |
Comments |
CREATE DATABASE [HackDBSQL]; GO USE [HackDBSQL] GO CREATE SCHEMA [SalesLT]; GO CREATE TYPE [SalesLT].[Name] FROM NVARCHAR(50) NOT NULL GO CREATE TYPE [SalesLT].[NameStyle] FROM BIT NOT NULL GO CREATE TYPE [SalesLT].[Phone] FROM NVARCHAR(25) GO CREATE TYPE [SalesLT].[Flag] FROM BIT NOT NULL GO CREATE TYPE [SalesLT].[OrderNumber] FROM NVARCHAR(25) GO CREATE TYPE [SalesLT].[AccountNumber] FROM NVARCHAR(15) GO CREATE TABLE [SalesLT].[SalesOrderHeader] ( [SalesOrderID] INT NOT NULL, [RevisionNumber] TINYINT NOT NULL, [OrderDate] DATETIME NOT NULL, [DueDate] DATETIME NOT NULL, [ShipDate] DATETIME NOT NULL, [Status] TINYINT NOT NULL, [OnlineOrderFlag] [SalesLT].[Flag], [SalesOrderNumber] NVARCHAR(25) NOT NULL, [PurchaseOrderNumber] [SalesLT].[OrderNumber], [AccountNumber] [SalesLT].[AccountNumber], [CustomerID] INT NOT NULL, [ShipToAddressID] INT NOT NULL, [BillToAddressID] INT NOT NULL, [ShipMethod] NVARCHAR(50) NOT NULL, [CreditCardApprovalCode] VARCHAR(15) NOT NULL, [SubTotal] MONEY NOT NULL, [TaxAmt] MONEY NOT NULL, [Freight] MONEY NOT NULL, [TotalDue] MONEY NOT NULL, [Comment] NVARCHAR(MAX) NOT NULL, [rowguid] UNIQUEIDENTIFIER NOT NULL, [ModifiedDate] DATETIME NOT NULL, CONSTRAINT [PK_SalesOrderHeader_SalesOrderID] PRIMARY KEY CLUSTERED ([SalesOrderID] ASC) ON [PRIMARY], CONSTRAINT [AK_SalesOrderHeader_SalesOrderNumber] UNIQUE NONCLUSTERED ([SalesOrderNumber] ASC) ON [PRIMARY], CONSTRAINT [AK_SalesOrderHeader_rowguid] UNIQUE NONCLUSTERED ([rowguid] ASC) ON [PRIMARY], CONSTRAINT [CK_SalesOrderHeader_DueDate] CHECK ([DueDate]>=[OrderDate]), CONSTRAINT [CK_SalesOrderHeader_Freight] CHECK ([Freight]>=(0.00)), CONSTRAINT [CK_SalesOrderHeader_ShipDate] CHECK ([ShipDate]>=[OrderDate] OR [ShipDate] IS NULL), CONSTRAINT [CK_SalesOrderHeader_Status] CHECK ([Status]>=(0) AND [Status]<=(8)), CONSTRAINT [CK_SalesOrderHeader_SubTotal] CHECK ([SubTotal]>=(0.00)), CONSTRAINT [CK_SalesOrderHeader_TaxAmt] CHECK ([TaxAmt]>=(0.00)), CONSTRAINT [FK_SalesOrderHeader_Customer_CustomerID] FOREIGN KEY (CustomerID) REFERENCES [SalesLT].[Customer](CustomerID), CONSTRAINT [FK_SalesOrderHeader_Address_BillTo_AddressID] FOREIGN KEY (BillToAddressID) REFERENCES [SalesLT].[Address](AddressID), CONSTRAINT [FK_SalesOrderHeader_Address_ShipTo_AddressID] FOREIGN KEY (ShipToAddressID) REFERENCES [SalesLT].[Address](AddressID) ) GO ALTER TABLE [SalesLT].[SalesOrderHeader] ADD CONSTRAINT [DF_SalesOrderHeader_OrderID] DEFAULT (NEXT VALUE FOR [SalesLT].[SalesOrderNumber]) FOR [SalesOrderID] GO ALTER TABLE [SalesLT].[SalesOrderHeader] ADD CONSTRAINT [DF_SalesOrderHeader_RevisionNumber] DEFAULT ((0)) FOR [RevisionNumber] GO ALTER TABLE [SalesLT].[SalesOrderHeader] ADD CONSTRAINT [DF_SalesOrderHeader_OrderDate] DEFAULT (getdate()) FOR [OrderDate] GO ALTER TABLE [SalesLT].[SalesOrderHeader] ADD CONSTRAINT [DF_SalesOrderHeader_Status] DEFAULT (1) FOR [Status] GO ALTER TABLE [SalesLT].[SalesOrderHeader] ADD CONSTRAINT [DF_SalesOrderHeader_SubTotal] DEFAULT ((0.00)) FOR [SubTotal] GO ALTER TABLE [SalesLT].[SalesOrderHeader] ADD CONSTRAINT [DF_SalesOrderHeader_TaxAmt] DEFAULT ((0.00)) FOR [TaxAmt] GO ALTER TABLE [SalesLT].[SalesOrderHeader] ADD CONSTRAINT [DF_SalesOrderHeader_Freight] DEFAULT ((0.00)) FOR [Freight] GO ALTER TABLE [SalesLT].[SalesOrderHeader] ADD CONSTRAINT [DF_SalesOrderHeader_rowguid] DEFAULT (newid()) FOR [rowguid] GO ALTER TABLE [SalesLT].[SalesOrderHeader] ADD CONSTRAINT [DF_SalesOrderHeader_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate] GO CREATE INDEX IX_SalesOrderHeader_CustomerID ON [SalesLT].[SalesOrderHeader] ( [CustomerID] ) GO
CREATE DATABASE [HackDBSQL]; GO USE [HackDBSQL] GO CREATE SCHEMA [SalesLT]; GO CREATE TYPE [SalesLT].[Name] FROM NVARCHAR(50) NOT NULL GO CREATE TYPE [SalesLT].[NameStyle] FROM BIT NOT NULL GO CREATE TYPE [SalesLT].[Phone] FROM NVARCHAR(25) GO CREATE TYPE [SalesLT].[Flag] FROM BIT NOT NULL GO CREATE TYPE [SalesLT].[OrderNumber] FROM NVARCHAR(25) GO CREATE TYPE [SalesLT].[AccountNumber] FROM NVARCHAR(15) GO CREATE TABLE [SalesLT].[Address] ( [AddressID] INT IDENTITY(1, 1) NOT NULL, [AddressLine1] NVARCHAR(60) NOT NULL, [AddressLine2] NVARCHAR(60) NOT NULL, [City] NVARCHAR(30) NOT NULL, [StateProvince] [SalesLT].[Name], [CountryRegion] [SalesLT].[Name], [PostalCode] NVARCHAR(15) NOT NULL, [rowguid] UNIQUEIDENTIFIER NOT NULL, [ModifiedDate] DATETIME NOT NULL, CONSTRAINT [PK_Address_AddressID] PRIMARY KEY CLUSTERED ([AddressID] ASC) WITH ( IGNORE_DUP_KEY = ON, STATISTICS_NORECOMPUTE = ON ) ON [PRIMARY], CONSTRAINT [AK_Address_rowguid] UNIQUE NONCLUSTERED ([rowguid] ASC) ON [PRIMARY] ) GO ALTER TABLE [SalesLT].[Address] ADD CONSTRAINT [DF_Address_rowguid] DEFAULT (newid()) FOR [rowguid] GO ALTER TABLE [SalesLT].[Address] ADD CONSTRAINT [DF_Address_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate] GO CREATE INDEX IX_Address_AddressLine1_AddressLine2_City_StateProvince_PostalCode_CountryRegion ON [SalesLT].[Address] ( [AddressLine1], [AddressLine2], [City], [StateProvince], [PostalCode], [CountryRegion] ) GO CREATE INDEX IX_Address_StateProvince ON [SalesLT].[Address] ( [StateProvince] ) GO CREATE TABLE [SalesLT].[Customer] ( [CustomerID] INT IDENTITY(1, 1) NOT NULL, [NameStyle] [SalesLT].[NameStyle], [Title] NVARCHAR(8) NOT NULL, [FirstName] [SalesLT].[Name], [MiddleName] [SalesLT].[Name], [LastName] [SalesLT].[Name], [Suffix] NVARCHAR(10) NOT NULL, [CompanyName] NVARCHAR(128) NOT NULL, [SalesPerson] NVARCHAR(256) NOT NULL, [EmailAddress] NVARCHAR(50) NOT NULL, [Phone] [SalesLT].[Phone], [PasswordHash] VARCHAR(128) NOT NULL, [PasswordSalt] VARCHAR(10) NOT NULL, [rowguid] UNIQUEIDENTIFIER NOT NULL, [ModifiedDate] DATETIME NOT NULL, CONSTRAINT [PK_Customer_CustomerID] PRIMARY KEY CLUSTERED ([CustomerID] ASC) ON [PRIMARY], CONSTRAINT [AK_Customer_rowguid] UNIQUE NONCLUSTERED ([rowguid] ASC) ON [PRIMARY] ) GO ALTER TABLE [SalesLT].[Customer] ADD CONSTRAINT [DF_Customer_rowguid] DEFAULT (newid()) FOR [rowguid] GO ALTER TABLE [SalesLT].[Customer] ADD CONSTRAINT [DF_Customer_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate] GO CREATE INDEX IX_Customer_EmailAddress ON [SalesLT].[Customer] ( [EmailAddress] ) GO CREATE TABLE [SalesLT].[CustomerAddress] ( [CustomerID] INT NOT NULL, [AddressID] INT NOT NULL, [AddressType] [SalesLT].[Name], [rowguid] UNIQUEIDENTIFIER NOT NULL, [ModifiedDate] DATETIME NOT NULL, CONSTRAINT [PK_CustomerAddress_CustomerID_AddressID] PRIMARY KEY CLUSTERED ([CustomerID] ASC, [AddressID] ASC) ON [PRIMARY], CONSTRAINT [AK_CustomerAddress_rowguid] UNIQUE NONCLUSTERED ([rowguid] ASC) ON [PRIMARY], CONSTRAINT [FK_CustomerAddress_Customer_CustomerID] FOREIGN KEY (CustomerID) REFERENCES [SalesLT].[Customer](CustomerID), CONSTRAINT [FK_CustomerAddress_Address_AddressID] FOREIGN KEY (AddressID) REFERENCES [SalesLT].[Address](AddressID) ) GO ALTER TABLE [SalesLT].[CustomerAddress] ADD CONSTRAINT [DF_CustomerAddress_rowguid] DEFAULT (newid()) FOR [rowguid] GO ALTER TABLE [SalesLT].[CustomerAddress] ADD CONSTRAINT [DF_CustomerAddress_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate] GO CREATE TABLE [SalesLT].[JSONtbl] ( [ID] NCHAR(10) NOT NULL, [JSONContent] NVARCHAR(MAX), [JSON2] NVARCHAR(MAX) NOT NULL, CONSTRAINT [PK_JSONtbl] PRIMARY KEY CLUSTERED ([ID] ASC) ON [PRIMARY] ) GO CREATE TABLE [SalesLT].[ProductCategory] ( [ProductCategoryID] INT IDENTITY(1, 1) NOT NULL, [ParentProductCategoryID] INT NOT NULL, [Name] [SalesLT].[Name], [rowguid] UNIQUEIDENTIFIER NOT NULL, [ModifiedDate] DATETIME NOT NULL, CONSTRAINT [PK_ProductCategory_ProductCategoryID] PRIMARY KEY CLUSTERED ([ProductCategoryID] ASC) ON [PRIMARY], CONSTRAINT [AK_ProductCategory_rowguid] UNIQUE NONCLUSTERED ([rowguid] ASC) ON [PRIMARY], CONSTRAINT [FK_ProductCategory_ProductCategory_ParentProductCategoryID_ProductCategoryID] FOREIGN KEY (ParentProductCategoryID) REFERENCES [SalesLT].[ProductCategory](ProductCategoryID) ) GO ALTER TABLE [SalesLT].[ProductCategory] ADD CONSTRAINT [DF_ProductCategory_rowguid] DEFAULT (newid()) FOR [rowguid] GO ALTER TABLE [SalesLT].[ProductCategory] ADD CONSTRAINT [DF_ProductCategory_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate] GO CREATE TABLE [SalesLT].[ProductModel] ( [ProductModelID] INT IDENTITY(1, 1) NOT NULL, [Name] [SalesLT].[Name], [CatalogDescription] XML NOT NULL, [rowguid] UNIQUEIDENTIFIER NOT NULL, [ModifiedDate] DATETIME NOT NULL, CONSTRAINT [PK_ProductModel_ProductModelID] PRIMARY KEY CLUSTERED ([ProductModelID] ASC) ON [PRIMARY], CONSTRAINT [AK_ProductModel_rowguid] UNIQUE NONCLUSTERED ([rowguid] ASC) ON [PRIMARY] ) GO ALTER TABLE [SalesLT].[ProductModel] ADD CONSTRAINT [DF_ProductModel_rowguid] DEFAULT (newid()) FOR [rowguid] GO ALTER TABLE [SalesLT].[ProductModel] ADD CONSTRAINT [DF_ProductModel_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate] GO CREATE TABLE [SalesLT].[ProductDescription] ( [ProductDescriptionID] INT IDENTITY(1, 1) NOT NULL, [Description] NVARCHAR(400) NOT NULL, [rowguid] UNIQUEIDENTIFIER NOT NULL, [ModifiedDate] DATETIME NOT NULL, CONSTRAINT [PK_ProductDescription_ProductDescriptionID] PRIMARY KEY CLUSTERED ([ProductDescriptionID] ASC) ON [PRIMARY], CONSTRAINT [AK_ProductDescription_rowguid] UNIQUE NONCLUSTERED ([rowguid] ASC) ON [PRIMARY] ) GO ALTER TABLE [SalesLT].[ProductDescription] ADD CONSTRAINT [DF_ProductDescription_rowguid] DEFAULT (newid()) FOR [rowguid] GO ALTER TABLE [SalesLT].[ProductDescription] ADD CONSTRAINT [DF_ProductDescription_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate] GO CREATE TABLE [SalesLT].[Product] ( [ProductID] INT IDENTITY(1, 1) NOT NULL, [Name] [SalesLT].[Name], [ProductNumber] NVARCHAR(25) NOT NULL, [Color] NVARCHAR(15) NOT NULL, [StandardCost] MONEY NOT NULL, [ListPrice] MONEY NOT NULL, [Size] NVARCHAR(5) NOT NULL, [Weight] DECIMAL(8,2) NOT NULL, [ProductCategoryID] INT NOT NULL, [ProductModelID] INT NOT NULL, [SellStartDate] DATETIME NOT NULL, [SellEndDate] DATETIME NOT NULL, [DiscontinuedDate] DATETIME NOT NULL, [ThumbNailPhoto] VARBINARY(MAX) NOT NULL, [ThumbnailPhotoFileName] NVARCHAR(50) NOT NULL, [rowguid] UNIQUEIDENTIFIER NOT NULL, [ModifiedDate] DATETIME NOT NULL, CONSTRAINT [PK_Product_ProductID] PRIMARY KEY CLUSTERED ([ProductID] ASC) ON [PRIMARY], CONSTRAINT [AK_Product_ProductNumber] UNIQUE NONCLUSTERED ([ProductNumber] ASC) ON [PRIMARY], CONSTRAINT [AK_Product_rowguid] UNIQUE NONCLUSTERED ([rowguid] ASC) ON [PRIMARY], CONSTRAINT [CK_Product_ListPrice] CHECK ([ListPrice]>=(0.00)), CONSTRAINT [CK_Product_SellEndDate] CHECK ([SellEndDate]>=[SellStartDate] OR [SellEndDate] IS NULL), CONSTRAINT [CK_Product_StandardCost] CHECK ([StandardCost]>=(0.00)), CONSTRAINT [CK_Product_Weight] CHECK ([Weight]>(0.00)), CONSTRAINT [FK_Product_ProductModel_ProductModelID] FOREIGN KEY (ProductModelID) REFERENCES [SalesLT].[ProductModel](ProductModelID), CONSTRAINT [FK_Product_ProductCategory_ProductCategoryID] FOREIGN KEY (ProductCategoryID) REFERENCES [SalesLT].[ProductCategory](ProductCategoryID) ) GO ALTER TABLE [SalesLT].[Product] ADD CONSTRAINT [DF_Product_rowguid] DEFAULT (newid()) FOR [rowguid] GO ALTER TABLE [SalesLT].[Product] ADD CONSTRAINT [DF_Product_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate] GO CREATE TABLE [SalesLT].[ProductModelProductDescription] ( [ProductModelID] INT NOT NULL, [ProductDescriptionID] INT NOT NULL, [Culture] NCHAR(6) NOT NULL, [rowguid] UNIQUEIDENTIFIER NOT NULL, [ModifiedDate] DATETIME NOT NULL, CONSTRAINT [PK_ProductModelProductDescription_ProductModelID_ProductDescriptionID_Culture] PRIMARY KEY CLUSTERED ([ProductModelID] ASC, [ProductDescriptionID] ASC, [Culture] ASC) ON [PRIMARY], CONSTRAINT [AK_ProductModelProductDescription_rowguid] UNIQUE NONCLUSTERED ([rowguid] ASC) ON [PRIMARY], CONSTRAINT [FK_ProductModelProductDescription_ProductModel_ProductModelID] FOREIGN KEY (ProductModelID) REFERENCES [SalesLT].[ProductModel](ProductModelID), CONSTRAINT [FK_ProductModelProductDescription_ProductDescription_ProductDescriptionID] FOREIGN KEY (ProductDescriptionID) REFERENCES [SalesLT].[ProductDescription](ProductDescriptionID) ) GO ALTER TABLE [SalesLT].[ProductModelProductDescription] ADD CONSTRAINT [DF_ProductModelProductDescription_rowguid] DEFAULT (newid()) FOR [rowguid] GO ALTER TABLE [SalesLT].[ProductModelProductDescription] ADD CONSTRAINT [DF_ProductModelProductDescription_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate] GO CREATE TABLE [SalesLT].[SalesOrderHeader] ( [SalesOrderID] INT NOT NULL, [RevisionNumber] TINYINT NOT NULL, [OrderDate] DATETIME NOT NULL, [DueDate] DATETIME NOT NULL, [ShipDate] DATETIME NOT NULL, [Status] TINYINT NOT NULL, [OnlineOrderFlag] [SalesLT].[Flag], [SalesOrderNumber] NVARCHAR(25) NOT NULL, [PurchaseOrderNumber] [SalesLT].[OrderNumber], [AccountNumber] [SalesLT].[AccountNumber], [CustomerID] INT NOT NULL, [ShipToAddressID] INT NOT NULL, [BillToAddressID] INT NOT NULL, [ShipMethod] NVARCHAR(50) NOT NULL, [CreditCardApprovalCode] VARCHAR(15) NOT NULL, [SubTotal] MONEY NOT NULL, [TaxAmt] MONEY NOT NULL, [Freight] MONEY NOT NULL, [TotalDue] MONEY NOT NULL, [Comment] NVARCHAR(MAX) NOT NULL, [rowguid] UNIQUEIDENTIFIER NOT NULL, [ModifiedDate] DATETIME NOT NULL, CONSTRAINT [PK_SalesOrderHeader_SalesOrderID] PRIMARY KEY CLUSTERED ([SalesOrderID] ASC) ON [PRIMARY], CONSTRAINT [AK_SalesOrderHeader_SalesOrderNumber] UNIQUE NONCLUSTERED ([SalesOrderNumber] ASC) ON [PRIMARY], CONSTRAINT [AK_SalesOrderHeader_rowguid] UNIQUE NONCLUSTERED ([rowguid] ASC) ON [PRIMARY], CONSTRAINT [CK_SalesOrderHeader_DueDate] CHECK ([DueDate]>=[OrderDate]), CONSTRAINT [CK_SalesOrderHeader_Freight] CHECK ([Freight]>=(0.00)), CONSTRAINT [CK_SalesOrderHeader_ShipDate] CHECK ([ShipDate]>=[OrderDate] OR [ShipDate] IS NULL), CONSTRAINT [CK_SalesOrderHeader_Status] CHECK ([Status]>=(0) AND [Status]<=(8)), CONSTRAINT [CK_SalesOrderHeader_SubTotal] CHECK ([SubTotal]>=(0.00)), CONSTRAINT [CK_SalesOrderHeader_TaxAmt] CHECK ([TaxAmt]>=(0.00)), CONSTRAINT [FK_SalesOrderHeader_Customer_CustomerID] FOREIGN KEY (CustomerID) REFERENCES [SalesLT].[Customer](CustomerID), CONSTRAINT [FK_SalesOrderHeader_Address_BillTo_AddressID] FOREIGN KEY (BillToAddressID) REFERENCES [SalesLT].[Address](AddressID), CONSTRAINT [FK_SalesOrderHeader_Address_ShipTo_AddressID] FOREIGN KEY (ShipToAddressID) REFERENCES [SalesLT].[Address](AddressID) ) GO ALTER TABLE [SalesLT].[SalesOrderHeader] ADD CONSTRAINT [DF_SalesOrderHeader_OrderID] DEFAULT (NEXT VALUE FOR [SalesLT].[SalesOrderNumber]) FOR [SalesOrderID] GO ALTER TABLE [SalesLT].[SalesOrderHeader] ADD CONSTRAINT [DF_SalesOrderHeader_RevisionNumber] DEFAULT ((0)) FOR [RevisionNumber] GO ALTER TABLE [SalesLT].[SalesOrderHeader] ADD CONSTRAINT [DF_SalesOrderHeader_OrderDate] DEFAULT (getdate()) FOR [OrderDate] GO ALTER TABLE [SalesLT].[SalesOrderHeader] ADD CONSTRAINT [DF_SalesOrderHeader_Status] DEFAULT (1) FOR [Status] GO ALTER TABLE [SalesLT].[SalesOrderHeader] ADD CONSTRAINT [DF_SalesOrderHeader_SubTotal] DEFAULT ((0.00)) FOR [SubTotal] GO ALTER TABLE [SalesLT].[SalesOrderHeader] ADD CONSTRAINT [DF_SalesOrderHeader_TaxAmt] DEFAULT ((0.00)) FOR [TaxAmt] GO ALTER TABLE [SalesLT].[SalesOrderHeader] ADD CONSTRAINT [DF_SalesOrderHeader_Freight] DEFAULT ((0.00)) FOR [Freight] GO ALTER TABLE [SalesLT].[SalesOrderHeader] ADD CONSTRAINT [DF_SalesOrderHeader_rowguid] DEFAULT (newid()) FOR [rowguid] GO ALTER TABLE [SalesLT].[SalesOrderHeader] ADD CONSTRAINT [DF_SalesOrderHeader_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate] GO CREATE INDEX IX_SalesOrderHeader_CustomerID ON [SalesLT].[SalesOrderHeader] ( [CustomerID] ) GO CREATE TABLE [SalesLT].[SalesOrderDetail] ( [SalesOrderID] INT NOT NULL, [SalesOrderDetailID] INT IDENTITY(1, 1) NOT NULL, [OrderQty] SMALLINT NOT NULL, [ProductID] INT NOT NULL, [UnitPrice] MONEY NOT NULL, [UnitPriceDiscount] MONEY NOT NULL, [LineTotal] NUMERIC(38,6) NOT NULL, [rowguid] UNIQUEIDENTIFIER NOT NULL, [ModifiedDate] DATETIME NOT NULL, CONSTRAINT [PK_SalesOrderDetail_SalesOrderID_SalesOrderDetailID] PRIMARY KEY CLUSTERED ([SalesOrderID] ASC, [SalesOrderDetailID] ASC) ON [PRIMARY], CONSTRAINT [AK_SalesOrderDetail_rowguid] UNIQUE NONCLUSTERED ([rowguid] ASC) ON [PRIMARY], CONSTRAINT [CK_SalesOrderDetail_OrderQty] CHECK ([OrderQty]>(0)), CONSTRAINT [CK_SalesOrderDetail_UnitPrice] CHECK ([UnitPrice]>=(0.00)), CONSTRAINT [CK_SalesOrderDetail_UnitPriceDiscount] CHECK ([UnitPriceDiscount]>=(0.00)), CONSTRAINT [FK_SalesOrderDetail_Product_ProductID] FOREIGN KEY (ProductID) REFERENCES [SalesLT].[Product](ProductID), CONSTRAINT [FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID] FOREIGN KEY (SalesOrderID) REFERENCES [SalesLT].[SalesOrderHeader](SalesOrderID) ) GO ALTER TABLE [SalesLT].[SalesOrderDetail] ADD CONSTRAINT [DF_SalesOrderDetail_UnitPriceDiscount] DEFAULT ((0.0)) FOR [UnitPriceDiscount] GO ALTER TABLE [SalesLT].[SalesOrderDetail] ADD CONSTRAINT [DF_SalesOrderDetail_rowguid] DEFAULT (newid()) FOR [rowguid] GO ALTER TABLE [SalesLT].[SalesOrderDetail] ADD CONSTRAINT [DF_SalesOrderDetail_ModifiedDate] DEFAULT (getdate()) FOR [ModifiedDate] GO CREATE INDEX IX_SalesOrderDetail_ProductID ON [SalesLT].[SalesOrderDetail] ( [ProductID] ) GO CREATE VIEW [SalesLT].[vProductAndDescription] AS SELECT [SalesLT].[ProductModelProductDescription].[Culture], [SalesLT].[ProductDescription].[Description], [SalesLT].[Product].[Name], [SalesLT].[Product].[ProductID], [SalesLT].[ProductModel].[Name] as [ProductModel] FROM [SalesLT].[ProductModelProductDescription], [SalesLT].[ProductDescription], [SalesLT].[Product], [SalesLT].[ProductModel] GO CREATE VIEW [SalesLT].[vGetAllCategories] AS SELECT [SalesLT].[ProductCategory].[Name] as [ParentProductCategoryName], [SalesLT].[ProductCategory].[Name] as [ProductCategoryID], [SalesLT].[ProductCategory].[Name] as [ProductCategoryName] FROM [SalesLT].[ProductCategory] GO CREATE VIEW [SalesLT].[vProductModelCatalogDescription] AS SELECT [SalesLT].[ProductModel].[CatalogDescription] as [BikeFrame], [SalesLT].[ProductModel].[CatalogDescription] as [Color], [SalesLT].[ProductModel].[CatalogDescription] as [Copyright], [SalesLT].[ProductModel].[CatalogDescription] as [Crankset], [SalesLT].[ProductModel].[CatalogDescription] as [MaintenanceDescription], [SalesLT].[ProductModel].[CatalogDescription] as [Manufacturer], [SalesLT].[ProductModel].[CatalogDescription] as [Material], [SalesLT].[ProductModel].[ModifiedDate], [SalesLT].[ProductModel].[Name], [SalesLT].[ProductModel].[CatalogDescription] as [NoOfYears], [SalesLT].[ProductModel].[CatalogDescription] as [Pedal], [SalesLT].[ProductModel].[CatalogDescription] as [PictureAngle], [SalesLT].[ProductModel].[CatalogDescription] as [PictureSize], [SalesLT].[ProductModel].[CatalogDescription] as [ProductLine], [SalesLT].[ProductModel].[ProductModelID], [SalesLT].[ProductModel].[CatalogDescription] as [ProductPhotoID], [SalesLT].[ProductModel].[CatalogDescription] as [ProductURL], [SalesLT].[ProductModel].[CatalogDescription] as [RiderExperience], [SalesLT].[ProductModel].[CatalogDescription] as [Saddle], [SalesLT].[ProductModel].[CatalogDescription] as [Style], [SalesLT].[ProductModel].[CatalogDescription] as [Summary], [SalesLT].[ProductModel].[CatalogDescription] as [WarrantyDescription], [SalesLT].[ProductModel].[CatalogDescription] as [WarrantyPeriod], [SalesLT].[ProductModel].[CatalogDescription] as [Wheel], [SalesLT].[ProductModel].[rowguid] FROM [SalesLT].[ProductModel] GO
Property | Value |
View name | vGetAllCategories |
Technical name | |
Id | |
Database | SalesLT |
View on | ProductCategory |
Additional properties | |
Comments | |
Remarks |
Column | Type | Req | Key | Description | Comments |
ParentProductCategoryName | reference | false | |||
ProductCategoryID | reference | false | |||
ProductCategoryName | reference | false |
Property | Value |
Business Name | ParentProductCategoryName |
$ref | #collection/definitions/ProductCategory/Name |
Reference type | collectionReference |
Property | Value |
Business Name | ProductCategoryID |
$ref | #collection/definitions/ProductCategory/Name |
Reference type | collectionReference |
Property | Value |
Business Name | ProductCategoryName |
$ref | #collection/definitions/ProductCategory/Name |
Reference type | collectionReference |
Property | Value |
View name | vProductAndDescription |
Technical name | |
Id | |
Database | SalesLT |
View on | Product |
Additional properties | |
Comments | |
Remarks |
Column | Type | Req | Key | Description | Comments |
Culture | nchar(6) | true | |||
Description | nvarchar(400) | true | |||
Name | reference | false | |||
ProductID | int | true | |||
ProductModel | reference | false |
Property | Value |
Business Name | Culture |
$ref | #collection/definitions/ProductModelProductDescription/Culture |
Reference type | collectionReference |
Property | Value |
Business Name | Description |
$ref | #collection/definitions/ProductDescription/Description |
Reference type | collectionReference |
Property | Value |
Business Name | Name |
$ref | #collection/definitions/Product/Name |
Reference type | collectionReference |
Property | Value |
Business Name | ProductID |
$ref | #collection/definitions/Product/ProductID |
Reference type | collectionReference |
Property | Value |
Business Name | ProductModel |
$ref | #collection/definitions/ProductModel/Name |
Reference type | collectionReference |
Property | Value |
View name | vProductModelCatalogDescription |
Technical name | |
Id | |
Database | SalesLT |
View on | ProductModel |
Additional properties | |
Comments | |
Remarks |
Column | Type | Req | Key | Description | Comments |
BikeFrame | xml | false | |||
Color | xml | false | |||
Copyright | xml | false | |||
Crankset | xml | false | |||
MaintenanceDescription | xml | false | |||
Manufacturer | xml | false | |||
Material | xml | false | |||
ModifiedDate | datetime | true | |||
Name | reference | false | |||
NoOfYears | xml | false | |||
Pedal | xml | false | |||
PictureAngle | xml | false | |||
PictureSize | xml | false | |||
ProductLine | xml | false | |||
ProductModelID | int | true | |||
ProductPhotoID | xml | false | |||
ProductURL | xml | false | |||
RiderExperience | xml | false | |||
Saddle | xml | false | |||
Style | xml | false | |||
Summary | xml | false | |||
WarrantyDescription | xml | false | |||
WarrantyPeriod | xml | false | |||
Wheel | xml | false | |||
rowguid | uniqueidentifier | true |
Property | Value |
Business Name | BikeFrame |
$ref | #collection/definitions/ProductModel/CatalogDescription |
Reference type | collectionReference |
Property | Value |
Business Name | Color |
$ref | #collection/definitions/ProductModel/CatalogDescription |
Reference type | collectionReference |
Property | Value |
Business Name | Copyright |
$ref | #collection/definitions/ProductModel/CatalogDescription |
Reference type | collectionReference |
Property | Value |
Business Name | Crankset |
$ref | #collection/definitions/ProductModel/CatalogDescription |
Reference type | collectionReference |
Property | Value |
Business Name | MaintenanceDescription |
$ref | #collection/definitions/ProductModel/CatalogDescription |
Reference type | collectionReference |
Property | Value |
Business Name | Manufacturer |
$ref | #collection/definitions/ProductModel/CatalogDescription |
Reference type | collectionReference |
Property | Value |
Business Name | Material |
$ref | #collection/definitions/ProductModel/CatalogDescription |
Reference type | collectionReference |
Property | Value |
Business Name | ModifiedDate |
$ref | #collection/definitions/ProductModel/ModifiedDate |
Reference type | collectionReference |
Property | Value |
Business Name | Name |
$ref | #collection/definitions/ProductModel/Name |
Reference type | collectionReference |
Property | Value |
Business Name | NoOfYears |
$ref | #collection/definitions/ProductModel/CatalogDescription |
Reference type | collectionReference |
Property | Value |
Business Name | Pedal |
$ref | #collection/definitions/ProductModel/CatalogDescription |
Reference type | collectionReference |
Property | Value |
Business Name | PictureAngle |
$ref | #collection/definitions/ProductModel/CatalogDescription |
Reference type | collectionReference |
Property | Value |
Business Name | PictureSize |
$ref | #collection/definitions/ProductModel/CatalogDescription |
Reference type | collectionReference |
Property | Value |
Business Name | ProductLine |
$ref | #collection/definitions/ProductModel/CatalogDescription |
Reference type | collectionReference |
Property | Value |
Business Name | ProductModelID |
$ref | #collection/definitions/ProductModel/ProductModelID |
Reference type | collectionReference |
Property | Value |
Business Name | ProductPhotoID |
$ref | #collection/definitions/ProductModel/CatalogDescription |
Reference type | collectionReference |
Property | Value |
Business Name | ProductURL |
$ref | #collection/definitions/ProductModel/CatalogDescription |
Reference type | collectionReference |
Property | Value |
Business Name | RiderExperience |
$ref | #collection/definitions/ProductModel/CatalogDescription |
Reference type | collectionReference |
Property | Value |
Business Name | Saddle |
$ref | #collection/definitions/ProductModel/CatalogDescription |
Reference type | collectionReference |
Property | Value |
Business Name | Style |
$ref | #collection/definitions/ProductModel/CatalogDescription |
Reference type | collectionReference |
Property | Value |
Business Name | Summary |
$ref | #collection/definitions/ProductModel/CatalogDescription |
Reference type | collectionReference |
Property | Value |
Business Name | WarrantyDescription |
$ref | #collection/definitions/ProductModel/CatalogDescription |
Reference type | collectionReference |
Property | Value |
Business Name | WarrantyPeriod |
$ref | #collection/definitions/ProductModel/CatalogDescription |
Reference type | collectionReference |
Property | Value |
Business Name | Wheel |
$ref | #collection/definitions/ProductModel/CatalogDescription |
Reference type | collectionReference |
Property | Value |
Business Name | rowguid |
$ref | #collection/definitions/ProductModel/rowguid |
Reference type | collectionReference |
Property | Value |
Name | FK_CustomerAddress_Address_AddressID |
Description | |
Parent Table | Address |
Parent Column | AddressID |
Parent Cardinality | 1 |
Child Table | CustomerAddress |
Child Column | AddressID |
Child Cardinality | 0..n |
Comments |
Property | Value |
Name | FK_CustomerAddress_Customer_CustomerID |
Description | |
Parent Table | Customer |
Parent Column | CustomerID |
Parent Cardinality | 1 |
Child Table | CustomerAddress |
Child Column | CustomerID |
Child Cardinality | 0..n |
Comments |
Parent Table | Parent Column |
ProductCategory | ProductCategoryID |
Child Table | Child Column |
ProductCategory | ParentProductCategoryID |
Property | Value |
Name | FK_ProductCategory_ProductCategory_ParentProductCategoryID_ProductCategoryID |
Description | |
Parent Table | ProductCategory |
Parent Column | ProductCategoryID |
Parent Cardinality | 1 |
Child Table | ProductCategory |
Child Column | ParentProductCategoryID |
Child Cardinality | 0..n |
Comments |
Parent Table | Parent Column |
ProductDescription | ProductDescriptionID |
Child Table | Child Column |
ProductModelProductDescription | ProductDescriptionID |
Property | Value |
Name | FK_ProductModelProductDescription_ProductDescription_ProductDescriptionID |
Description | |
Parent Table | ProductDescription |
Parent Column | ProductDescriptionID |
Parent Cardinality | 1 |
Child Table | ProductModelProductDescription |
Child Column | ProductDescriptionID |
Child Cardinality | 0..n |
Comments |
Parent Table | Parent Column |
ProductModel | ProductModelID |
Child Table | Child Column |
ProductModelProductDescription | ProductModelID |
Property | Value |
Name | FK_ProductModelProductDescription_ProductModel_ProductModelID |
Description | |
Parent Table | ProductModel |
Parent Column | ProductModelID |
Parent Cardinality | 1 |
Child Table | ProductModelProductDescription |
Child Column | ProductModelID |
Child Cardinality | 0..n |
Comments |
Parent Table | Parent Column |
ProductCategory | ProductCategoryID |
Child Table | Child Column |
Product | ProductCategoryID |
Property | Value |
Name | FK_Product_ProductCategory_ProductCategoryID |
Description | |
Parent Table | ProductCategory |
Parent Column | ProductCategoryID |
Parent Cardinality | 1 |
Child Table | Product |
Child Column | ProductCategoryID |
Child Cardinality | 0..n |
Comments |
Property | Value |
Name | FK_Product_ProductModel_ProductModelID |
Description | |
Parent Table | ProductModel |
Parent Column | ProductModelID |
Parent Cardinality | 1 |
Child Table | Product |
Child Column | ProductModelID |
Child Cardinality | 0..n |
Comments |
Property | Value |
Name | FK_SalesOrderDetail_Product_ProductID |
Description | |
Parent Table | Product |
Parent Column | ProductID |
Parent Cardinality | 1 |
Child Table | SalesOrderDetail |
Child Column | ProductID |
Child Cardinality | 0..n |
Comments |
Parent Table | Parent Column |
SalesOrderHeader | SalesOrderID |
Child Table | Child Column |
SalesOrderDetail | SalesOrderID |
Property | Value |
Name | FK_SalesOrderDetail_SalesOrderHeader_SalesOrderID |
Description | |
Parent Table | SalesOrderHeader |
Parent Column | SalesOrderID |
Parent Cardinality | 1 |
Child Table | SalesOrderDetail |
Child Column | SalesOrderID |
Child Cardinality | 0..n |
Comments |
Property | Value |
Name | FK_SalesOrderHeader_Address_BillTo_AddressID |
Description | |
Parent Table | Address |
Parent Column | AddressID |
Parent Cardinality | 1 |
Child Table | SalesOrderHeader |
Child Column | BillToAddressID |
Child Cardinality | 0..n |
Comments |
Property | Value |
Name | FK_SalesOrderHeader_Address_ShipTo_AddressID |
Description | |
Parent Table | Address |
Parent Column | AddressID |
Parent Cardinality | 1 |
Child Table | SalesOrderHeader |
Child Column | ShipToAddressID |
Child Cardinality | 0..n |
Comments |
Property | Value |
Name | FK_SalesOrderHeader_Customer_CustomerID |
Description | |
Parent Table | Customer |
Parent Column | CustomerID |
Parent Cardinality | 1 |
Child Table | SalesOrderHeader |
Child Column | CustomerID |
Child Cardinality | 0..n |
Comments |