One of the SQL questions recently asked in Persistent Systems interview.
We need to Find unique combination of records in output.
To solve this, we will write a query by using least, greatest and Rownumber() functions.
Create table syntax
CREATE TABLE routes (Origin VARCHAR(50), Destination VARCHAR(50));
INSERT INTO routes VALUES ('Bangalore', 'Chennai'), ('Chennai', 'Bangalore'), ('Pune', 'Chennai'), ('Delhi', 'Pune');
For more SQL interview questions. Check out our playlist.
• SQL Interview Questions
Contact us:
info@cloudchallengers.com
Follow us on
Instagram : cloudchallengers
Facebook : cloudchallengers
LinkedIn : linkedin.com/company/cloudchallengers
14 окт 2024