SQL Puzzle: Putting Hyderabad First

How can we ensure that, based on the provided dataset below, 'Hyderabad' always appears in the first row of the 'StateCapital' column, with the remaining column values sorted in ascending order.

Input Data:

Expected Output:

Data Script:

	State NVARCHAR(150) ,
	StateCapital NVARCHAR(150)

INSERT INTO StateDetails
	('AndhraPradesh', 'Amaravathi'),

SELECT  * FROM StateDetails

Please try to answer the question, if you still not able to get it click below show button to see the answer.

No comments:

Post a Comment