Consultas
From Grupo1 Ahand
(Difference between revisions)
Denise cunha (Talk | contribs) |
|||
Line 18: | Line 18: | ||
From ITEM_PEDIDO <BR> | From ITEM_PEDIDO <BR> | ||
Group By liv_id <BR> | Group By liv_id <BR> | ||
+ | |||
+ | <BR> | ||
+ | |||
+ | ''' Consultar livros de seus respectivos fornecedores''' <BR><BR> | ||
+ | Select cad.cad_nome , liv.liv_titulo from CADASTRO cad , LIVRO liv <BR> | ||
+ | Where cad.cad_id In (Select cadastro_cad_id From LIVRO <BR> | ||
+ | Where cad.cad_id = cadastro_cad_id); <BR> | ||
<BR> | <BR> |
Revision as of 22:13, 15 December 2006
Consultar livro por autor
Select liv_titulo, liv_edicao, liv_paginas
From LIVRO
Where liv_autor = 'Ivor Horton'
Consultar livro por tema
Select L.liv_titulo, L.liv_edicao, L.liv_paginas
From LIVRO L, TEMA T
Where L.tem_id = T.tem_id
And T.tem_descricao like '%Java%'
Consultar quantidade de livros pedidos
Select SUM(ipe_quantidade), liv_id
From ITEM_PEDIDO
Group By liv_id
Consultar livros de seus respectivos fornecedores
Select cad.cad_nome , liv.liv_titulo from CADASTRO cad , LIVRO liv
Where cad.cad_id In (Select cadastro_cad_id From LIVRO
Where cad.cad_id = cadastro_cad_id);