


Prepara tus exámenes y mejora tus resultados gracias a la gran cantidad de recursos disponibles en Docsity
Gana puntos ayudando a otros estudiantes o consíguelos activando un Plan Premium
Esta página no es visible en la vista previa
¡No te pierdas las partes importantes!



1.- Seleccionar Nombre y apellido de las personas que viven en Londres (London) select FirstName, LastName, City from Employees where City='London'
2.- Los 3 primeros campos cuyo titulo empiecen con “S” select EmployeeID,LastName,FirstName,Title from Employees where Title like'S%'
3. Seleccionar todos los campos donde el precio unitario sea mayor a 20 select * from Products where UnitPrice>
4.- Seleccionar todos los precios unitarios comprendidos entre 29 y 30 usando between select * from Products where UnitPrice between 20 and 30
5.- Seleccionar todos los campos de la tabla Products cuyo nombre contenga la letra ‘C’ select * from Products where ProductName like '%C%'
6.- Seleccionar todas los campos donde la categoria (CategoryID) sea : 2,3 y 4 select * from Products orma descendente select * from Products
Mayor y menor precio select min(UnitPrice) as Barato, max(UnitPrice) as Caro from Products
- Cuantos libros estan disponibles en la base de datos select count(*) as nro-libros from Titles - Cuantos publicadores han publicado libros select count(id_pub) as nro-publicadores from Titles
select sum(total_ventas) from Titles where tipo=’business’
1.- Encuentre un libro “psychology” que cueste mas de $ select * from titles where type='psychology' and price>
2.-Encuentre aquellos libros que tiene un precio $10 y $ select * from titles where price between 10 and 20
3.- Encuentre las categorías de libros que el publicador 0877 publica select type, pub_id from titles where pub_id='0877'
4.- Encuente el titulo del libro que está en la categoria ‘psychology’, que cuesta mas de $20 y que tiene la palabra ‘computer’ en el titulo select title, type, price from titles where type='psychology' and price>20 and title like '%Computer%'
5. -Encuentre aquellos libros que tiene un avance superior a $5000 y han vendido menos de 4000 copias select title, title_ID, type, advance, ytd_sales from titles where advance>5000 and ytd_sales<
6.-Cuales son las categorias de libros que han vendido 4000 a 5000 copias en total. select title, title_ID, type, ytd_sales from titles where ytd_sales between 4000 and 5000
select title from titles where pub_id='0736' Anidado select title from titles where pub_id=(select pub_id from publishers where pub_name = 'New Moon Books' )
select pub_name from publishers where pub_id=(select pub_id from titles where price = ( select max(price) from titles ) )