dbTalk Databases Forums  

What data standards should a database designer know about?

comp.databases comp.databases


Discuss What data standards should a database designer know about? in the comp.databases forum.



Reply
 
Thread Tools Display Modes
  #21  
Old   
david
 
Posts: n/a

Default Re: What data standards should a database designer know about? - 04-08-2009 , 11:26 PM






Finance: FIX, BSB, SWIFT, CHIPS, ACH. These are all protocols or file
formats,
they imply bank ID codes like the SWIFT code There are also hundreds of
lesser
known standards like APCA with their own codes, I'd start with SWIFT and
FIX.

A database designer also has to see the protocols, because generically you
need to
capture enough data to do the transaction.

For example, you've got ISO 3 character country codes in your database, now
you
realize you need the ISO 2 character country code to do a transaction.

(david)



"--CELKO--" <jcelko212 (AT) earthlink (DOT) net> wrote

Quote:
What data standards should a database designer know about?

Some are so general they jump out at you --

ISO-8601 temproal dispaly formats.
ISO-3166 Country codes
ISO-5218 sex codes
email addresses and URLs
Various national postal codes
Various banking codes liek CUSIP and ISIN
ISBN for books
ISAN for AV media
VIN for vehicles
Passport numbers

What am I forgetting? What is a good source for them?

As an aside, a few months ago, a poster assured me that his industry
(metals) had no standards and I should shut up and not criticize him
for "cowboy coding" his own encoding schemes.

Since I could look on the bottom of my cookware and see some numbers
that deal with the kind of stainless steel used, I was pretty sure he
was wrong, so I Googled it (http://metals.about.com/od/specification1/
Metals_Specifications_and_Standards.htm)

I am trying to get a book together on such standards so that maybe the
next batch of Newbies will stop inventing their own encodings.
Suggestions welcome!



Reply With Quote
  #22  
Old   
--CELKO--
 
Posts: n/a

Default Re: What data standards should a database designer know about? - 04-10-2009 , 09:55 AM






Quote:
Finance: FIX, BSB, SWIFT, CHIPS, ACH. *These are all protocols or fileformats, they imply bank ID codes like the SWIFT code *There are also hundreds of lesser known standards like APCA with their own codes, I'd start with SWIFT and FIX.
I have SWIFT, IBAN and some of the stuff we use in the States.
Quote:
A database designer also has to see the protocols, because generically you need to capture enough data to do the transaction.
While I agree with you, the idea of the book is to present just the
encodings -- what a DB designer would need to know to write some DDL
with a CHECK() constraint.

Quote:
For example, you've got ISO 3 character country codes in your database,now you realize you need the ISO 2 character country code to do a transaction.
ISO country codes was one of the first things I got. I also got two
surprises: (1) It is more general and historical than I knew (2) it is
embedded in more other ISO standards.


Reply With Quote
  #23  
Old   
Philipp Post
 
Posts: n/a

Default Re: What data standards should a database designer know about? - 04-11-2009 , 10:17 AM



Quote:
Various national postal codes
Just found a CHECK constraint I wrote as an exercise for myself some
years ago. It validates the postal codes for 58 countries from which I
had the pattern and which would fit into a LIKE predicate:

