0% found this document useful (0 votes)
20 views1 page

SQL Table for City Distances

The document describes creating a table called src_dest_distance to store source, destination, and distance data. It inserts 6 rows into the table with source and destination city pairs and their distances. It then selects all data from the newly created and populated table.

Uploaded by

gdb5cfskgv
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views1 page

SQL Table for City Distances

The document describes creating a table called src_dest_distance to store source, destination, and distance data. It inserts 6 rows into the table with source and destination city pairs and their distances. It then selects all data from the newly created and populated table.

Uploaded by

gdb5cfskgv
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

--- Q4 : Convert the given input to expected output ---

drop table src_dest_distance;


create table src_dest_distance
(
source varchar(20),
destination varchar(20),
distance int
);
insert into src_dest_distance values ('Bangalore', 'Hyderbad', 400);
insert into src_dest_distance values ('Hyderbad', 'Bangalore', 400);
insert into src_dest_distance values ('Mumbai', 'Delhi', 400);
insert into src_dest_distance values ('Delhi', 'Mumbai', 400);
insert into src_dest_distance values ('Chennai', 'Pune', 400);
insert into src_dest_distance values ('Pune', 'Chennai', 400);

select * from src_dest_distance;

You might also like