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 6760605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:05:01+00:00 2026-05-26T14:05:01+00:00

I am taking a SQL database class using Oracle. There’s an assignment: Find the

  • 0

I am taking a SQL database class using Oracle. There’s an assignment:

“Find the book title, author last name, and units on hand for each book in branch number 4”

I’ve tried different ways of nesting statement but none have worked with these tables.

  • BOOK
  • AUTHOR
  • INVENTORY
  • BRANCH

That was very helpful! (do actually want to learn this rather than just complete my homework) So far I got. besides if I wanted just the answers I would have said so,…

select book.book_code, author.author_last, inventory.on_hand
from book inner join wrote on book.book_code = wrote.book_code,
author inner join wrote on author.author_num = wrote.author_num,
inventory inner join branch on inventory.branch_num = branch.branch_num
where branch.branch_num = 4; 

But now I have a bunch of repeating products

  • 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-05-26T14:05:02+00:00Added an answer on May 26, 2026 at 2:05 pm

    You don’t need to nest. You need to join.

    You’ll probably need something like this, although I would need the exact table structure to be sure. But you’ll get the general idea.

    select
      b.TITLE,
      a.LASTNAME,
      i.UNITSONHAND
    from
      BOOK b
      inner join AUTHOR a on a.AUTHORID = b.AUTHORID
      inner join INVENTORY i on i.BOOKID = b.BOOKID
      inner join BRANCH br on br.BRANCHID = b.BRANCHID
    where
      br.BRANCHID = 4
    

    Some people would argue that BRANCH should be the first table, because you’re filtering on that. You can do that if you like and if you think it makes more sense. In some circumstances, it may result in better performance, although generally the query optimizer takes care of it.

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

Sidebar

Related Questions

Using SQL 2005: Taking too much time to execute I want to filter the
I am using a ASP .NET ListView with a MS SQL Database. I use
I am using a sql database to save the data of a simple note
I'm taking the database that I created with SQL server express and putting it
I'm taking a database course this semester, and we're learning SQL. I understand most
I'm learning to program using C# and ASP.NET with a SQL Server database. I
I remember in college taking a database class where we, the students, were given
Is there a reason why Oracle is case sensitive and others like SQL Server,
We have a web application talking to a Postgres SQL database at work -
I am working on saving twitter search results into a database (SQL Server) and

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.