Created
August 26, 2019 00:49
-
-
Save misaki1301/8d4289051fa457b164bdf7fc9dd54b5a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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