From: --CELKO-- on 15 Jan 2010 19:53
>> I am not sure what you are talking about. <<
ISO-11179 Standards and basic data modeling, and you are right about
inconsistency how many ways are there to say category in this
thing? Whats does a NULL manager identifier mean in the data model?
What is a tblProduct and why is there only one of them? The
identifier attributes need to reference the table where they are
defined as entities.
>> Anyway, here is the table structure. <<
Let's try to clean it up a little
CREATE TABLE Products
(product_category INTEGER NOT NULL PRIMARY KEY, - no validation
product_category_description VARCHAR(255) NOT NULL,
product_source_id INTEGER NOT NULL
REFERENCES Product_Sources (product_source_id),
manager_emp_id INTEGER DEFAULT 0
I am going to guess that a NULL manager_emp_id means the product has
nobody assigned to it; it woudl be easier to code if you had a default
instead (maybe zero?). I also guessed that there is a Product_Sources
table that you did not show us. If so life is easy; if this is a self-
reference in an adjacency list model, then we have problems.
SET product_cat_description = 'Hard'
WHERE product_cat = 400
OR (product_source_id = 400
AND manager_emp_id > 0);