Item without price, or duplicate price

AUTO

New member
Local time
Today, 10:53
Joined
Jul 29, 2013
Messages
2
hi everyone,

i have a table called Books, in that table there is 4 columns ChapterName, Auther, ITEM, Price.
each book has a item number, and each book has a few records with the same data, just the first column is diffrent where its the ChapterName, each book has a price, but only once, meaning in the first record of each book it will be a price in the column price

now i want a Query where i can get which book dont have a price at all, and which book has more than once a price, how can i do that?
i am breaking my head all day with it, and i cant come up with anything.
 
The problem is the one table should be two tables (actually more). You need a table for books to define the things that describe a book and a second table to describe the chapters of a book. So things that occur only once belong in book. Technically, author should be a separate child table since many books have co-authors and author itself should have its own table to describe the author. So, given what you have specified, my schema would be.

Once you fix the schema, only the first part of the query will have meaning since it won't be possible for a book to have multiple prices.

tblAuthors:
AuthorID (autonumber, primary key)
FirstName
LastName
DOB
etc.
tblBooks:
BookID (autonumber, primary key)
Title
PublishDate
PublisherID (foreign key to tblPublishers)
Price
etc.
tblChapters:
ChapterID (autonumber primary key)
BookID (foreign key to tblBooks
ChapterName
etc.
tblBookAuthors:
BookID (foreign key to tblBooks)
AuthorID (foreign key to tblAuthors)
tblPublishers:
PublisherID (autonumber, primary key)
PublisherName
etc.
 

Users who are viewing this thread

Back
Top Bottom