Create a view named 'bill_details' to select all the details of the bills which has completed payment with no fine amount.Note:1. Do not change the name of the view2. Include all the columns present in the bill table. But include only the bills which has completed payment with no fine_amount.3. Specify condition on is_payed and fine_amount column of bill table. If is_payed is 1 then it indicates the bills are paid. And if fine_amount is null then it indicates the bill paid with no fine_amount.4. Submit only the CREATE VIEW query.Instructions:1. Create the view successfully2. Once the view is created, check the correctness of the virtual table by displaying all the records in it.3. DO NOT submit the select query. Submit only the CREATE VIEW query.Sample Output:Created view will contain the following same data:
Question
Create a view named 'bill_details' to select all the details of the bills which has completed payment with no fine amount.Note:1. Do not change the name of the view2. Include all the columns present in the bill table. But include only the bills which has completed payment with no fine_amount.3. Specify condition on is_payed and fine_amount column of bill table. If is_payed is 1 then it indicates the bills are paid. And if fine_amount is null then it indicates the bill paid with no fine_amount.4. Submit only the CREATE VIEW query.Instructions:1. Create the view successfully2. Once the view is created, check the correctness of the virtual table by displaying all the records in it.3. DO NOT submit the select query. Submit only the CREATE VIEW query.Sample Output:Created view will contain the following same data:
Solution
The language of the text is SQL (Structured Query Language). Here is the CREATE VIEW query based on the instructions:
CREATE VIEW bill_details AS
SELECT *
FROM bill
WHERE is_payed = 1 AND fine_amount IS NULL;
This query creates a view named 'bill_details' that includes all columns from the 'bill' table, but only for records where 'is_payed' is 1 (indicating the bill has been paid) and 'fine_amount' is NULL (indicating there was no fine amount).
Similar Questions
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.
Create a view named "all_payable_amount" to select the meter_number from meter table and its corresponding payable_amount from the bill table.Note:1. Do not change the name of the view2. Include only 2 columns, meter_number from meter table and its corresponding payable_amount from the bill table.3. Use Joins. Tables involved are meter and bill4. Submit only the CREATE VIEW query.Instructions:1. Create the view successfully2. Once the view is created, check the correctness of the virtual table by displaying all the records in it.3. DO NOT submit the select query. Submit only the CREATE VIEW query.Sample Output:Created view will contain the following same data:
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.
Write a query to display the details of the 'bill' whose payment is not completed. Display the records in ascending order based on due_date.Note:1. Display all the columns present in the bill table.2. Specify the condition and retrieve the correct rows in the result. (condition need to be specified on is_payed column. If is_payed is 0, then the payment is not completed.)3. You can compare your executed result with the sample output given below.4. Order by is mandatorySample output: [Only few records are shown here]
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:
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.