Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Negociosj
--Sql Server 2014 Express Edition --Batches are separated by 'go' --select @@version as 'sql server version' craete table Paises( id_Paises char(3) not null identity, nombrePais varchar (40) not null, primary key (id_Paises), ); create table Categorias ( id_categoria int not null identity, nombreCategoria varchar(40) null, descripcion text null, primary key (id_categoria) not null ); create table Cliente ( id-cliente char(5) not null identity, nombreCliente varchar(40) not null, dirCliente varchar(80) not null, foreign key(id_Pais) not null, fonoCliente varchar(15) null ); create table Proveedor( id_Proveedor int not null identity, nombreProveedor varchar(80) not null, dirProveedor varchar(100) not null, nomContacto varchar(80) not null, cargoContacto varchar(50) not null, foreign key (id_Pais) not null, fonoProveedor varchar(15) not null, faxProveedor varchar(15) not null ); create table Productos( id_Producto int not null identity, nomProducto varchar(80) not null, foreign key(id_Categoria)not null, contxUnidad varchar(50) not null, precioUnidad decimal(10,2) not null, uniEnExistencia smallint not null, uniEnPedido smallint not null, ); create table Cargos( id_Cargo int not null identity, desCargo varchar(30) not null, ); create table Distritos( id_Distrito int not null identity nomDistrito varchar(50) not null ); create table Empleado( id_Empleado int not null identity, nomEmpleado varchar(50) not null, apeEmpleado varchar(50) not null, fecNaci datetime not null, dirEmpleado varchar(100) not null, foreign key (idDistrito), fonoEmplado varchar(15) null foreign key (id_Cargo) not null, fecContrato datetime not null, fotoEmplado image null );
run
|
edit
|
history
|
help
0
Lab 4
repert
#Temp table Collation fixed
forming date as nvarchar
ss sqlpractice2014
SQL injection
Return a single column that matches a parameter
BRYAN_BD1
BRYAN_BD
table variables (temporary tables)