PostgreSQL 8 | 예제

공부의 기록·2021년 12월 9일
0

DB PostgreSQL

목록 보기
8/15

적절한 데이터 타입 선택하기

CREATE DATABASE test;
\c test
CREATE TABLE product_info (
    proudct_serial NUMERIC(5)
    product_name VARCHAR(40)
    product_created DATE
    product_factory NUMERIC(7)
);
CREATE TABLE order (
    order_serial NUMERIC(6)
    order_owner_id VARCHAR(8)
    order_product VARCHAR(40)
    order_amount NUMBERIC(1000)
    order_price MONEY,
    order_date TIMESTAMPTZ
);
CREATE TABLE factory (
    factory_serial NUMERIC(7)
    factory_name VARCHAR(45)
    fcatory_location VARCHAR(25)
    factory_admin VARCHAR(40)
    factory_direct_tel VARCHAR(11)
    factory_product VARCHAR[]
    factory_created DATE
);
CREATE TABLE customer (
    customer_serial VARCHAR(8)
    customer_name VARCHAR(4)
    customer_tel VARCHAR(11)
    customer_email VARCHAR(100)
    customer_birthday VARCHAR(6)
    customer_certified BOOLEAN
);
profile
블로그 이전 : https://inblog.ai/unchaptered

0개의 댓글