[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

<web-produce 479> Re: 店舗情報のリ レーショナルデータベース化




2000年2月24日(木) 21:29 に、私曰く:
>
> 追伸 このデータベースと連動して動く掲示板を、近々、PHP で書く予
>    定です。(たとえば、掲示板の店名のセレクタには、データベー
>    スに登録されている店名しかでてこないなど、簡単に実現できま
>    すね。)

 とりあえず、データベース側のテーブル構造だけ作ってみましたが、
こんなアトリビュートでどうでせう?

% psql bbs_test
Welcome to the POSTGRESQL interactive sql monitor:
  Please read the file COPYRIGHT for copyright terms of POSTGRESQL
[PostgreSQL 6.5.3 on i386-unknown-freebsd2.2.8, compiled by gcc 2.7.2.1]

   type \? for help on slash commands
   type \q to quit
   type \g or terminate with semicolon to execute query
 You are currently connected to the database: bbs_test

bbs_test=> \d
Database    = bbs_test
 +------------------+----------------------------------+----------+
 |  Owner           |             Relation             |   Type   |
 +------------------+----------------------------------+----------+
 | koba             | カウンター                       | table    |
 | koba             | 掲示板                           | table    |
 | koba             | 掲示板_pkey                      | index    |
 | koba             | 認証                             | table    |
 +------------------+----------------------------------+----------+

bbs_test=> \d 掲示板
Table    = 掲示板
+----------------------------------+----------------------------------+-------+
|              Field               |              Type                | Length|
+----------------------------------+----------------------------------+-------+
| 記事番号                         | int4 not null                    |     4 |
| 名前                             | varchar()                        |    80 |
| 題名                             | varchar()                        |   100 |
| メールアドレス                   | varchar()                        |    80 |
| ホームページ                     | varchar()                        |    80 |
| 親記事の番号                     | int4                             |     4 |
| キーワード                       | varchar()                        |    80 |
| 書込み日                         | date                             |     4 |
| 書込み時刻                       | time                             |     8 |
| 本文                             | text                             |   var |
| 削除フラグ                       | char()                           |     1 |
+----------------------------------+----------------------------------+-------+
Index:    掲示板_pkey

bbs_test=> \d カウンター
Table    = カウンター
+----------------------------------+----------------------------------+-------+
|              Field               |              Type                | Length|
+----------------------------------+----------------------------------+-------+
| 最新の数値                       | int4                             |     4 |
+----------------------------------+----------------------------------+-------+
bbs_test=> \d 認証
Table    = 認証
+----------------------------------+----------------------------------+-------+
|              Field               |              Type                | Length|
+----------------------------------+----------------------------------+-------+
| 名前                             | varchar() not null               |    80 |
| パスワード                       | char() not null                  |     6 |
+----------------------------------+----------------------------------+-------+
bbs_test=> _

-- 
古場 正行 (こば まさゆき)                           (((((((
  E-mail: koba@hoge.org or koba@noge.com (private)   )∂ ∂)
          masa-k@sag.hitachi-sk.co.jp    (office)   (  v  __
     URL: http://www.noge.com/koba/                  ゝ-〈/