Received: from news.tht.net (news.hub.org [216.126.91.242]) by hub.org (8.9.3/8.9.3) with ESMTP id NAA09930 for ; Fri, 17 Dec 1999 13:20:33 -0500 (EST) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.9.3/8.9.3) id NAA99087 for pgsql-sql@postgresql.org; Fri, 17 Dec 1999 13:10:03 -0500 (EST) (envelope-from news) X-Authentication-Warning: news.tht.net: news set sender to using -f From: kaf@ip146.usw5.rb1.bel.nwlink.com (Kyle) X-Newsgroups: comp.databases.postgresql.sql Subject: simple sql select help Date: 17 Dec 1999 10:03:56 -0800 Organization: A poorly-installed InterNetNews site Lines: 24 Sender: Kyle Farrell Message-ID: <83dtuc$1nh$1@ip146.usw5.rb1.bel.nwlink.com> Summary: select help X-Trace: 17 Dec 1999 10:02:24 -0800, ip146.usw5.rb1.bel.nwlink.com To: pgsql-sql@postgresql.org I'm fairly new to sql & postgres. I need some help with this query on a database I'm constructing. I've got two tables, publishers & books, which have the following columns (some columns removed for simplicity): publishers: name (primary key), address, ... books: title, publisher, ... Given the above I'd like to query the database to see how many books each publisher has. The publisher column of the books table should be declared a foreign key to publishers.name, though I haven't put the appropriate triggers in yet. Like I said, I've not much database experience. Humor me here, how do I find the number of books each publisher has? Thanks, Kyle kaf@_nwlink_._com_ remove underscores to reply