Q
Problem solve Get help with specific problems with your technologies, process and projects.

# Database design for Web page search function

I need help with the design of my database! I'm gonna use it for my Web page as a search function, and it shall include the following:

• Membership Number = Denmark-girl-1 ("Country"-"Sex"-"Member no.")
• Membership Status = Yes/No
• Membership Date = 17 May 2001
• Sex = Female/Male
• Sexual Orientation = Hetrosexual / Bisexual
• Age = ???
• Nickname = ???
• Firstname = ???
• Lastname = ???
• City = ???
• Postal Code = ???
• Country = ???
• Phone Number = ???
• Cellphone = ???
• Profile = Fresh girl from Copenhagen....
• Bodyfigure = Slim / Normal / Robust / Butter / Overweight / Handicapped
• Height = ??? cm.
• Weight = ??? Kg.
• Hip = ? cm.
• Waist = ? cm.
• Bosom = ? cm.
• Eyecolor = Blue / Green / Brown / Black / Other
• Shoe Size = 34-50
• Haircolor = White / Red / Brown / Black / Other
• Pubic hair = Yes / No
• Piercings = Yes / No (In Ear / In Nose / In Lip )
• Tatoos = Yes /No
• Smoking = Yes / No
• Updated = 17 May 2001
• <

Your basic design should be pretty simple. You can go from something completely application driven where all of the logic is built into every program/routine that will access this data, to something that is almost completely data driven. I'd recommend using the data driven approach, since it makes it much easier to maintain your data later.

Your membership number is what is called a compound column. This is where a single logical column in your database is composed of more than one logical part. While it is perfectly all right to display data this way, storing it this way is an accident waiting to happen! If you make three separate columns to hold the data, then combine them for the purpose of display, it will avoid lots of potential problems.

The bodyfigure, eyecolor, and haircolor columns are cases where I would strongly recommend a foreign key. I'd create a lookup table of bodyfigures, then add a foreign key relationship into your main table, and do the same with eyecolors and haircolors.

The piercings column looks like a combination of a Boolean (yes/no) with a list type. This would lead to some really tough problems in the code, but there is a relatively clean way out if you construct the list carefully. I'd build the list like:

```PieceId Description
0 None
1 Ear
2 Nose
3 Ear and Nose
4 Lip
5 Ear and Lip
6 Nose and Lip
7 Ear, Nose, and Lip```

The trick here is that the id values are basically a bitmap. If you think of them as binary numbers, there are three columns (1, 2, and 4). A binary one in a column means that the appropriate body part has been pierced.

The sex and orientation columns are a judgment call. You could create a constraint for the column, limiting it to one of the two values you've specified, but based on some of your examples this could be limiting for no good reason. You might want to add additional sex options (transgendered or surgically altered for examples), and different orientations (sorry, you'll have better luck thinking of alternatives here than I would, but I'm sure there are plenty). I'd use a foreign key and a lookup table for these columns too.

As a side note, I'd strongly suggest that you add an identity column too. It is MUCH easier and more efficient to write code using a single id for a member than trying to manage multi-part keys!

I noticed that you posted this question in the discussion forum too. Feel free to post further questions there (I'd love the feedback)!

#### Have a question for an expert?

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

#### Start the conversation

Send me notifications when other members comment.

## SearchDataManagement

• ### AWS Lake Formation goes GA, as cloud data lake market grows

First released in late 2018, AWS Lake Formation is now generally available and it could be the force that helps to accelerate ...

• ### Apollo data graph brings managed federation to enterprises

The new Apollo update is intended to enable organizations to federate multiple enterprise data sets more easily and use APIs to ...

• ### Data management roles: Data architect vs. data engineer, others

Veteran data professional Michael Bowers differentiates between key data management positions, including their salaries and which...

• ### The Salesforce acquisition of Tableau complements Einstein Analytics

Given the different strengths of Salesforce's Einstein Analytics platform and Tableau, the BI tools could prove complementary now...

• ### Domo management expansion signals strategic shift

Five months after it stated it would be pursuing strategic partnerships, Domo appears to be making a move toward implementing ...

• ### Reveal moves Infragistics BI platform into embedded analytics

With the release of Reveal, an embedded business intelligence platform, longtime software vendor Infragistics is expanding its ...

## SearchSAP

• ### S/4HANA migration concerns lead SAP 2019 stories so far

Industry observers believe that if SAP is to remain competitive, S/4HANA migrations need to pick up, and new leadership needs to ...

• ### How SAP C/4HANA could transform the CRM market

Find out how C/4HANA is not only changing the CX game, but also transforming the relationship with CRM by combining front-office ...

• ### S/4HANA migration needs strong project management

Vinci Energies Group shows that an SAP S/4HANA migration is a difficult project that requires strong management, but the new ...

## SearchSQLServer

• ### SQL Server database design best practices and tips for DBAs

Good database design is a must to meet processing needs in SQL Server systems. In a webinar, consultant Koen Verbeeck offered ...

• ### SQL Server in Azure database choices and what they offer users

SQL Server databases can be moved to the Azure cloud in several different ways. Here's what you'll get from each of the options ...

• ### Using a LEFT OUTER JOIN vs. RIGHT OUTER JOIN in SQL

In this book excerpt, you'll learn LEFT OUTER JOIN vs. RIGHT OUTER JOIN techniques and find various examples for creating SQL ...

## TheServerSide.com

• ### How to install the JDK on Windows and set up JAVA_HOME

You have options when it comes to JDK installations on Windows and Linux. Here are some helpful tips to ensure a proper install ...

• ### Follow these best practices on how to write clean code in Java

Follow these three best practices to write clean Java code and help make your application development simple and painless for all...

• ### What's the future of WebSphere Portal as HCL acquires IBM products?

WebSphere users can breathe easy after its acquisition by HCL was finalized in July 2019. The platform will receive heavy ...

## SearchDataCenter

• ### How to get out of a bad colocation contract

Renegotiation, legal action and cancellation are all options if your colocation service agreement isn't up to par. But each ...

• ### 5 steps to include on your software update checklist

Training, testing and automation are all essential components to software updates. Implementing these concepts makes version ...

• ### Cray exascale computer to modernize aging nuclear weapon stockpile

The U.S. is buying an exascale system from Cray Inc., its third from the company which is now being acquired by HPE. The \$600 ...

## SearchContentManagement

• ### Upgrades to Nintex Forms simplifies electronic form creation

The new form designer by Nintex brings user-friendly capabilities to Nintex Forms for both electronic form creation and data ...

• ### 4 tips for migrating ECM to the cloud

Outdated ECM systems use a lot of resources, and neglect can render them almost useless. By migrating to the cloud, businesses ...

• ### 8 steps to building a website taxonomy

Building a website taxonomy can help make website content better categorized and more easily searchable by users. Here are eight ...

## SearchHRSoftware

• ### HR must contend with enterprise social network challenges

Enterprise social networks like Slack and Yammer are gaining steam as alternatives to traditional email, but they can raise some ...

• ### Workplace environment and productivity link grows, so should HR's role

HR is urged to play a role in facilities management as research underscores the link between workplace conditions such as air ...

• ### Google age discrimination lawsuit may force HR changes

Discrimination lawsuits can seek broad changes to HR operations, as was the case for Google. That settlement could be a template ...

Close