CREATE TABLE International_Addresses
(address_id INT NOT NULL PRIMARY KEY,
-- other columns
country_code CHAR(2) NOT NULL, -- ISO 3166
postal_code VARCHAR(10) NOT NULL,
CONSTRAINT validate_postal_code
CHECK(postal_code LIKE
CASE country_code
WHEN 'AR' THEN '[0-9][0-9][0-9][0-9]'
WHEN 'AT' THEN '[0-9][0-9][0-9][0-9]'
WHEN 'BE' THEN '[0-9][0-9][0-9][0-9]'
WHEN 'BR' THEN '_________'
WHEN 'CA' THEN '[0-9][A-Z][0-9] [A-Z][0-9][A-Z]'
WHEN 'CH' THEN '[0-9][0-9][0-9][0-9]'
WHEN 'CN' THEN '[0-9][0-9][0-9][0-9][0-9][0-9]'
WHEN 'CR' THEN '[0-9][0-9][0-9][0-9]'
WHEN 'CY' THEN '[0-9][0-9][0-9][0-9]'
WHEN 'CZ' THEN '[0-9][0-9][0-9] [0-9][0-9]'
WHEN 'DE' THEN '[0-9][0-9][0-9][0-9][0-9]'
WHEN 'DK' THEN '[0-9][0-9][0-9][0-9]'
WHEN 'DZ' THEN '[0-9][0-9][0-9][0-9][0-9]'
WHEN 'ES' THEN '[0-9][0-9][0-9][0-9][0-9]'
WHEN 'FI' THEN '[0-9][0-9][0-9][0-9][0-9]'
WHEN 'FO' THEN '[0-9][0-9][0-9]'
WHEN 'FR' THEN '[0-9][0-9][0-9][0-9][0-9]'
WHEN 'GR' THEN '[0-9][0-9][0-9][0-9][0-9]'
WHEN 'HR' THEN '[0-9][0-9][0-9][0-9][0-9]'
WHEN 'HU' THEN '[0-9][0-9][0-9][0-9]'
WHEN 'ID' THEN '[0-9][0-9][0-9][0-9][0-9]'
WHEN 'IL' THEN '[0-9][0-9][0-9][0-9][0-9]'
WHEN 'IN' THEN '[0-9][0-9][0-9][0-9][0-9][0-9]'
WHEN 'IR' THEN '[0-9][0-9][0-9][0-9][0-9]'
WHEN 'IS' THEN '[0-9][0-9][0-9]'
WHEN 'IT' THEN '[0-9][0-9][0-9][0-9][0-9]'
WHEN 'JP' THEN '[0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
WHEN 'KR' THEN '[0-9][0-9][0-9]-[0-9][0-9][0-9]'
WHEN 'KW' THEN '[0-9][0-9][0-9][0-9][0-9]'
WHEN 'KZ' THEN '[0-9][0-9][0-9][0-9][0-9][0-9]'
WHEN 'LI' THEN '[0-9][0-9][0-9][0-9]'
WHEN 'LS' THEN '[0-9][0-9][0-9]'
WHEN 'LU' THEN '[0-9][0-9][0-9][0-9]'
WHEN 'MX' THEN '[0-9][0-9][0-9][0-9][0-9]'
WHEN 'MY' THEN '[0-9][0-9][0-9][0-9][0-9]'
WHEN 'NO' THEN '[0-9][0-9][0-9][0-9]'
WHEN 'NP' THEN '[0-9][0-9][0-9][0-9][0-9][0-9]'
WHEN 'NZ' THEN '[0-9][0-9][0-9][0-9]'
WHEN 'PH' THEN '[0-9][0-9][0-9][0-9]'
WHEN 'PL' THEN '[0-9][0-9]-[0-9][0-9][0-9]'
WHEN 'PT' THEN '[0-9][0-9][0-9][0-9]'
WHEN 'RO' THEN '[0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
WHEN 'RU' THEN '[0-9][0-9][0-9][0-9][0-9][0-9]'
WHEN 'SA' THEN '[0-9][0-9][0-9][0-9][0-9]'
WHEN 'SE' THEN '[0-9][0-9][0-9] [0-9][0-9]'
WHEN 'SG' THEN '[0-9][0-9][0-9][0-9][0-9][0-9]'
WHEN 'SI' THEN '[0-9][0-9][0-9][0-9]'
WHEN 'SK' THEN '[0-9][0-9][0-9] [0-9][0-9]'
WHEN 'TH' THEN '[0-9][0-9][0-9][0-9][0-9]'
WHEN 'TN' THEN '[0-9][0-9][0-9][0-9]'
WHEN 'TR' THEN '[0-9][0-9][0-9][0-9][0-9]'
WHEN 'TW' THEN '[0-9][0-9][0-9]'
WHEN 'UA' THEN '[0-9][0-9][0-9][0-9][0-9]'
WHEN 'US' THEN '[0-9][0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]'
WHEN 'VE' THEN '[0-9][0-9][0-9][0-9]'
WHEN 'VN' THEN '[0-9][0-9][0-9][0-9][0-9]'
WHEN 'YU' THEN '[0-9][0-9][0-9][0-9][0-9]'
WHEN 'ZA' THEN '[0-9][0-9][0-9][0-9]'
ELSE '%' END)
);

brgds

Philipp Post


Reply With Quote
  #24  
Old   
--CELKO--
 
Posts: n/a

Default Re: What data standards should a database designer know about? - 04-12-2009 , 01:50 PM



Thanks! I will add it and give you credit. Not exactly fame and
glory but good for beer if you catch me at a conference.

Reply With Quote
  #25  
Old   
Ronnie
 
Posts: n/a

Default Re: What data standards should a database designer know about? - 04-12-2009 , 03:52 PM



"Philipp Post" <Post.Philipp (AT) googlemail (DOT) com> wrote

Quote:
Various national postal codes

snip
WHEN 'CA' THEN '[0-9][A-Z][0-9] [A-Z][0-9][A-Z]'
snip

