Script base de datos

423 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
423
On SlideShare
0
From Embeds
0
Number of Embeds
14
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Script base de datos

  1. 1. usemastergocreatedatabase yulyonprimary(name=yuly_data,filename=C:datayuly_data.mdf,size=4mb,maxsize=10mb,filegrowth=1mb)logon (name=yuly_log,filename=C:datayuly_data.ldf,size=2mb,maxsize=10mb,filegrowth=1mb)gouse yulygocreatetable Proveedores(Id_Proveedor intprimarykeynotnull,Nom_Proveedor char(20)notnull,Fabricante char(20)notnull,Dirección char(30)notnull,Zona char(20)notnull)select*from Proveedorescreatetable Articulos(Id_Articulo intprimarykeynotnull,Nom_Art char(20)notnull,Tipo char(20)notnull,Fabricante char(20)notnull,Id_Proveedor intnotnull,Contenido smallintnotnull,Precio Moneynotnull,)select*from Articulos
  2. 2. createtable Inventario(Id_Articulo intprimarykeynotnull,No_Almacen intnotnull,Nom_Art char(20)notnull,Id_Proveedor intnotnull,Precio Moneynotnull,Existencia intnotnull)select*from Inventariocreatetable Ventas(Id_Factura intprimarykeynotnull,Id_Cliente intnotnull,Id_Articulo intnotnull,Id_Empleado intnotnull,Fecha datenotnull)select*from Ventascreatetable Detalle_Venta(Id_Factura intprimarykeynotnull,Nom_Art char(20)notnull,Tipo char(20)notnull,Importe_Uni smallintnotnull,Piezas intnotnull,Total intnotnull)select*from Detalle_Ventacreatetable Empleados(Id_Empleado intprimarykeynotnull,Nombre char(20)notnull,Apellidos char(30)null)select*from Empleadoscreatetable Detalle_Emp(Id_Empleado intprimarykeynotnull,Edad smallintnull,Puesto char(30)notnull,Antiguedad smallintnotnull,Dirección char(30)notnull,Tel smallintnotnull,CP char(10)null)select*from Detalle_Emp
  3. 3. createtable Clientes(Id_Cliente intprimarykeynotnull,Nom_Cliente char(20)notnull,Apellidos char(30)null)select*from Clientescreatetable Detalle_Cliente(Id_Cliente intprimarykeynotnull,Dirección char(30)notnull,Tel intnotnull,Correo char(30)null,CP char(20)null)select*from Detalle_Cliente

×