*Note: someone else answered the question but queried for the average. I need the median NOT...

60.1K

Verified Solution

Question

Programming

*Note: someone else answered the question but queried for theaverage. I need the median NOT the average.Thanks.

Hi, please help me create the following SQLquery:

Create Table A with 1 column and 10 rows. The rows are filledwith numbers : 1,2,3,4,5,6,7,8,9,10.

Create Table B with 1 column and 9 rows. The rows are filledwith numbers: 1,2,3,4,5,6,7,8,9.

Write a single query that returns the median value of the 10rows of TableA.

The same query should also work for Table B and return themedian value of the 9 rows in Table B.

Expected Answers:

Median for Table A: 5.5

Median for Table B: 5

It would be really helpful if you could include screenshots.Thanks!

Answer & Explanation Solved by verified expert
4.2 Ratings (690 Votes)
create table Anumbers Integer insert into Anumbers values1 insert into Anumbers values2 insert into Anumbers values3 insert into Anumbers values4 insert into Anumbers values5 insert into Anumbers values6 insert into    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students