Q
Q
Qeinzo2021-10-13 11:11:01
Database design
Qeinzo, 2021-10-13 11:11:01

What is the data type of the drop down list?

There is a connection between "Employees-Departments". There are several fields in the "Add employee" form:

Full name - Text data type
Phone - Text data type
Position - Text data type
Email - Text data type
Department (dropdown list) - Which data type?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
rPman, 2021-10-13
@Qeinzo

Historically, and for reasons of storage efficiency, a dropdown list is implemented with a '1 to many' relationship, a numeric field is set up in the target table, and a relationship (freign key index) is created with the Department lookup table, where the identifier is of the same type.
Nothing prevents the key field from making any other type, for example, a string (I saw the date as a key once, it looks wild, but if it doesn’t violate the logic, then why not), if it’s convenient to use, but most often they make a positive integer

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question