LinkedIn Power Creators (Part 1)
The LinkedIn Creator team is looking for power creators who use their personal profile as a company or influencer page. If someone's LinkedIn page has more followers than the company they work for, we can safely assume that person is a power creator.
Write a query to return the IDs of these LinkedIn power creators ordered by the IDs.
|1||The Data Science Podcast||8,000|
|3||The Ravit Show||6,000|
This output shows that profile IDs 1-5 are all power creators, meaning that they have more followers than their company page.
Our goal is to identify all LinkedIn profiles that have more followers than their employer's pages.
Since the data is located in two different tables, the first step will be to join them on a common field. We can see that in the table is the same field as in the table. Therefore, we can join using these fields. Note that you cannot join using the field here.
Use to merge the tables and . Note that we use aliases to make the query more concise.
The query should look like this:
Click here to learn more about different types of SQL joins such as the and . We used a regular (also known as an ) here because we only want to pull the personal profiles that have a matching company ID value.
Now that our query data is combined, it's time to compare the number of followers of each personal profile and their company's page. To accomplish this, we'll use a clause that explicitly compares follower counts from both tables, and outputs only the results where the former is greater:
By combining the two steps together, we'll achieve our final solution. Since the example output shows only the field, there is no need to include all of the columns.