Ejercio 2
create database BIBLIOTECA
g
use BIBLIOTECA
create table LIBROS
( nserie int not null,
nomlibro nchar (30) not null,
editorial nchar (20) not null )
create table USUARIOS
( ncontrol int not null,
nomalumno nchar (30) not null,
grupo nchar (10) not null )
alter table LIBROS
add autor nchar (15) not null
alter table LIBROS
alter column autor
nchar(30)
Ejercicio 3
create database LA_PASADITA
go
use LA_PASADITA
create table LISTA_PRODUCTOS
(productos nchar (20)not null,
precio int not null,
cantidad int not null)
create table CREDITO
(nom_cliente nchar (30)not null,
cant_fiada int not null,
fecha_pedido nchar (20) not null,
fecha_pagar nchar (20) not null)
create table PAGOS
(nom_cliente nchar (30)not null,
cant_pagada int not null,
fecha_pago nchar(10)not null)
insert into LISTA_PRODUCTOS (productos,
values ('galletas', 21.00, 5)
insert into LISTA_PRODUCTOS (productos,
values ('aceite', 29.00, 35)
insert into LISTA_PRODUCTOS (productos,
values ('sabritas', 18.00, 5)
insert into LISTA_PRODUCTOS (productos,
values ('refrecos', 28.00, 50)
insert into LISTA_PRODUCTOS (productos,
values ('leche', 13.00, 30)
insert into LISTA_PRODUCTOS (productos,
values ('yogurt', 8.00, 20)
insert into LISTA_PRODUCTOS (productos,
values ('dulces', 5.00, 70)
insert into LISTA_PRODUCTOS (productos,
precio, cantidad)
precio, cantidad)
precio, cantidad)
precio, cantidad)
precio, cantidad)
precio, cantidad)
precio, cantidad)
precio, cantidad)
precio, cantidad)
precio, cantidad)
insert into
values
insert into
values
insert into
values
insert into
values
insert into
values
insert into
values
insert into
values
insert into
values
insert into
values
insert into
values
insert
values
insert
values
insert
values
insert
values
insert
values
Ejercicio 4
create database HOSPITALES
go
use HOSPITALES
create table hospital
(codigo int not null,
nombre nchar(30) not null,
direccion nchar(40) not null,
telefono int not null,
cant_camas int not null)
create table sala
(codigo int not null,
nombre nchar (30) not null,
cant_camas int not null)
create table medico
(cedula int not null,
nombre nchar (30)not null,
especialidad nchar (15)not null)
create table laboratorio
(codigo int not null,
nombre nchar (15)not null,
direccion nchar (40)not null,
Practica 5
create database universidad
go
use universidad
create table PROFESOR
(
dni nchar (20) not null,
nombre nchar (35) not null,
edad int not null,
rango nchar (30) not null,
especie_inves nchar (30) not null
)
create table PROYECTO
(
numproy int not null,
nompatro nchar (35) not null,
fechini nchar (20) not null,
fechafin nchar (20) not null,
insert
values
insert
values
insert
values
PRACTICA 6
create database BIBLIOTECA
go
use BIBLIOTECA
create table LIBROS
( nserie int not null,
nomlibro nchar (30) not null,
editorial nchar (20) not null )
create table USUARIOS
( ncontrol int not null,
nomalumno nchar (30) not null,
grupo nchar (10) not null )
alter table LIBROS
nchar(30)