Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If I would implement this I would save phone numbers, zip codes etc. as regular strings. In particular the data should be stored in the format the end user needs it. (Assuming every end user has the same needs.) E.g. having a German adress: "Roadname 123", U.S. Adress? "123 Roadname". Doing the same for zip codes, combine them with the City name. You could save the addresses as address_line_1 (street name, house number in country specific order the user enters), address_line_2 (postal code, city name ...).</p> <p>If you still need to search your database for specific postal codes you might write a regular expression or even a function for that. Considering City names you could wipe them out of address_line_2 and with high probability you end up having the postal code.</p> <p>I think writing validations for each country must be tremendous work, that's 200 countries... How can you be sure that you didn't miss some local conventions? You could write a function eq that for instance evaluates eq("ABCDE-34", "ABCDE.34") == true.</p> <p>Though I don't really see the point in writing Client side <em>and</em> Server side validations. Even if the client is a web browser, you might use the server's validations via AJAX.</p> <p>In the end it depends on the DBMS you are using (support for Java stored procedures?), your client side language... Also how the data is entered (is it entered very inaccurately? in a Web browser?) and what you want to do with it. (Are you planning to feed Skype with phone numbers from your database or are these read by humans who type them in their phone?) Do you need to do some specific join operations? And of course it depends how many man-hours you are able to spend with solving that problem...</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload