Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7764473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:55:14+00:00 2026-06-01T14:55:14+00:00

I am going over a past paper for a database course I am taking

  • 0

I am going over a past paper for a database course I am taking and I am stuck on an SQL question

Here is the schema provided

  • Country(name, capital, area), name is the key

  • People(country, population, children, adult) where country refers to the
    name in Country, population is the total population, and children and adult
    is the percentage of the children and adult population.

  • Language(country,language,percentage) – for each language spoken in the
    country, it lists the percentage of the population that speaks the language.

Here is the question:

Write the following query in SQL: Find languages that are only spoken in countries whose total population exceeds 10^7.

This is what I have so far:

SELECT l.language
FROM people p, language l
WHERE l.country = p.country AND
    p.population > 10^7

The bit I am confused about is how to check that there are no other countries which a language is spoken in but the population is less than 10^7.

Any advice?
Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T14:55:15+00:00Added an answer on June 1, 2026 at 2:55 pm

    Get all languages. From that set remove all languages spoken in countries with population <= 10^7. The reminder should be languages only spoken on countries with population > 10^7.

    select language from languages
    where language not in (
        select language from languages l
        join people p on l.country = p.country
        where p.population <= 10^7)
    

    This works on the basis that your design has the restriction that every language must be spoken in at least one country 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm going over the jquery widget here: http://blog.davidpadbury.com/2010/10/11/bdd-testing-of-jquery-plugins-using-jasmine/ The plugin is called like so:
I am going over C and have a question regarding const usage with pointers.
I was just going over the asio chat server example . My question is
Been going over my predecessor's code and see usage of the request scope frequently.
I've been going over and over this in my head, and I can't seem
I am going over/studying the facebook code that was leaked in 2007, I notice
So we start Scrum today and start going over story points estimates. The first
I've moved to a new project team and while going over the codebase, found
as we know, the loop X instruction is going over X until ECX =
I'm going back over an old project where I added preprocessor functionality to Essence'

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.