SQL - Ayudaaaaaa para realizar estos ejercicios

 
Vista:
Imágen de perfil de otrebogad
Val: 4
Ha disminuido su posición en 6 puestos en SQL (en relación al último mes)
Gráfica de SQL

Ayudaaaaaa para realizar estos ejercicios

Publicado por otrebogad (3 intervenciones) el 04/05/2018 23:34:43
estimados, alguien sabe hacer estos ejercicios?
se los agradecería mucho

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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
create table Libro
(Idlibro 	char(4) 	not nulL,
 titulo	    char(30) 	not null,
 Editorial	char(30) 	not null,
 Area		char(30) 	not null,
 primary key (Idlibro) )
 
create table Estudiante
(Idlector 	char(4)		not nulL,
 CI			char(12) 	not null,
 Nombre		char(30)	not null,
 Direccion	char(30)	not null,
 Carrera	char(30)	,
 edad integer 	not null,
 primary key (Idlector) )
 
 
create table Prestamo
(Idlector 	char(4) 	not nulL,
 IdLibro    char(4) 	not null,
 FechaPrestamo	date	not null,
 FechaDevolucion	date	not null,
 Devuelto		integer 	not null,
 Foreign Key   (IdLector) references Estudiante,
 Foreign Key   (IdLibro) references Libro,
 Primary Key   (FechaPrestamo) )
 
create table Autor
(IdAutor 		char(4)		not nulL,
 Nombre			char(30)	not null,
 Nacionalidad	char(30)	not null,
 primary key (IdAutor) )
 
 create table LibAut
(IdAutor 		char(4)		not nulL,
 IdLibro		char(4)		not null,
 Foreign Key   (IdAutor) references Autor,
 Foreign Key   (IdLibro) references Libro,)
 
 
--Insertar dos registros en cada tabla
--Insertar en la tabla Libro
Insert into Libro values('L001','El juguete rabioso','Alfaguara','Lenguaje' );
Insert into Libro values('L002','Matematicas 1� Basica','Santillana','Matematicas' )
Insert into Libro values('L003','Algebra 1�','Santillana','Matematicas' )
 
--select * from libro
 
--Insertar en la tabla Estudiante
Insert into Estudiante values('E001','12.787.002-9','Rodrigo Cisternas','Talca','Pedagogia en Educacion B�sica',21 );
Insert into Estudiante values('E002','13.787.322-k','Lorena D�az','Curico','Tecnico en Parvulo',23 );
Insert into Estudiante values('E003','12.837.222-k','Karina Lopez','Curico','Informatica',23 );
Insert into Estudiante values('E004','11.227.292-1','Karina Lopez','Curico','Administracion',22 );
 
--select * from Estudiante
 
 
--Insertar en la tabla Autor
Insert into Autor values('A001','Roberto Arlt','Argentina' );
Insert into Autor values('A002','Jes�s de Polanco','Chileno' );
 
 
--select * from Autor
 
--Insertar en la tabla LibAut
Insert into LibAut values('A001','L001');
Insert into LibAut values('A002','L002');
Insert into LibAut values('A002','L003');
 
--select * from LibAut
 
--Insertar en la tabla Prestamo
Insert into Prestamo values('E001','L001','01/01/2018','01-05-2018',1 );
Insert into Prestamo values('E002','L001','01/10/2018','15/01/2018',0);
Insert into Prestamo values('E003','L001','01/10/2018','15/01/2018',1);
Insert into Prestamo values('E004','L002','01/11/2018','15/01/2018',0);
Insert into Prestamo values('E004','L001','01/11/2018','15/01/2018',0);


16.- AGREGAR LOS SIGUIENTES DATOS EN LA TABLA ESTUDIANTE

IDLECTOR ='E010'
CI= '11.700.002-2'
NOMBRE= 'FELIPE ORELLANA'
DIRECCION='LINARES'
EDAD='25'

IDLECTOR ='E012'
CI= '21.790.292-2'
NOMBRE= 'NATALIA MORALES'
DIRECCION='LINARES'


17. ELIMINAR EL PRESTAMO DEL LECTOR E001 CON EL LIBRO L001


18. MODIFICAR LOS DATOS DE LA NACIONALIDAD DEL
AUTOR 'JESUS POLANCO' POR NACIONALIDAD 'USA'


19. AGREGUE DOS AUTORES A LA TABLA AUTOR Y LIBRO Y A LA CORRESPONDIENTE RELAION LIBAUT


20. MUESTRE LA EDITORIAL DEL AUTOR ROBERTO ARLT

21. LISTAR LOS NOMBRES DE LOS ESTUDIANTES QUE DEVOLVIERON LIBROS

22. LISTAR EL NOMBRE DEL AUTORES CUYOS LIBROS SON DEL AREA 'MATEMATICAS'
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
Imágen de perfil de Isaias
Val: 2.542
Oro
Ha mantenido su posición en SQL (en relación al último mes)
Gráfica de SQL

Ayudaaaaaa para realizar estos ejercicios

Publicado por Isaias (1921 intervenciones) el 04/05/2018 23:52:57
¿Que avance lleva?, ¿En que motor de base de datos?
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar