title: SQL query to generate the following output
body: <p>Display user id, user name, total amount, amount to be paid after discount and give alias name as User_ID, user_name, Total_amount, Paid_amount. Display record in descending order by user id. Click on <a href="https://i.stack.imgur.com/y3Epu.jpg" rel="nofollow noreferrer">TABLE SHCEMA</a> to get the table</p>
  
  <p>This is the code I've written. But this is not showing the expected result:</p>
  
  <pre><code>SELECT 
      USERS.USER_ID AS User_ID,
      NAME AS user_name,
      (FARE * NO_SEATS) AS Total_amount 
  FROM 
      USERS 
  INNER JOIN 
      TICKETS ON USERS.USER_ID = TICKETS.USER_ID 
  INNER JOIN 
      PAYMENTS ON TICKETS.TICKET_ID = PAYMENTS.TICKET_ID 
  INNER JOIN 
      DISCOUNTS ON PAYMENTS.DISCOUNT_ID = DISCOUNTS.DISCOUNT_ID 
  GROUP BY 
      USERS.USER_ID, NAME, FARE, NO_SEATS
  ORDER BY 
      USERS.USER_ID DESC;
  </code></pre>
  
  <p>This is the expected output:</p>
  
  <pre><code>USER_ID USER_NAME   TOTAL_AMOUNT   PAID_AMOUNT
  ----------------------------------------------
   5       Krena           700         625
   4       Johan           800         775
   3       Ivan           3000        2900
   1       John           4000        3950
   1       John           4000        3950
   1       John           2000        1900
  </code></pre>