Knowee
Questions
Features
Study Tools

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:

Question

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:

...expand
🧐 Not the exact question you are looking for?Go ask a question

Solution

Based on your instructions, it seems like you are asking for a SQL query. Here is a step-by-step guide on how to write this query:

  1. Start by writing the basic structure of a SQL query, which is SELECT followed by what you want to select, and then FROM followed by the table you want to select from. In this case, you want to count the number of bills with a fine amount, from the bill table. So you would start with SELECT COUNT(*) FROM bill.

  2. Next, you need to add a condition to only count the bills where the fine_amount is greater than 0. You can do this using a WHERE clause. So now your query looks like this: SELECT COUNT(*) FROM bill WHERE fine_amount > 0.

  3. Finally, you want to give this count an alias name of 'count_of_bills_with_fine'. You can do this using the AS keyword. So your final query would look like this: SELECT COUNT(*) AS count_of_bills_with_fine FROM bill WHERE fine_amount > 0.

This query will return the number of bills in the bill table where the fine_amount is greater than 0, and it will display this count under the alias name 'count_of_bills_with_fine'.

This problem has been solved

Similar Questions

Write a query to display the number of bills in which the bill payment is completed. Give an alias name as 'count_of_bills_with_payment'.Note:1. Display only the number of bills where payment is completed.(If payment is completed then is_payed will be 1, otherwise 0.)2. Specify the alias name without any mistake.3. Specify condition on is_payed column from bill table.4. Compare your executed result with the sample output given below.Sample output:

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:

Write a query to display the count of bills which has completed payment without fine on the month of October 2017. Give an alias name as 'bills_paid_withoutfine'.Note:1. Display only the count of bills which has completed payment without fine on the month of October 2017 from bill table.2. Specify the alias name without any mistake.3. Specify condition on payment_date and fine_amount. payment_date must be NOT NULL and it must be October 2017 and fine_amount must be NULL.4. Compare your executed result with the sample output given below.Sample output:

Write a query to display the number of  the buildings who has given the fine amount.Give an alias name as 'building_count'.Note:1. Display only the number of buildings from the building table who has given the fine_amount. Use subqueries to achieve this.2. Tables involved are building, meter and bill.3. Specify the alias name without any mistake.4. Compare your executed result with the sample output given below.Note:1. Display only the number of  the buildings who has given the fine amount from bill table.2. Specify the alias name without any mistake.3. Compare your executed result with the sample output given below.

Write a query to display the minimum fine_amount present in the bill table. Give an alias name to the minimum fine_amount as 'min_fine_amount'.Note:1. Display only the minimum 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:

1/3

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.