Demo entry 5862268

Creazione della tabella Utente

   

Submitted by anonymous on Jul 30, 2016 at 12:57
Language: PL/pgSQL. Code size: 836 Bytes.

CREATE TABLE UTENTE(
USERNAME        VARCHAR(16) PRIMARY KEY,
EMAIL           VARCHAR(40) NOT NULL UNIQUE,
PASSWORD        VARCHAR(32) NOT NULL,
MACROAREA       VARCHAR(16)	,
NOME_UTENTE     VARCHAR(20)	,
COGNOME_UTENTE  VARCHAR(20)	,
DATA_NASCITA	  DATE        NOT NULL,
SESSO           CHAR(1)     CHECK (SESSO IN ('M','F','N')),
CAP             CHAR(5)     NOT NULL,
---- CHECK ----
CONSTRAINT email_mask CHECK(
    REGEXP_LIKE (EMAIL, '[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}')),
CONSTRAINT username_mask CHECK(
    REGEXP_LIKE (USERNAME, '[A-Z0-9]{4,}')),
CONSTRAINT macroarea_mask CHECK(LOWER(MACROAREA)
        IN ('eu ovest', 'eu est', 'america nord', 'america sud', 'oceania', 'giappone', 'africa', 'asia')),
CONSTRAINT cap_mask  CHECK (
    REGEXP_LIKE (CAP, '[0-9]{5}'))
);
--COLUMN SALDO FORMAT $9990,00;

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).