Is anyone here really good at SQL?
Just need a bit of help.
I've got 3 tables
Publisher(publisher_id, name)
Book(book_id, title, date_published, price, publisher_id)
Sequel(book_id, sequel_id)
publisher_id in the Book table is a FK.
And the book_id and sequel_id are PK's and FK's to book_id in the Book table.
Anyway, I have to display details of books that had a sequel published within 12 months.
I've done this much so far...
select s.book_id, s.sequel_id, p.publisher_id
from sequel s, publisher p, book b
where s.book_id = b.book_id
and b.publisher_id = p.publisher_id
... but I don't know how to get and compare the dates...
can anyone help?
Thanks.
Just need a bit of help.
I've got 3 tables
Publisher(publisher_id, name)
Book(book_id, title, date_published, price, publisher_id)
Sequel(book_id, sequel_id)
publisher_id in the Book table is a FK.
And the book_id and sequel_id are PK's and FK's to book_id in the Book table.
Anyway, I have to display details of books that had a sequel published within 12 months.
I've done this much so far...
select s.book_id, s.sequel_id, p.publisher_id
from sequel s, publisher p, book b
where s.book_id = b.book_id
and b.publisher_id = p.publisher_id
... but I don't know how to get and compare the dates...
can anyone help?
Thanks.





