Está en la página 1de 4

a.

- Listar datos de los autores: select * from autor;

b.- Listar nombre y edad de los estudiantes: select nombre, edad from estudiante;

c.- Estudiantes que pertenecen a la carrera de civil: select nombre from estudiante where carrera='Civil';

d.- Listar nombres de los estudiantes cuyo apellido empiece con la letra "B": select nombre from estudiante where
nombre like 'B%';

e.- Mostrar el autor del libro Dracula: select nombre from autor where idautor in (select idautor from prestamo where
idlibro in (select idlibro from libro where titulo='Dracula'));

f.- Listar autores ingleses y españoles: select nombre from autor where nacionalidad='Español' or
ncionalidad='Estadounidense';

g.- Listar los libros que no son de terror: select titulo from libro where area not in ('Terror');

h.- Libros prestados a Gomez Ernesto: select titulo from libro where idlibro in (select idlibro from prestamo where
idlector in (select idlector from estudiante where nombre='Gómez Ernesto));

i.- Estudiantes menores de 22 años: select nombre from estudiante where edad<22;

j.- Estudiantes a los que se les prestó Misery: select nombre from estudiante where idlector in (select idlector from
prestamo where idlibro in (select idlibro from libro where titulo='Misery'));

k.- Listar libros de la editorial Plaza & Janes: select titulo from libro where editorial='Plaza & Janes';

l.- Listar libros que pertenecen a Stephen King: select titulo from libro where idlibro in (select idlibro from libaut where
idautor in (select idautor from autor where nombre='Stephen King'));

m.- Libros que debian devolverse en 2017-12-04: select titulo from libro where idlibro in (select idlibro from prestamo
where fechadevolucion='2017-12-04');

n.- Estudiantes que no devolvieron libros: select nombre from esudiante where idlector in (select idlector from
prestamo where devuelto='No');

o.- Libros que se prestaron entre 2017-08-01 y 2017-09-30: select titulo from libro where idlibro in (select idlibro from
prestamo where (fechaprestamo between '2017-08-01' and '2017-09-30'));

p.- Insertar regitro: insert into etudiante values ('E3011', 'Gonzales Joaquina', 'Sauces Num. 811', 'Electrónica', 22);

q.- Cambiar de devuelto a no en prestamo con E3003 y L1012: update prestamo set devuelto='No' where
idlector='E3003' and idlibro='L1012';

También podría gustarte