-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheverything.sql
More file actions
48 lines (42 loc) · 1.14 KB
/
everything.sql
File metadata and controls
48 lines (42 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
use master;
go
create database everything;
go
use everything;
go
create table tipo (
id int not null primary key identity,
nombre varchar(50) not null
)
create table producto (
id int not null primary key identity,
nombre varchar(100) not null,
descripcion varchar(500) not null,
cantidad varchar(10) not null,
precio varchar(9) not null,
etiquetas varchar(500) not null,
tipo int not null foreign key references tipo(id)
)
create table usuario (
id int not null primary key identity,
nombres varchar(100) not null,
apellidos varchar(100) not null,
correo varchar(100) not null,
telefeno varchar(9) not null,
contraseña varchar(12) not null
)
create table orden (
id int not null primary key identity,
orden_fecha varchar(20) not null,
delivery_fecha varchar(20) not null,
tipo_documento varchar(20) not null,
usuario int not null foreign key references usuario(id)
)
create table orden_detalle (
id int not null primary key identity,
orden int not null foreign key references orden(id),
producto int not null foreign key references producto(id),
cantidad varchar(9) not null,
precio varchar(9) not null,
total varchar(9) not null
)