Relational database design
The design of a relational database is usually managed in several stages. The first stage is to identify the relational schema for the tables.
To clarify the process, consider the design of a small database of personally owned books. Here is a reasonable schema:
Authors(
id
, lastName, firstName, yob)
Books(title, edition, hardcover, publisher, pubYear,
isbn
, numPages)
Publishers(
id
, name, city, country, url)
Most of the fields specified here are text type (String
, in Java). The Authors.yob
(for year of birth), Books.pubYear
, and Books.numPages
fields should be integer type. The primary keys are Authors.id
, Books.isbn
, and Publishers.id
. A publisher's ID would be a short string, such as A-W for Addison-Wesley, or Wiley ...
Get Java Data Analysis now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.