To
get to 2NF you must remove those non-key attributes which are dependent upon
only invoice-number, going from:
INVOICE
LINE ITEM (invoice-number, line-number, stock-number, invoice-date, ISBN,
book-title, price)
to:
INVOICE
LINE ITEM (invoice-number, line-number, stock-number,
ISBN,
book-title, price)
INVOICE (invoice-number, invoice-date)
However
if you now draw a functional dependency diagram you will notice that ISBN
and book-title are functionally dependent upon stock-number (not the primary
key) and so third normal form is violated.
To
get to 3NF you must remove those non-key attributes which are dependent upon
another non-key attribute (stock-number) to get:
INVOICE
LINE ITEM (invoice-number, line-number, stock-number,
price)
INVOICE (invoice-number, invoice-date)
STOCK (stock-number, ISBN, book-title)
You
may have decided to remove the attribute 'price' as well. This would
be perfectly reasonable if the assumption that 'books with the same
stock-number were sold at the same price' was true. If however the
same books were sold at different prices on different invoices, then the
answer shown above is correct.