Modelling gender in a SQL Server database

by noonand14. August 2012 09:51

For a project that I'm currently involved in I needed to model gender in a database column. In times past I'd probably just have used a CHAR(1) and constrained it to 'M' or 'F' but that's no longer appropriate given that now the column could be required to store (off the top of my head) male, female, neuter, partially transgendered, gender reassigned male to female, gender reassigned female to male or unknown to name but a few.

As is often the case the work already exists as a standard – in this case courtesy of the NHS and their PERSON GENDER CODE classification. As a useful aside note that there are two types of gender: gender at registration (I would surmise shortly after birth?) and current gender.

This seems to closely echo the ISO 5218 standard. In one place on the site the paper is located behind a paywall and in another place it's freely downloadable.

Lastly, here's a discussion on comp.databases.theory on the same thing.

Tags:

SQL Server | database theory

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

Tag cloud