database - General Oracle Results Table -


I am preparing a new laboratory database. I want all the raw results (for all tests) in a table ( RESULTS ). However, the numeric values ​​differ greatly in quantity and precision. For example, some results only count a whole number, while the other results are very sensitive.

Which of the following cases (and why) ()

Option 1: Store each one with the highest precision result in the raw_result column as a NUMBER .

Option 2: Create the results table and type the same data type as a with a specific coding Each representation result of raw_result column and many child tables (i.e.: integer to 1 to 1000, decimal number to 6 decimal places, etc.)

In addition to this, in the related posts, Ideally asked to store raw signal NUMB internally for oracle ER, regardless of precision and scale

P>

Option 2 Terrible maintenance seems like a nightmare, and if you decide to change the accuracy of one of your values, what do you do?

Edit: For example, consider:

  SQL & gt; Create table test (N1 number (3812), N2 number (5)); Table sql and gt; INSERT (1, 1) to test the values; SQL and GT in 1 line; INSERT (990, 9900) to test the values; SQL and GT in 1 line; INSERT (1999999.999999, 1) to test the values; SQL and GT in 1 line; SELECT n1, DUMP (n1) n1d, n2, dumep (n2) by n2d test; N1N1DN2N2D --------------------- ------------------- ----------- ------ -------------------- 1.000000000000 Type = 2 lane = 2: 1932,2 1 type = 2 lane = 2: 193,2 99 0.000000000000 Type = 2 lane = 3: 194,10,91 9900 type = 2 lane = 2: 194,100 19, 99, 999.999999 000000 Type = 2 lane = 8: 196 , 2,100,100,100 1 type = 2 lane = 2: 193,2, 100,100,100 SQL & gt;  

There is no difference in storage, stored data is dependent, not the precision / scale of the column definition.

Gives a very good description of how the number type is stored. To find out how much storage it will be for a given number, it is not as easy to compare prices. For example, 9 9 stores take 3 bytes to store, but only 2 bytes to store 9900


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -