Advanced SQL Challenge: Using Constraints

365 Days of Daily Coding: Day 46

Today was learning even more about the havoc created by the wallstreet bets redditors. I think I have learned a lot from the past 3 days of scouring the forums and the articles than I have learnt from my finance degree. I see that few redditors commenting on the trading volumes of the GME shares being unrealsitic while the institutional investors hold more than 150% of the total shares by GME corp. I learnt about the concept of naked shares aka counterfeit shares that hedge fund use to manipulate the market. In this case, hedge funds use these fake shares to artifically bring down the share price.

Some say that the short squeeze hasn’t even started i.e when the hedge funds buy shares to cover their positions. Even if the prices sky rockets to 1000%, I wonder what happens to the counterfeit shares in the market, in this case obviously owned by the retail investors. It’s not like they can simply bankrupt the company and sweep everything under. May be that’s what they have been doing…

There’s a lot of uncertainity going around with regards to whether the hedge funds have closed their positions. It would be an interesting data project: to see the total number of outstanding shares and the total volumes of shares traded.

Another point of curiosity is what the other major institutional investors positions are. Are they also on hold position waiting for the price to reach the moon?

Today, I only solved one challenge. It was rather a theoritical question where I was asked about the type of constraints that I would apply for a table.

CREATE TABLE #EmployeePayRecord
(
EmployeeID INTEGER
FiscalYear INTEGER,
StartDate  DATE,
EndDate    DATE,
PayRate    MONEY
);

My answer:

1) EmployeeID is not null
2) Start date is lesser than end date
3) Fiscal Year is less than today's year

There’s also answer provided in the site which had obviously more constraints shared.

Leave a comment