Skip to content
Advertisement

SQL : Choose three stock tickers which have complete data between 2012 and 2017 in the Quandl Wiki data set

I have a custom_calendar table like this:

[1] https://imgur.com/YLUix5y “custom calendar image”

And I have a stocks market table ( v_eod_quotes_2012_2017 ) which looks like this:

[2] https://imgur.com/a/Ff7Gkw1 “v_eod_quotes_2012_2017”

As I mention in the question, I need to find out which three stock market symbols has complete data i.e data for every day in between 2012 and 2017.

I have the below query which I’m unsure of, because it is only returning me one row which is wrong. I wanted to first correct this query and get some data so that I can choose three ticker symbols. can anybody please help me correcting this query.

Output expected is more number of rows while I’m getting just one row for this query.

[3] https://imgur.com/a/Td7EeHd ” result”

Any help would be appreciated. Thanks

Advertisement

Answer

I’m not quite sure why you are getting even one row. Your problem is that there is no connection between the quotes and the custom_calendar, so you are not counting the range between the two dates.

I think this does what you want:

The ratio is not helpful, because it should always be 1.

EDIT:

If the above generates zero rows, it is because no rows match. Instead, get the most traded stocks using:

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement