Table creation

From Rosetta Code
Revision as of 21:51, 22 August 2007 by rosettacode>SzwZpf

ford fiesta anno 2000 fitness pump manuale tisens il sito ufficiale di avril i don t want you back download mp3 stoosh microprisma buffy sigla tv calendario di milton celebrita video elettrostimolatori estetici amatoriali porno tell him vonda shepard ally mcbeal escort girl annunci settestelle porsche boxster 2005 ford escort orion martin cf centri di fisioterapia maggie q kokoko telefono senza filo cuffie piccole radio killed the radio star holiday in garden curt be erick prydz callon me zirkel, ferdinand pillola dimagrire wollongong prodigy software 5 00 villaggi vacanze per single foto collant prodotti viso gioco penalty apple 512 mp3 pacific coast party smash mouth air max basket iso buster 1 5 registration id home-theatre bose it s your duty matrimonio per colpa habaneras midi panasonic - kx-fp145jt la colomba bianca floppy disk usb card reader sotto falso nome torino amsterdam biglietti aerei produttori di parrucche goia mauro yoji yamada chateau lafitte sulla rotta di ulisse joseph sayers tecnowind tv terrestre foto pornostar bassano grappa joachim gnilka zaino porta pc milizia territoriale acer aspire 1682wlmi cd immagini amore dott lollo andrea decapitazioni americani in irak gonne roberto cavalli finepix f455 black travis. more than us de blanc patrizia decoder humax parabole fuch you right back sister of mercy rap hip pop pop rock r b promessa di vendita attivita commerciale fucile asso roger morango do nordeste sex foto models regolamento di condominio del turco riccardo nike air zoom drive i want to live forever casio csp auto usata firenze sex hardcore porno calendari serial killer storie sony minidisc registratore muse di brass llopi stay whit me tommy vee quel diavolo duomo adidas calzature uomo np fm30 cercare pact the testo modern times nino castelnuovo star wars galactic battlegrounds maya jewels nokia mobile 7710 dieta zone www avil lavigne com footlose serenata cotugno driver nec 616 jessica rabbit song tom tom ricevitore agriturismo dublino these worlds sandisk media express home cinema hyundai traduzioni testi avril lavigne sanna yamaha dgx-205 www sex position asus n6600gt lounge music sony vaio v3s passat variant 1 8 vacanze in villaggio calabria adsl router usb vamos a bailar da weasel re tratamento mp3 wham wake freedom videoregistratori digitale roberto farnesi immagini usb 5gb musica pop en espagnol la casa- found assicurazione brindisi lesbo alzatacco flex ventosa www vodafone 190 cyber-shot dsc-t7 black biografia visage olii e creme per massaggi television ya no te quiero andrea villareal fischer rx inglese mi gatita y yo sony vgn fs215b hp pavilon 64 pasion de gavilanes la novela cartuccia oki c3100 pablo lescano golds mine muvo slim 1gb rammstein. industrial angels eric pryd foto ultras promedia 21 godi al telefono istituti commerciali quotidiani la stampa daniela di costantino blackeyedpeas panasonic cq-c3301n master slim b 57 hajmo bih maglietta playboy jl co software house wild danceing aggiornamento padova sereno oratino cuando acaba el placer sylvie lo sgarbo usbehci a summer story attenti al vecchietto magia bianca carte europa suoni telefono travolto dagli affetti familiari actaea filmati bisex dragoste din tei un cappello di paglia di firenze audiokey 512 mb fm mujeres encueradas stampanti firewire ragazze ot ergonomica tastiera musique rai one shot 80 vol 12 sigma 17-35 ex 2 8 4 af donleavy, james patrick napoli lugano monitor lcd tv 15 auto per gioco libri sicla super quark staffa pda poggipolini finanziamento rivoli cofanetto signore anelli wagon r 4x4 vivavoce blutooth provveditorato degli studi

Task
Table creation
You are encouraged to solve this task according to the task description, using any language you may know.

In this task, the goal is to create a table to exemplify most commonly used data types and options.

PostgreSQL

Postgres developers, please feel free to add additional data-types you commonly use to this example.

-- This is a comment

CREATE SEQUENCE account_seq start 100;
CREATE TABLE account (
  account_id  int4        PRIMARY KEY DEFAULT nextval('account_seq'),
  created     date        not null default now(),
  active      bool        not null default 't',
  username    varchar(16) unique not null,
  balance     float       default 0,
  age         int2,
  notes       text
);

CREATE TABLE account_note (
  account_id  int4      not null REFERENCES account,
  created     timestamp not null default now(),
  note        text      not null,
  unique(account_id, note)
); 
-- bool:       't', 'f' or NULL
-- int2:       -32768 to  32767
-- int4:       -2147483648 to  2147483647
-- float:      decimal
-- date:       obvious
-- timestamp:  date time
-- char(#):    space padded text field with length of #
-- varchar(#): variable length text field up to #
-- text:       not limited