SQL query analysis

 

Write a SQL query to find the gaps, and also another one to find the number of gaps in the column.

Write a query to find the gaps. For example

Save your time - order a paper!

Get your paper written from scratch within the tight deadline. Our service is a reliable solution to all your troubles. Place an order on any task and we will take care of it. You won’t have to worry about the quality and deadlines

Order Paper Now

gaps values
1 463000
2 45000
4 998000
6 147000
7 410000
8 346000
9 896000
10 370000
11 870000
12 123000
13 627000
16 901000
17 476000
18 12000
19 909000
21 610000

In the first column there are gaps between these pairs (4,6), (13,16), (19,21),

Write a SQL query to find the gaps.

 

PT 2:

In this example, given, gaps values
1 463000
2 45000
4 998000
6 147000
7 410000
8 346000
9 896000
10 370000
11 870000
12 123000
13 627000
16 901000
17 476000
18 12000
19 909000
21 610000

(4,6) counts as 1 gap

(13,16) counts as 1 gap

(19,21) counts as 1 gap

Between 1 and 21 there are 3 gaps.

You are being asked to write a query to find the number of gaps between 1 and 1000.

 

 

 

 

 

The post SQL query analysis first appeared on COMPLIANT PAPERS.