Home » SQL & PL/SQL » SQL & PL/SQL » table columns populating value
table columns populating value [message #406188] Tue, 02 June 2009 14:04 Go to next message
miroconnect@yahoo.com
Messages: 202
Registered: April 2006
Senior Member
Its question about data model design best practices and normalized data model.I am new to data modelling. Is it ok to have columns which geta record later some point and not when creating instance of table for example

I have a table

Programs
Columns
program_id(PK)
sys_org_id(FK)
ocd_creation_date
sys_user_id(FK)

this table initially When I create a new record I will just have values for program_id, sys_org_id . Next some time later we populate ocd_creation_date and sometime later sys_user_id ,
and more over all the columns should have values and I cannot leave them null and because I populate them later I cannot add not null constraint on so my question is, is this a good practice to leave some columns blank and provide value later or is there any other better way ?


Re: table columns populating value [message #406199 is a reply to message #406188] Tue, 02 June 2009 15:01 Go to previous messageGo to next message
BlackSwan
Messages: 25033
Registered: January 2009
Location: SoCal
Senior Member
> is this a good practice to leave some columns blank and provide value later
What is the alternative? Use "place holder values?

> all the columns should have values
How do you enforce this requirement?
For how long can the "empty" columns remain empty?

What should occur with rows containing "empty" columns on SELECT?
Are these rows returned or not?
Re: table columns populating value [message #406202 is a reply to message #406199] Tue, 02 June 2009 15:20 Go to previous messageGo to next message
miroconnect@yahoo.com
Messages: 202
Registered: April 2006
Senior Member
What are place holder values do you mean some dummy values ?

For how long it depends on the user, when ever user perform this additional action, column value is created , if user does not do it them no value is created , I am wondering If I should use a new table for these properties and create a row only if user does the additional action ?

select should return whats in database if value is present then value if not present then null.
Re: table columns populating value [message #406310 is a reply to message #406202] Wed, 03 June 2009 04:22 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
I would see no problem at all in having columns that are null when a record is created - it's entirely normal to have a record for which some of the data will not be known until a later date.
Previous Topic: Oracle SQL Query
Next Topic: get value of DB parameter in JDBC
Goto Forum:
  


Current Time: Sat Dec 03 04:03:40 CST 2016

Total time taken to generate the page: 0.06102 seconds