[NOVICE] are separate join tables necessary/important like in Filemaker

Поиск
Список
Период
Сортировка
От Rounak Jain
Тема [NOVICE] are separate join tables necessary/important like in Filemaker
Дата
Msg-id CANNuxWOZQ4QrWcRHTiwUnEdTXp_oxntzvcbqxYXEzfXkWFUT-A@mail.gmail.com
обсуждение исходный текст
Список pgsql-novice
I am new to psql but not databases. I have worked with Filemaker.
I am working on an invoicing database.
The sale_invoice_details table (line item table for sale_invoice) must be able to retrieve the rate at which the product entered in the current line was last sold to the current customer. In other words, retrieve rates customer-wise-product-wise for the current line item.

In Filemaker, it was necessary to create a customer_product_join table with the following fields:
id_product
id_customer
rate

This table was used to retrieve the previously stored value for that customer-product.
Every time, a rate was entered manually in the sale_invoice_details table, a script would update the customer_product_join table.

I am not sure whether such table is required in psql. I think after I am done with the database, my app must execute queries to retrieve the last rate for the customer-product. Kindly guide me.

(If the above is unclear, sale_invoice_details table consists of the following fields:
id_sale_invoice (foreign key of sale_invoice table)
id_product (foreign key of product table)
unit (value to be retrieved from product table)
rate (to be retrieved from customer_product table or via query, I am not sure))

Sorry, if I still missed to give important details. Kindly inform me so that I don't repeat my mistake.
Thanks.


В списке pgsql-novice по дате отправления:

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: [NOVICE] What happens to concurrent update to the same row?
Следующее
От: neha khatri
Дата:
Сообщение: [NOVICE] Regression test : pg_conversion validation