Skip to content

Latest commit

 

History

History
72 lines (55 loc) · 1.84 KB

public.books_view.md

File metadata and controls

72 lines (55 loc) · 1.84 KB

public.books_view

概要

書籍のビュー

テーブル定義
CREATE VIEW books_view AS (
 SELECT books.id,
    books.title,
    books.price,
    books.publisher_id,
    publishers.name AS publisher_name,
    authors.id AS author_id,
    authors.name AS author_name
   FROM (((books
     LEFT JOIN publishers ON ((books.publisher_id = publishers.id)))
     LEFT JOIN author_books ON ((books.id = author_books.book_id)))
     LEFT JOIN authors ON ((author_books.author_id = authors.id)))
)

Referenced Tables

カラム一覧

名前 タイプ デフォルト値 Nullable 子テーブル 親テーブル コメント
id text true 書籍ID
title text true 書籍名
price integer true 価格
publisher_id text true 出版社ID
publisher_name text true 出版社名
author_id text true 著者ID
author_name text true 著者名

Viewpoints

名前 定義
書籍の購入 書籍を購入する際に関連するテーブルのまとまり。 顧客が購入できるためには、配送先が設定される必要がある。 配送時に参照される製品コードはproductsテーブルから取得される。

ER図

erDiagram


"public.books_view" {
  text id
  text title
  integer price
  text publisher_id
  text publisher_name
  text author_id
  text author_name
}
Loading

Generated by tbls