Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

NOT Null, NOT Null, Null, NOT Null, Null, NOT Null, Null, NOT Null, NOT Null

Download as rtf, pdf, or txt
Download as rtf, pdf, or txt
You are on page 1of 5

Create database Test

CREATE TABLE Person ( BusinessEntityID int, PersonType nchar(2) NOT NULL, NameStyle varchar(20) NOT NULL, Title nvarchar(8) NULL, FirstName nvarchar(20) NOT NULL, MiddleName nvarchar(20) NULL, LastName nvarchar(20) NOT NULL, Suffix nvarchar(10) NULL, EmailPromotion int NOT NULL, ModifiedDate datetime NOT NULL)

CREATE TABLE Product ( ProductID int NOT NULL,

Name varchar(29) NOT NULL, ProductNumber nvarchar(25) NOT NULL, Color nvarchar(15) NULL, ListPrice money NOT NULL, Size nvarchar(5) NULL, Weight decimal(8, 2) NULL, ProductLine nchar(2) NULL, Class nchar(2) NULL, Style nchar(2) NULL,

ProductModelID int NULL, SellStartDate datetime NOT NULL, SellEndDate datetime NULL, DiscontinuedDate datetime NULL, ModifiedDate datetime NOT NULL)

CREATE TABLE SalesOrder ( SalesOrderID int NOT NULL, RevisionNumber tinyint NOT NULL, OrderDate datetime NOT NULL, DueDate datetime NOT NULL, ShipDate datetime NULL, Status tinyint NOT NULL, CustomerID int NOT NULL, SalesPersonID int NULL, TerritoryID int NULL, BillToAddressID int NOT NULL, ShipToAddressID int NOT NULL, ShipMethodID int NOT NULL, CreditCardID int NULL, CurrencyRateID int NULL, SubTotal money NOT NULL, Comment nvarchar(128) NULL, ModifiedDate datetime NOT NULL)

CREATE TABLE SpecialOffe

( SpecialOfferID int NOT NULL, Description varchar(255) NOT NULL, DiscountPct smallmoney NOT NULL, Type nvarchar(50) NOT NULL, Category nvarchar(50) NOT NULL, StartDate datetime NOT NULL, EndDate datetime NOT NULL, MinQty int NOT NULL, MaxQty int NULL, ModifiedDate datetime NOT NULL)

CREATE TABLE SalesOrderHeader ( SalesOrderID int NOT NULL, RevisionNumber tinyint NOT NULL, OrderDate datetime NOT NULL, DueDate datetime NOT NULL, ShipDate datetime NULL, Status tinyint NOT NULL, AccountNumber int NULL, CustomerID int NOT NULL, SalesPersonID int NULL, TerritoryID int NULL, BillToAddressID int NOT NULL, ShipToAddressID int NOT NULL, ShipMethodID int NOT NULL, CreditCardID int NULL,

CreditCardApprovalCode varchar(15) NULL, CurrencyRateID int NULL, SubTotal money NOT NULL, TaxAmt money NOT NULL, Freight money NOT NULL, Comment nvarchar(128) NULL, ModifiedDate datetime NOT NULL)

CREATE TABLE HumanResourcesEmployee ( BusinessEntityID int NOT NULL, NationalIDNumber nvarchar(15) NOT NULL, LoginID nvarchar(256) NOT NULL, JobTitle nvarchar(50) NOT NULL, BirthDate datetime NOT NULL, MaritalStatus nchar(1) NOT NULL, Gender nchar(1) NOT NULL, HireDate datetime NOT NULL, VacationHours smallint NOT NULL, SickLeaveHours smallint NOT NULL, ModifiedDate datetime NOT NULL)

CREATE TABLE SalesOrderDetail ( SalesOrderID int NOT NULL, SalesOrderDetailID int NOT NULL,

CarrierTrackingNumber nvarchar(25) NULL,

OrderQty smallint NOT NULL, ProductID int NOT NULL, SpecialOfferID int NOT NULL, UnitPrice money NOT NULL, UnitPriceDiscount money NOT NULL, ModifiedDate datetime NOT NULL)

CREATE TABLE Customer ( CustomerID int NOT NULL, LastName nvarchar(25) NULL, FirstName nvarchar(25) NULL, CompanyName nvarchar(25) NULL,

1.select CustomerID, LastName, FirstName, CompanyName from Customer 2.select Name, ProductNumber, Color from Product 3.select CustomerID, LastName, FirstName from Customer where
LastName like 'j%'

You might also like