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

  • Home
  • SEARCH
  • 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 7748517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:48:20+00:00 2026-06-01T10:48:20+00:00

I am running into some difficulty with the following query. SELECT maker, speed FROM

  • 0

I am running into some difficulty with the following query.

SELECT maker, speed 
FROM  
(
    SELECT * 
    FROM product 
    NATURAL JOIN laptop
) 
WHERE hd > 30;

I am trying to find the maker and speed of laptops with hard drives greater than 30 gigabytes.

I have two relations laptops and products. Laptops has the tuples (maker, model, type) and laptop has the tuples (model, speed, ram, hd, screen, and price).

What I think I am doing.

  • Joining product with laptop with natural join, which I think and does
    (when submitted by itself) give me a relation of laptop but with two
    more columns maker and type.
  • I then am trying to just select maker and speed from that table where
    the size of the hd is greater than 30.
  • 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-01T10:48:21+00:00Added an answer on June 1, 2026 at 10:48 am

    A subquery in the FROM clause requires a table alias:

    SELECT maker, speed 
    FROM  
    (
        SELECT * 
        FROM product 
        NATURAL JOIN laptop
      /* include an alias with AS */
    ) AS products_sub
    WHERE hd > 30;
    

    From the docs:

    A table_subquery is also known as a subquery in the FROM clause. Such subqueries must include an alias to give the subquery result a table name. A trivial example follows; see also Section 12.2.9.8, “Subqueries in the FROM Clause”.

    However for your example, the subquery isn’t needed at all.

    SELECT maker, speed 
    FROM products NATURAL JOIN laptop
    WHERE hd > 30;
    

    Note that NATURAL JOINs are not usually recommended, and it is best to be explicit about the columns joined in an ON clause.

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

Sidebar

Related Questions

I'm trying to update a table in Oracle and I'm running into some difficulty.
I have been trying to learn Erlang and have been running into some problems
Trying to truncate some code here and running into a problem: <script type=text/javascript> $(function()
I'm trying to expand on an idea from someone else's question, and running into
I'm running into the following scenario on some devices: when the use clicks on
I am trying to follow this tutorial http://damianm.com/tech/nhibernate-mvc-and-ninject/ but I am running into some
I'm running into some bugs now that I'm trying to use the doubly linked
I'm running into some problems while trying to provide legacy support to iPhone 3G
I'm running into some issues when constructing a query using LINQ and Entity Framework.
I'm running into some problems using my .NET 4.0 libraries in .NET 2.0 applications.

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.