Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Mnelson
Starting Member
1 Post |
Posted - 2012-04-12 : 11:41:12
|
Hello, Im using db2 and am very new to it. Im trying to execute these queries but im having 0 luck. Im new to SQL and have never really worked with Aggregates.Here is my Library Table SchemaCardholderborrowerid b_name b_addr b_statusReservesborrowerid isbn r_dateStatusb_status loan_limitBookisbn author title pub_name pub_date c_priceCopyaccession_no isbn p_price Borrowsborrowerid accession_no l_dateHeres what Im trying to do:1) Find the cardholder (b_name, b_addr) who has borrowed the oldest book in the library.2) Did people of 'junior' status borrow more books than people of 'senior' status? In general, which of the various statuses has cardhodlers who have borrowed the most books? Answer this question by finding how many books the people of each status actually borrowed.3) For each cardholder (b_name, b_addr) find the average current price of all the books (not copies) they have either borrowed or reserved. I just dont even know where to start with these types of queries. Any help would be appreciated! |
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2012-04-12 : 12:33:21
|
http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=%2Fcom.ibm.db2.udb.admin.doc%2Fdoc%2Fc0000757.htm |
|
|
|
|
|