Question: SQL Programming This is the question I am working on. Display the number of years that each country has been independent in ascending order of

SQL Programming

This is the question I am working on. Display the number of years that each country has been independent in ascending order of years of independence. Display the difference between today's year (use Year and curdate functions to retrieve current year. DO NOT USE 2017) and the independence year.

Here is the Output from my Instructor:

SQL Programming This is the question I am working on. Display the

And here is my Output

number of years that each country has been independent in ascending order

My question is, why is the 'yearIndep' column returning a null value? Here is the code I have written.

SELECT Name,Continent,IndepYear,

DATEDIFF(YEAR(CURDATE()), - IndepYear) AS 'yearIndep' FROM country

ORDER BY IndepYear DESC, yearIndep ASC;

IndepYear yearsindep -1 Name Nigeria Germany Europe India Continent Africa 1960 1955 1947 1822 1776 660 1523 57 62 70 195 241 Asia South America razi United States North America Japan China Asia 2677 Asia 3540

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!