« PostgreSQL����¸�Υơ��֥��������ѹ���ALTER TABLE | �ᥤ�� | PostgreSQL���ơ��֥������DROP TABLE »
2006ǯ12��20��
PostgreSQL���ơ��֥�������CREATE TABLE
�ơ��֥�����������ˤϡ�CREATE TABLE����Ѥ��ޤ���
���ơ��֥��������NOT NULL����UNIQUE����DEFAULT���������ʤɤ�����ǽ�Ǥ���
��ʣ��ç¥ï¿½ï¿½ï¿½Ê¥×¥é¥¤ï¿½Þ¥ê¡¼ï¿½ï¿½ï¿½ï¿½ï¿½Ë¤Ï¥Æ¡ï¿½ï¿½Ö¥ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½Ë¤Î¤ï¿½ï¿½ï¿½Í¿ï¿½ï¿½ï¿½ë¤³ï¿½È¤ï¿½ï¿½Ç¤ï¿½ï¿½Þ¤ï¿½ï¿½ï¿½
���̾�Υơ��֥����
create table sglog(
"shop_id" integer,
"fullname" varchar(100) not null,
"ip" varchar(100) not null,
"log_date" timestamp DEFAULT "timestamp"('now'::text) not null
);
���ץ饤�ޥ꡼��������ˡ�������ʤɤ��դ���
create table area(
"area_id" integer primary key,
"area_name" varchar(100) not null,
"ordernum" integer UNIQUE not null,
"registday" timestamp DEFAULT "timestamp"('now'::text) not null,
"parent_areaid" integer,
"rank" integer
);
��ʣ��ç¥ï¿½ï¿½ï¿½ï¿½ï¿½Õ¤ï¿½ï¿½ï¿½
create table rcmenu(
"rcmenuid" integer DEFAULT nextval('"rcmenu_rcmenuid_seq"'::text) not null,
"title" varchar(100) not null,
"list" text,
"must" boolean DEFAULT 'f' not null,
"ordernum" integer UNIQUE not null,
Constraint "rcmenu_pkey" Primary Key (rcmenuid, title)
);
��ʣ���Υ����ǥ�ˡ����ˤ���
create table r_access_i(
"shop_id" integer not null references sginfo(shop_id) on update cascade on delete cascade,
"inout" varchar(10) not null,
"ym" varchar(10) not null,
"count" integer not null,
Constraint "raccess_i_ukey" UNIQUE (shop_id, inout, ym)
);
��ID�Τ褦�ʥ�ˡ������ͤ���ä��ơ��֥�ξ�硢���������ץ饤�ޥ꡼����������򤷤��ۤ��������Ǥ����ץ饤�ޥ꡼���������ꤹ�뤳�Ȥˤ������ʥ���ǥå����ˤ��������졢SELECTʸ�¹Ի��ʤɤΥ쥹�ݥ󥹤�®���˳��ʤ˺����Фޤ���
��Ƽ� wing : 2006ǯ12��20�� 23:13