irenavassilia
Guppy
Hi I have three tables in my database:
table1 - Library
Columns and current data for table Library:
ISBN BookName PageCount Borrowed Rating CopyrightDate
014042430X Complete Writings 650 Y 5 11/27/1999
032121353X Visual Quickstart Gu 1239 Y 1 01/01/1999
080712320X Running A Thousand M 830 N 1 02/23/2000
1111111111 JavaBooks
130082167 Cost Accounting 539 N 3 10/23/2000
130082171 Management Accountin 388 N 1 12/06/2000
131430211 Financial Reporting 232 N 3 08/04/2005
131475912 Accounting Informati 1810 N 3 08/20/2002
131475916 Accounting Informati 2047 N 5 12/18/2002
131495380 Cost Accounting 2521 N 4 08/15/2003
table2 - Authors
Columns and data for Authors table:
First Name Last Name ISBN
Weinman Braun 032121353X
Weinman Braun 321199553
Hopkins Paige
Blazek Paige 471412856
Carson Yarbrough 9999999999
Walker Yarbrough
Robinson Yarbrough 870495275
table3 - Publishers
Columns and data for Publishers table:
PubID PublisherName Rating ISBN
1 Ace Books 1 032121353X
2 Academic P 3 321199553
3 Addison-We 4 9999999999
50 2
51 Sheridan 2222222222
52 Sheridan 1111111111
As you can see all three table hold an ISBN number which is the number we can refer to. However ISBN number in table Authors and table Publishers are not mandatory so we can have nulls.
I need to construct a query that will display everything from table Library, Publishers and Authors so basically I need to join them together.
Is it possible to have a query that will output the following from all three tables:
ISBN number Book Name Pages Borrowed Rate Date FirstName LastName Publisher
032121353X Visual Quickstart Gu 1239 Y 1 01/01/1999 Weinman Braun Ace Books
1111111111 JavaBooks null null null null null null Sheridan
321199553 null null null 3 null Weinman Braun Academic P
9999999999 null null null 4 null Carson Yarbrough Addison-We
014042430X Complete Writings 650 Y 5 11/27/1999 null null null
032121353X Visual Quickstart Gu 1239 Y 1 01/01/1999 null null null
080712320X Running A Thousand M 830 N 1 02/23/2000 null null null
130082167 Cost Accounting 539 N 3 10/23/2000 null null null
130082171 Management Accountin 388 N 1 12/06/2000 null null null
131430211 Financial Reporting 232 N 3 08/04/2005 null null null
131475912 Accounting Informati 1810 N 3 08/20/2002 null null null
131475916 Accounting Informati 2047 N 5 12/18/2002 null null null
131495380 Cost Accounting 2521 N 4 08/15/2003 null null null
222222222 null null null null null null null Sheridan
111111111 null null null null null null null Sheridan
471412856 null null null null null Hopkins Paige null
9999999999 null null null null null Carson Yarbrough null
870495275 null null null null null Robinson Yarbrough null
null null null null null null Blazek Paige null
null null null null null null Walker Yarbrough null
So print everything from Library, Publishers, Authors where ISBN are equaled.
Then check Publishers and Authors for ISBN's that are equeled.
Then print out everything else from Library, Authors and Publshers.
I've been trying to many different queries and nothing is giving me this output. Is it even possible?
Please help me out, it would be greatly appreciated.
Thank you.
Regards,
Irena.
table1 - Library
Columns and current data for table Library:
ISBN BookName PageCount Borrowed Rating CopyrightDate
014042430X Complete Writings 650 Y 5 11/27/1999
032121353X Visual Quickstart Gu 1239 Y 1 01/01/1999
080712320X Running A Thousand M 830 N 1 02/23/2000
1111111111 JavaBooks
130082167 Cost Accounting 539 N 3 10/23/2000
130082171 Management Accountin 388 N 1 12/06/2000
131430211 Financial Reporting 232 N 3 08/04/2005
131475912 Accounting Informati 1810 N 3 08/20/2002
131475916 Accounting Informati 2047 N 5 12/18/2002
131495380 Cost Accounting 2521 N 4 08/15/2003
table2 - Authors
Columns and data for Authors table:
First Name Last Name ISBN
Weinman Braun 032121353X
Weinman Braun 321199553
Hopkins Paige
Blazek Paige 471412856
Carson Yarbrough 9999999999
Walker Yarbrough
Robinson Yarbrough 870495275
table3 - Publishers
Columns and data for Publishers table:
PubID PublisherName Rating ISBN
1 Ace Books 1 032121353X
2 Academic P 3 321199553
3 Addison-We 4 9999999999
50 2
51 Sheridan 2222222222
52 Sheridan 1111111111
As you can see all three table hold an ISBN number which is the number we can refer to. However ISBN number in table Authors and table Publishers are not mandatory so we can have nulls.
I need to construct a query that will display everything from table Library, Publishers and Authors so basically I need to join them together.
Is it possible to have a query that will output the following from all three tables:
ISBN number Book Name Pages Borrowed Rate Date FirstName LastName Publisher
032121353X Visual Quickstart Gu 1239 Y 1 01/01/1999 Weinman Braun Ace Books
1111111111 JavaBooks null null null null null null Sheridan
321199553 null null null 3 null Weinman Braun Academic P
9999999999 null null null 4 null Carson Yarbrough Addison-We
014042430X Complete Writings 650 Y 5 11/27/1999 null null null
032121353X Visual Quickstart Gu 1239 Y 1 01/01/1999 null null null
080712320X Running A Thousand M 830 N 1 02/23/2000 null null null
130082167 Cost Accounting 539 N 3 10/23/2000 null null null
130082171 Management Accountin 388 N 1 12/06/2000 null null null
131430211 Financial Reporting 232 N 3 08/04/2005 null null null
131475912 Accounting Informati 1810 N 3 08/20/2002 null null null
131475916 Accounting Informati 2047 N 5 12/18/2002 null null null
131495380 Cost Accounting 2521 N 4 08/15/2003 null null null
222222222 null null null null null null null Sheridan
111111111 null null null null null null null Sheridan
471412856 null null null null null Hopkins Paige null
9999999999 null null null null null Carson Yarbrough null
870495275 null null null null null Robinson Yarbrough null
null null null null null null Blazek Paige null
null null null null null null Walker Yarbrough null
So print everything from Library, Publishers, Authors where ISBN are equaled.
Then check Publishers and Authors for ISBN's that are equeled.
Then print out everything else from Library, Authors and Publshers.
I've been trying to many different queries and nothing is giving me this output. Is it even possible?
Please help me out, it would be greatly appreciated.
Thank you.
Regards,
Irena.