0

I have an assignment where I have to design a logical model.

I have a relation NURSE that has "nurse_id" and "certification". The certification attribute has yes/no values, so, should I move it to another relation, or is it okay to keep it in the same NURSE relation?

And is the suitable data type for that attribute (CHAR)?

Thank you,

3 Answers 3

1

As usual, it depends. Given your description, it seems already decided that certificate is a boolean type and if that's correct there is no reason to create a new relation.

However, in a real-world situation, there are probably more attributes involved. I can imagine something like:

NURSES:
    nurse_id primary key
    ...

CERTIFICATES:
    certificate_id primary key
    ...

NURSE_CERTIFICATES:
    nurse_id primary key
    certificate_id primary key
    date_of_approval 
2

For a logical database design you don’t need to specify TINYINT or CHAR — that’s a physical consideration. Some DBMSes such as Postgres have a BOOLEAN data-type which would be preferred, but again, a physical design.

In your logical model you could assume a binary-valued datatype with Yes and No as the two values (or a ternary-valued type if NULL should also be allowed).

You have two questions actually; for the other, yes, I would keep the flag in the same relation.

2
  • could you clarify "assume a binary data type"? does that mean I should create a new relation? I don't have a deep knowledge in this topic, I am just trying to solve an assignment. Thanks :)
    – Myaccount
    Commented Apr 27, 2019 at 6:57
  • 2
    A binary data type is a type that can assume two values - for example True or False, T or F, 1 or 0 - you get the picture. What database server are you planning on using? If you're going with an Open Source one, I would recommend PostgreSQL over MySQL - it's superior in virtually every respect!
    – Vérace
    Commented Apr 27, 2019 at 15:08
-1

You can take a column "flagcertificate" TINYINT(1) datatype.

Additionally you can create a new Table named nurse_certificates to store certification information.

By adding new table you will be able to store one to one or one to many certification details for one nurse id.

3
  • there are no additional details. Just to store if the nurse is certified or not. thanks for your reply.
    – Myaccount
    Commented Apr 27, 2019 at 6:10
  • So, you can add new column for certification as suggested above. Commented Apr 27, 2019 at 6:16
  • TINYINT is a physical design, not logical, and would be sub-optimal on a DBMS with say a BOOLEAN datatype. Commented Apr 27, 2019 at 6:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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