Effective use of ORDER BY Clause with examples | SQL Interview Question
DML Script:
Problem 1:
DROP TABLE IF EXISTS Results
CREATE TABLE Results
(
[ID] INT,
[Status] varchar(100)
)
INSERT INTO Results
VALUES
(1,'Pass'),
(2,'Pass'),
(3,'Pass'),
(4,'Fail'),
(5,'Fail'),
(6,'Fail')
Problem 2:
DROP TABLE IF EXISTS Place
CREATE TABLE Place
(
[city] varchar(100)
)
INSERT INTO Place
VALUES
('Delhi'), --1
('Mumbai'), --3
('Chennai'), --2
('Kolkata'),--4
('Hyderabad'),
('Pune'),
('Chandigarh'),
('Bangalore'),
('Agra'),
('Patna')
Detailed Explanation:
Comments
Post a Comment