How to use select in a table that is not related?

Asked

Viewed 77 times

-3

inserir a descrição da imagem aqui

I need to build an SQL query that lists the amount payable for each km, quantity of km used and the total amount payable by each lease

It is an exercise of SELECT and Inner/left Join but do not know how to relate LEASE with TABLE.

Thank you!

  • 1

    But the table is related. LOCACAO > VEICULO > TABELA_VEICULO > TABELA. Just understand how each one relates and do your JOINS.

1 answer

-1

I’ll try to help you with what I understand from your question. In database we have the concept of primary key and foreign key, primary key is a unique identifier of a record of a table. The foreign key is a reference to the primary key of another table. Having a basic notion of this you can relate different tables through primary keys and foreign keys. And to help with the part of Internet joins I will leave the link of w3schools https://www.w3schools.com/sql/sql_join_inner.asp

Browser other questions tagged

You are not signed in. Login or sign up in order to post.