Using "select" in sql (oracle), failed to search

Asked

Viewed 53 times

0

I have to settle the following question:

1.Consult EL NOMBRE (DESCRIPCION) DE LOS PRODUCTOS ADQUIRIDOS POR LOS CLIENTES HOOPS Y GOOD SPORT EN EL ANNO 1990.

the command used for the search was:

select p.DESCRIPTION 
from PRODUCT p, SALES_ORDER s, ITEM i, CUSTOMER c
where c.NAME = "HOOPS" 
  and s.ORDER_DATE like "%90" 
  and c.COSTUMER_ID = s.COSTUMER_ID 
  and s.ORDER_ID = i.ORDER_ID 
  and i.PRODUCT_ID = p.PRODUCT_ID;

And I got the following error: ERROR on line 1:

ORA-00904: "S"." COSTUMER_ID": unusual identifier

The diagram used has been tested and has the necessary Fks.

DIAGRAM: inserir a descrição da imagem aqui

  • SALES_ORDER does not have COSTUMER_ID column

1 answer

0


select 
    p.DESCRIPTION 
from PRODUCT p
inner join ITEM i on i.PRODUCT_ID = p.PRODUCT_ID
inner join SALES_ORDER s on s.ORDER_ID = i.ORDER_ID 
inner join CUSTOMER c on c.COSTUMER_ID = s.COSTUMER_ID
where c.NAME = "HOOPS" 
and s.ORDER_DATE like "%90";

Browser other questions tagged

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