State populations

InterviewQs

State populations

SQL Database Querying Window Function

Forward this email to a friend or colleague and challenge them to solve it.

Suppose you come across a table containing 3 fields:

  • country name (country_name)
  • state name (state_name)
  • total population (total_population) #total population for a given state

Using this information, write a function in SQL that returns the following:

  • state_name | total_population | percent_of_country_population

Note the last field, percent_of_country_population, can be calculated by dividing each individual state's population by the total population of its associated country in the table.


 

Congratulations! You’ve accumulated 157 questions since joining our email list. Create a premium account to access detailed solutions to each problem (including this one) + our new Case studies.


Was this email forwarded to you? You can join our list here to receive questions

How did you like today's question?

15411 Boischatel, Montreal, QC, H9H1Y7, Canada
Don't want to get these emails anymore? We'll forgive you if you unsubscribe

Older messages

Candy production increase

Friday, July 2, 2021

Data Analysis, Python, Pandas, Statistics, T-test, External Dataset, InterviewQs Candy production increase Data Analysis Python Pandas Statistics T-test External Dataset Forward this email to a friend

Probability of selecting a wardrobe

Wednesday, June 30, 2021

Statistics, Probability Theory, Rule of Product, InterviewQs Probability of selecting a wardrobe Statistics Probability Theory Rule of Product Forward this email to a friend or colleague and challenge

Identifying prime numbers with Python

Monday, June 28, 2021

Python, Algorithms, InterviewQs Identifying prime numbers with Python Python Algorithms Forward this email to a friend or colleague and challenge them to solve it. A prime number (or a prime) is a

Occupation Query

Friday, June 25, 2021

SQL, Database Querying, InterviewQs Occupation Query SQL Database Querying Forward this email to a friend or colleague and challenge them to solve it. You're given a table called "

Filtering student information with Pandas

Wednesday, June 23, 2021

Data Analysis, Python, Pandas, Data Manipulation, Filtering, InterviewQs Filtering student information with Pandas Data Analysis Python Pandas Data Manipulation Filtering Forward this email to a friend

[Python Dependency Pitfalls] "Re-inventing the wheel" disease

Saturday, July 24, 2021

Hey there, PyPI, the Python packaging repository, now contains more than 100000 third-party packages in total. That's an *overwhelming* number of packages to choose from... And this feeling of

The Plastic World of RealSelf

Saturday, July 24, 2021

Cyberbits #10: “The TripAdvisor of Boob Jobs” ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

The Framework Laptop is now shipping — BirdNet – Identify Birds by Sound — and AWS's Egregious Egress

Friday, July 23, 2021

Issue #473 — Top 20 stories of July 24, 2021 Issue #473 — July 24, 2021 You receive this email because you are subscribed to Hacker News Digest. You can open it in the browser if you prefer. 1 The

Daily Crunch - Bitcoin 'is a big part of our future,' says Twitter CEO Jack Dorsey

Friday, July 23, 2021

TechCrunch Newsletter TechCrunch logo The Daily Crunch logo Friday, July 23, 2021 • By Alex Wilhelm Hello and welcome to Daily Crunch for July 23, 2021. It's been an interesting week for the crypto

Software Testing Weekly - Issue 81

Friday, July 23, 2021

Do you ask the right questions? View on the Web Archives ISSUE 81 July 23rd 2021 COMMENT Welcome to the 81st issue! Here's one thing I'd like to highlight this week. It's a meaningful post

The Dial-Up Volunteer Army 💾

Friday, July 23, 2021

How AOL was built on a an army of unpaid volunteers. Here's a version for your browser. Hunting for the end of the long tail • July 23, 2021 Today in Tedium: In some ways, social media started with

JSK Daily for Jul 23, 2021

Friday, July 23, 2021

JSK Daily for Jul 23, 2021 View this email in your browser A community curated daily e-mail of JavaScript news Snapshot Testing for Frontends There are many types of software testing. Among these, one

iOS Dev Weekly - Issue 517

Friday, July 23, 2021

Focusing on positivity and balance. ⚖️ View on the Web Archives ISSUE 517 July 23rd 2021 Comment I'm determined to write something more positive today! I've been far too negative recently, so

Can Ethereum Be Ultra-Sound Money? - DeFriday #10

Friday, July 23, 2021

Or is it all ultra-hopium? ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

You probably don't need Redux: Use React Context + useReducer hook

Friday, July 23, 2021

Keep up-to-date with the latest programming news Codementor Your Weekly Digest TOP POSTS FROM THIS WEEK Nikhil Kumaran S You probably don't need Redux: Use React Context + useReducer hook I would