Script base de datos

1,642 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,642
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
37
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Script base de datos

  1. 1. use mastergocreate database yulyon primary(name= yuly_data,filename= C:datayuly_data.mdf,size=4mb,maxsize=10mb,filegrowth=1mb)log on (name= yuly_log,filename= C:datayuly_data.ldf,size=2mb,maxsize=10mb,filegrowth=1mb)gouse yulygocreate table Proveedores(Id_Proveedor int primary key not null,Nom_Proveedor char(20) not null,Fabricante char(20) not null,Dirección char(30) not null,Zona char(20) not null)select* from Proveedorescreate table Articulos(Id_Articulo int primary key not null,Nom_Art char(20) not null,Tipo char(20) not null,Fabricante char(20) not null,Id_Proveedor int not null,Contenido smallint not null,Precio Money not null,)select* from Articuloscreate table Inventario(Id_Articulo int primary key not null,No_Almacen int not null,Nom_Art char(20) not null,Id_Proveedor int not null,Precio Money not null,Existencia int not null)select* from Inventariocreate table Ventas(Id_Factura int primary key not null,
  2. 2. Id_Cliente int not null,Id_Articulo int not null,Id_Empleado int not null,Fecha date not null)select* from Ventascreate table Detalle_Venta(Id_Factura int primary key not null,Nom_Art char(20) not null,Tipo char(20) not null,Importe_Uni smallint not null,Piezas int not null,Total int not null)select * from Detalle_Ventacreate table Empleados(Id_Empleado int primary key not null,Nombre char(20) not null,Apellidos char(30) null)select * from Empleadoscreate table Detalle_Emp(Id_Empleado int primary key not null,Edad smallint null,Puesto char(30) not null,Antiguedad smallint not null,Dirección char(30) not null,Tel smallint not null,CP char(10) null)select * from Detalle_Empcreate table Clientes(Id_Cliente int primary key not null,Nom_Cliente char(20) not null,Apellidos char(30) null)select * from Clientescreate table Detalle_Cliente(Id_Cliente int primary key not null,Dirección char(30) not null,Tel int not null,Correo char(30) null,CP char(20) null)select * from Detalle_Cliente

×