Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Task_6_Final
--Sql Server 2014 Express Edition --Batches are separated by 'go' CREATE TABLE Customer( CustomerID int PRIMARY KEY, CompanyName varchar(255), ContactName varchar(255), ContactTitle varchar(255), Address varchar(255), City varchar(255), Region varchar(255), PostalCode int, Country varchar(50), Phone int, Fax int, DateJoined datetime, UpdatedAt datetime, DateLeft datetime ); CREATE TABLE Category( CategoryID int PRIMARY KEY, CategoryName varchar(100), Description varchar(255), Picture image, CreatedAt datetime, UpdatedAt datetime ); CREATE TABLE Product( ProductID int PRIMARY KEY, ProductName varchar(100), SupplierID int, CategoryID int FOREIGN KEY REFERENCES Category(CategoryID), QuantityPerUnit int, UnitPrice Money, UnitsInStock int, UnitsOnOrder int, ReorderLevel int, Discontinued bit, CreatedAt datetime, UpdatedAt datetime ); CREATE TABLE Orders( OrderID int PRIMARY KEY, CustomerID int FOREIGN KEY REFERENCES Customer(CustomerID), EmployeeID int, OrderDate datetime, RequiredDate datetime, ShipDate datetime, ShipVia int, Frieght Money, ShipName varchar(255), ShipAddress varchar(255), ShipCity varchar(100), ShipRegion varchar(50), ShipPostalCode int, ShipCountry varchar(255), CreatedAt datetime, UpdatedAt datetime ); CREATE TABLE OrderDetails( OrderID int FOREIGN KEY REFERENCES Orders(OrderID), ProductID int FOREIGN KEY REFERENCES Product(ProductID), UnitPrice Money, Quantity int, Discount Money, CreatedAt datetime, UpdatedAt datetime );
run
|
edit
|
history
|
help
0
Delete cascade
3a
Delete double entries from a table without primary key
sql-server-storing-wildcards-in-data
Creating tables in sql server
Fff
FIGURA5.4
Fatch data in xml format
TEST-A3
Lab assessment 2