Easy Query [message #656539] |
Mon, 10 October 2016 17:04 |
|
calamardo114
Messages: 4 Registered: October 2016
|
Junior Member |
|
|
Anyone would like to help me with this query?
It will be very much appreciated!!!
Assume you have two tables in an Oracle database, one named BOOK and one named AUTHOR. There is a column in BOOK named author_id that references the AUTHOR table. The idea here is that a single author may have written multiple books. Write an SQL query that produces a result similar to this:
Author Name Total number of books written
Charles Dickens 23
Dr. Seuss 51
Norman Mailer 20
Harper Lee 1
Jane Doe 0
|
|
|
|
|
|
|
|
|
|
Re: Easy Query [message #656555 is a reply to message #656543] |
Tue, 11 October 2016 03:41 |
cookiemonster
Messages: 13925 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
calamardo114 wrote on Tue, 11 October 2016 00:44If there aren't any book entries by an author in the books table, then a NULL result would come up.
No it wont, count can never return null. There is an obvious value to return if count can't find anything to count after all.
|
|
|