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.Note:1. Display connection name ,from_unit, to_unit and rate from slab and electricity_connection_type table.2. Use Joins3. Tables involved slab and electricity_connection_type.4. Order by is mandatory.5. Compare your executed result with the sample output given below.Sample output:
Question
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.Note:1. Display connection name ,from_unit, to_unit and rate from slab and electricity_connection_type table.2. Use Joins3. Tables involved slab and electricity_connection_type.4. Order by is mandatory.5. Compare your executed result with the sample output given below.Sample output:
Solution
It seems like you want to write a SQL query. Here's how you can do it:
SELECT
e.connection_name,
s.from_unit,
s.to_unit,
s.rate
FROM
slab AS s
JOIN
electricity_connection_type AS e
ON
s.connection_type_id = e.id
ORDER BY
e.connection_name ASC;
This query does the following:
- Selects the
connection_namefrom theelectricity_connection_typetable andfrom_unit,to_unit, andratefrom theslabtable. - Joins the
slabtable with theelectricity_connection_typetable based on theconnection_type_id. - Orders the result in ascending order by
connection_name.
Please replace the column names and table names with the actual ones in your database.
Similar Questions
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 rate from the slab table whose meter_number is 'SG567423'. If there are multiple records display in ascending order based on rate.Note:1. Display only the rate from the slab whose meter number is 'SG567423' from electricity_connection_type table.2. Tables involved are slab, electricity_connection_type, building_type, building and meter3. Order by is mandatory4. Compare your executed result with the sample output given below.
Write a query to display the meter number,owner name,address,contact number,building type name and connection name of all buildings.Display the records in ascending order based on building type name.Note:1. Display only the below 6 columns, i. meter number ii. owner name iii. address iv. contact number v. building type name vi. Connection name 2. Use Joins3. Tables involved building, meter, building_type, electricity_connection_type4. Order by is mandatory.5. Compare your executed result with the sample output given below.
Write a query to display the entire contents of the 'electricity_connection_type'. Display the records in ascending order based on their connection name.
Write a query to display the entire contents of the 'slab' details.Display the records in ascending order based on their 'from_unit'.
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.