0
Good night,
I’m trying to solve a problem which is this::
Tables:
editoras (cod int primary key, nome varchar (50));
autores (cod int primary key, nome varchar (50));
livros (isbn char (13), titulo varchar (50), ano_publicacao int,
qtd_estoque int, valor decimal (10,2), id_editora int);
id_editora referencia Editoras
livros_autores (isbn char (13), id_autor int)
isbn referencia Livros
id_autor referencia Autores
The question asks me to obtain the name(s) (s) of the author(s) who published the cheapest book. Hence, I put the following
select nome from Autores
Inner Join Livros_autores as La
On La.id_autor= Autores.cod
Inner Join Livros as Liv
On La.isbn = Liv.isbn
where valor = (select min(valor) from Livros)
But the name column is not shown :( What do you think is wrong?
The value is not shown because it does not appear in the select field list.
– anonimo
The Join should not be by isbn?
inner join livros_autores on livros.isbn = livros_autores.isbn
? these fields ai of your query do not seem to exist domo the @anonimo mentioned– Ricardo Pontual
I ended up missing the question, I exchanged id for Cod, because in my query it said id was a reserved word (it was highlighted). I modified the Inner and still nothing appears.
– Madson Rocha