0

I am first timer with ms access and also here

I am working on a database of library. I have two different tables which stores details one for books and others for Periodicals.

How can make accession number primary key for both tables.

Are autonumber a accession number when a new entry made in books are periodicals.

2
  • I have two different tables which stores details one for books and others for Periodicals. Different names do not mean different entities. It must be one table. – Akina Apr 14 '19 at 19:08
  • Do you want a single primary key across the 2 tables? I don't think Access can do this by default, and I'd recommend against working around that. – Greg Apr 14 '19 at 23:28
0

The two options would be:

  1. Model them in the same table with a property to distinguish their type (such fields are often called a discriminator) and all the properties of both types.
  2. Model them with a third table holding their common properties (and usually a discriminator also) and one child table per type. This pattern is referred to as table inheritance.

The latter option would be preferable, but I'm not sure how one would implement it in Access (I've not used that in a decade and a half).

1
  • Thanks a alot let me try it – Taqi Apr 16 '19 at 14:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.