Philipp Post
Assuming the clause refers to Canada, it should be
WHEN 'CA' THEN '[A-Z][0-9][A-Z] [0-9][A-Z][0-9]'

For example 'T2P 1X1'.

Ronnie




Reply With Quote
  #26  
Old   
Gene Wirchenko
 
Posts: n/a

Default Re: What data standards should a database designer know about? - 04-13-2009 , 11:38 AM



Philipp Post <Post.Philipp (AT) googlemail (DOT) com> wrote:

Quote:
Various national postal codes

Just found a CHECK constraint I wrote as an exercise for myself some
years ago. It validates the postal codes for 58 countries from which I
had the pattern and which would fit into a LIKE predicate:
[snip]

Quote:
WHEN 'CA' THEN '[0-9][A-Z][0-9] [A-Z][0-9][A-Z]'
This is wrong for Canada. The Postal Code format is
letter-digit-letter-space-digit-letter-digit, so the line should be:
WHEN 'CA' THEN '[A-Z][0-9][A-Z] [0-9][A-Z][0-9]'

[snip]

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.


Reply With Quote
  #27  
Old   
Philipp Post
 
Posts: n/a

Default Re: What data standards should a database designer know about? - 04-14-2009 , 03:07 AM



Gene,

Quote:
WHEN 'CA' THEN '[0-9][A-Z][0-9] [A-Z][0-9][A-Z]'
This is wrong for Canada. The Postal Code format is letter-digit-
letter-space-digit-letter-digit, so the line should be: WHEN 'CA'
THEN '[A-Z][0-9][A-Z] [0-9][A-Z][0-9]' <

Many thanks for pointing this out. This was indeed a mix-up. As this
version was already some years old and I did not look at these things
for quite a while, some entries were unfortunately outdated, others
were missing. I have already sent over an updated version to Joe by e-
mail in order to avoid messing up the list with it. If somebody is
interested, I can however put a copy in here as well.

We could do it for Canada even better: WHEN 'CA' THEN
'[ABCEGHJKLMNPRSTVXY][0-9][ABCEGHJKLMNPRSTVWXYZ] [0-9]
[ABCEGHJKLMNPRSTVWXYZ][0-9]'

Citation from http://en.wikipedia.org/wiki/Canadian_postal_code

"No postal code includes the letters D, F, I, O, Q, or U, as the OCR
equipment used in automated sorting could easily confuse them with
other letters and digits, especially when they are rendered as cursive
handwriting. The letters W and Z are used, but are not currently used
as the first letter."

A good listing of postal code formats can be found here:

http://en.wikipedia.org/wiki/List_of_postal_codes

brgds

Philipp Post


Reply With Quote
  #28  
Old   
Charles Calvert
 
Posts: n/a

Default Re: What data standards should a database designer know about? - 04-29-2009 , 10:23 PM



On Tue, 24 Mar 2009 17:28:11 -0700 (PDT), --CELKO--
<jcelko212 (AT) earthlink (DOT) net> wrote in
<67d72be0-1362-4bc2-add7-3015da77cd52 (AT) e18g2000yqo (DOT) googlegroups.com>:

Quote:
What data standards should a database designer know about?

Some are so general they jump out at you --

ISO-8601 temproal dispaly formats.
ISO-3166 Country codes
ISO-5218 sex codes
email addresses and URLs
Various national postal codes
Various banking codes liek CUSIP and ISIN
ISBN for books
ISAN for AV media
VIN for vehicles
Passport numbers

What am I forgetting? What is a good source for them?
NAICS codes. You need these if you're doing anything with government
contracting or insurance, among others:
<http://www.census.gov/eos/www/naics/>.

Someone mentioned routing numbers for U.S. banks. I found a nice list
provided by the federal reserve here:
<https://www.fededirectory.frb.org/download.cfm>.

--
Charles Calvert | Web-site Design/Development
Celtic Wolf, Inc. | Software Design/Development
http://www.celticwolf.com/ | Data Conversion
(703) 580-0210 | Project Management


Reply With Quote
  #29  
Old   
Joćo Loureiro
 
Posts: n/a

Default Re: What data standards should a database designer know about? - 05-16-2009 , 11:36 AM



On Apr 11, 4:17*pm, Philipp Post <Post.Phil... (AT) googlemail (DOT) com> wrote:
Quote:
* WHEN 'PT' THEN '[0-9][0-9][0-9][0-9]'
This has changed, and now it should be:

WHEN 'PT' THEN '[0-9][0-9][0-9][0-9]-[0-9][0-9][0-9]'


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.