Skip to content

Instantly share code, notes, and snippets.

@misaki1301
Created August 26, 2019 00:49
Show Gist options
  • Save misaki1301/8d4289051fa457b164bdf7fc9dd54b5a to your computer and use it in GitHub Desktop.
Save misaki1301/8d4289051fa457b164bdf7fc9dd54b5a to your computer and use it in GitHub Desktop.
create database TienditaDeDonPepe
use TienditaDeDonPepe
create table customer(
customerId int primary key identity,
name varchar(45),
lastname varchar(45),
telephone int,
address varchar(75),
dni int)
create table purchaseHistory(
purchaseId int primary key identity,
purchaseDate datetime,
purchaseAmount money,
purchaseQuantity int,
purchaseMethod varchar(35),
ticketNumber int,
customerId int references customer(customerid),
productId int references product(productId),
)
create table product(
productId int primary key identity,
name varchar(35),
price money,
imageProduct image,
datasheet varchar(200),
description varchar(75),
brandId int references brand(brandId),
categoryId int references category(categoryId),
inventoryId int references inventory(inventoryId))
create table inventory(
inventoryId int primary key identity,
stock int,
lastUpdate datetime
)
create table brand(
brandId int primary key identity,
name varchar(50),
imageBrand image,
description varchar(150)
)
create table category(
categoryId int primary key identity,
name varchar(35),
detail varchar(100)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment