Write a query to display the 'rate' of slab whose from_unit is 2001 and to_unit is 4500.
Question
Write a query to display the 'rate' of slab whose from_unit is 2001 and to_unit is 4500.
Solution
Assuming you are using SQL, here is a step-by-step guide on how to write the query:
-
Start by specifying the action you want to perform. In this case, you want to select data, so you start your query with the
SELECT
keyword. -
Specify the column you want to display. In this case, you want to display the 'rate', so you add
rate
after theSELECT
keyword. -
Specify the table where the data is stored. You do this with the
FROM
keyword. In this case, let's assume the table is called 'slab', so you addFROM slab
afterSELECT rate
. -
Specify the conditions for the data you want to select. You do this with the
WHERE
keyword. In this case, you want the 'from_unit' to be 2001 and the 'to_unit' to be 4500, so you addWHERE from_unit = 2001 AND to_unit = 4500
afterFROM slab
.
So, your final query should look like this:
SELECT rate
FROM slab
WHERE from_unit = 2001 AND to_unit = 4500;
This query will display the 'rate' of the slab whose 'from_unit' is 2001 and 'to_unit' is 4500.
Similar Questions
Write a query to display the entire contents of the 'slab' details.Display the records in ascending order based on their 'from_unit'.
Write a query to display the connection name ,from_unit and to_unit and rate of all the slabs.Display the records in ascending order based on connection_name.
Write a query to display the total_units and payable_amount of the particular meter number 'SG934826
Write a query to display the number of electricity_reading in which the total_units per day is greater than 500. Give an alias name as 'count_total_units_500'.
A unit rate is a rate in which the first quantity / second quantity in the comparison is one unit. (choose the correct option)
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.