What is the SQL Query for the given Relational Algebra?

Please inform what is wrong in this query & provide a simpler solution if possible...

 

select u.user_id,u.name as user_name,(t.fare*t.no_seats) as total_amount,(t.fare*nt.o_seats)-d.discount_amount) as paid_amount 
from users u,tickets t,payments p,discounts d where u.user_id=t.user_id and p.ticket_id=t.ticket_id and p.ticket_id=t.ticket_id;

1Comment
shivani @shivani1234
30 Aug 2017 05:11 pm

SELECT user id as user_id, user name as user_name , fare as total_amount , (fare- discount_amount) as paid_amount 
FROM USERS as u, TICKETS as t, PAYMENTS as p, DISCOUNTS as d
WHERE u.user_id=t.user_id AND p.ticket_id= t.ticket_id AND d.discount_id=p.discount_id