Write a query to display the sum of payable_amount and fine_amount of all the bills from bill table. Give an alias name to the sum of payable amount and fine amount as 'sum_payable_and_fine_amount'.Note:1. Display only the sum of payable_amount and fine_amount from bill table.2. Specify the alias name without any mistake.3. Compare your executed result with the sample output given below.Sample output:
Question
Write a query to display the sum of payable_amount and fine_amount of all the bills from bill table. Give an alias name to the sum of payable amount and fine amount as 'sum_payable_and_fine_amount'.Note:1. Display only the sum of payable_amount and fine_amount from bill table.2. Specify the alias name without any mistake.3. Compare your executed result with the sample output given below.Sample output:
Solution
Here is the SQL query you need to write to get the sum of payable_amount and fine_amount from the bill table:
SELECT SUM(payable_amount + fine_amount) AS sum_payable_and_fine_amount
FROM bill;
This query will add together the payable_amount and fine_amount for each row in the bill table, and then sum all of these results together. The result is given the alias 'sum_payable_and_fine_amount'.
Similar Questions
Write a query to display the sum of payable_amount of all the bills from bill table.Give an alias name to the sum of payable amount as 'sum_payable_amount'.Note:1. Display the sum of payable_amount from bill.2. Specify the alias name without any mistake.3. Compare your executed result with the sample output given below.Sample output: SubmitSaveExecutePrevious Submission
QueryQ6Write a query to display the sum of payable_amount and fine_amount of all the bills from bill table. Give an alias name to the sum of payable amount and fine amount as 'sum_payable_and_fine_amount'.
Write a query to display the number of bills having fine_amount. Give an alias name as 'count_of_bills_with_fine'.Note:1. Display only the number of bills having the fine_amount from bill table. (If fine_amount is greater than 0 then it indicates that bill got fine_amount.)2. Specify the alias name without any mistake.3. Specify condition on fine_amount column of bill table.3. Compare your executed result with the sample output given below.Sample output:
Write a query to display the sum of payable_amount with due_date '2017-10-01' from bill table. Give an alias name to the sum of payable amount as 'sum_payable_amount'.Note:1. Display only the sum of payable_amount with the given due_date from bill table.2. Specify the alias name without any mistake.3. Specify the condition and retrieve the correct rows in the result(condition need to be specified on due_date).4. Compare your executed result with the sample output given below.Sample output:
Write a query to display the sum of amount from the travel_payment table. Give an alias name as total_payment.Note:1. Display only the sum of amount from the travel_payment table.2. Specify the alias name without any mistake.3. Compare your executed result with the sample output given below.
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.