Home » SQL & PL/SQL » SQL & PL/SQL » Help needed with Uni Assignment PLEASE!!!!
icon5.gif  Help needed with Uni Assignment PLEASE!!!! [message #264860] Tue, 04 September 2007 17:43 Go to next message
alanjohnson500
Messages: 4
Registered: September 2007
Junior Member
Hi, I have an assignment I'm currently working on but I'm a little bit stuck and was wondering if I could get a solution...

Background:

I'm setting up a library database. There are 3 tasks that need to be completed.

Task A: Creation of the database tables - all done!

Task B: Updating / Inserting / Deleting records - all done!

Task C: Creating a Report:

"A summary of the number of times each title has been borrowed by each category of user in the last year"


Basically I just need to do the report, I'm on the right track (so I've been told with what I've currently done, just can't figure it out 100%)


My code for all three tasks are included as an attachment:


What's happening is the report is showing the same number of books being borrowed for all 3 member categories (SS = School Student, SFS = Sixth Form Student, SM = Staff Member)

These are not the same, but are different....

How can I fix this?


Many Thanks
  • Attachment: forum.txt
    (Size: 4.21KB, Downloaded 473 times)

[Updated on: Tue, 04 September 2007 17:44]

Report message to a moderator

Re: Help needed with Uni Assignment PLEASE!!!! [message #264861 is a reply to message #264860] Tue, 04 September 2007 17:48 Go to previous messageGo to next message
alanjohnson500
Messages: 4
Registered: September 2007
Junior Member
EDIT - THERE IS ALSO EXISTING TEST DATA THAT MAY BE USEFUL TO OTHERS WORKING OUT WHAT'S WHAT!


I'VE ATTACHED IT - THANKS
Re: Help needed with Uni Assignment PLEASE!!!! [message #264862 is a reply to message #264860] Tue, 04 September 2007 17:49 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
When 4 tables exist in the FROM clause, you need at least three joins in the WHERE clause to avoid a cartesian product in the result set.

Please read & follow the posting guidelines as stated in the STICKY post at the top of this forum.
Re: Help needed with Uni Assignment PLEASE!!!! [message #264863 is a reply to message #264860] Tue, 04 September 2007 17:53 Go to previous messageGo to next message
alanjohnson500
Messages: 4
Registered: September 2007
Junior Member
Ooops sorry!

Oracle Version is iSQL *Plus Release 9.2.0.7.0 running on a University server (I think it's Linux)


What is a cartesian product?


Thanks for your help
Re: Help needed with Uni Assignment PLEASE!!!! [message #264864 is a reply to message #264860] Tue, 04 September 2007 17:55 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>What is a cartesian product?
What is Google and/or wikipedia?
What is your major & where are you going to school?
Re: Help needed with Uni Assignment PLEASE!!!! [message #264865 is a reply to message #264864] Tue, 04 September 2007 18:01 Go to previous messageGo to next message
alanjohnson500
Messages: 4
Registered: September 2007
Junior Member
This is half the problem, I go to university in the UK but they've really taught us nothing, the main lecturer was off most of the time so we've been pretty much left to it


Although we've been told its really simple, I think I'm there just need direction on what to do next

Re: Help needed with Uni Assignment PLEASE!!!! [message #264915 is a reply to message #264863] Wed, 05 September 2007 00:47 Go to previous message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Have a look at:
OracleŽ Database SQL Reference
Chapter 9 SQL Queries and Subqueries
Section Joins

Regards
Michel
Previous Topic: output of date format (merged)
Next Topic: combining different column names from different queries
Goto Forum:
  


Current Time: Tue Dec 03 11:45:53 CST 2024