Many-to-Many relation

From: Mukta Telang <mukta(at)darya(dot)nio(dot)org>
To: pgsql-sql(at)postgresql(dot)org
Subject: Many-to-Many relation
Date: 2003-05-26 12:46:05
Message-ID: 3ED20C8D.6EE46DFF@darya.nio.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

I am designing a database of paper publications.

A paper has one or more authors and an author has one or more papers.
In this way there is many-to-many relation.

An author of a paper has a "level", that is an author of a paper of
level one is the main author of the paper and the author
with level two is the second author of the paper and so on.

So we have following tables:
1. author
2. paper
3. author_paper

The attributes of author are:
1. author_id
2. name

The attributes of paper are:
1. paper_id
2. journal
3. year
4. volume
5. issue

The attributes of author_paper are:
1. author_id
2. paper_id
3. level

Now I want to create a view which displays all the information about
every paper.That is title,year,journal,volume, issue and all the authors
of the paper sorted according to their level.

How to do this?

Thanks in advance,

Mukta

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Mattox 2003-05-26 13:48:16 How to delete multiple rows from multiple joined tables
Previous Message alexandre :: aldeia digital 2003-05-26 12:44:03 timestamp field - select error