English 中文(简体)
关于非行设计的咨询意见 最佳做法/标准——Oracle
原标题:Advice on DB design Best Practices/Standard - Oracle

我为新事物设计了银,我已经做了几千次,但此时我突然开始对我以前从未停止过的一些方面表示怀疑。 是否有以下标准/建议?

  • Whats the recommended data type for storing currencies (no financial operations, just displaying).
  • Recommended size for storing phone numbers (internationals)
  • Recommended minimum size for storing first names / last names (minimum meaning smallest maximum recommended size)
  • Recommended minimum size for storing comment blocks.(minimum meaning smallest maximum recommended size also)

我知道,每项申请都有自己的特殊要求,但我觉得,必须比感觉和常识更具体。

一如既往地提供帮助将受到高度赞赏。

最佳回答

Whats the recommended data type for storing currencies

这取决于货币的种类和准确程度。

如果其百分数和美元四舍五入到最接近的年份,则NUMBER(12,2)允许你在<代码>-999,999,999.99.99.99和之间储存数量(999,999,999.99.99.99)之间,大多数货币应足够。

如果您需要储存利率计算得出的中间结果,则可能需要更精确,例如NUMBER(15,5)

如果你再讲津巴布韦元,或许你应当选择最高<条码>——NUMBER,而不是:

www.un.org/Depts/DGACM/index_spanish.htm 储存电话号码(国际)的建议尺寸

VARCHAR2(30)应当足够。 如果用户太长,就会在那里输入各类废墟数据。

Recommended minimum size for storing first names / last names / Recommended minimum size for storing comment blocks

These don t apply since you re in Oracle - use VARCHAR2, so you don t have to worry about minimum size. All you need to specify is the maximum size.

问题回答

Currencies:

NUMBER(15,2),这真的取决于你预计会有多少数字。

Phone numbers:

VARCHAR2(30),如果应当更大,请不要伤害我——只能记住VARCHAR允许灵活安排时间。

如果使用VARCHAR2,我看不到“/em>的大小”。 对物理模型的关切围绕数据库随着时间的推移将消耗多少空间,假设田地最大化。

Comment blocks:

瓦尔扎赫最大值(4000)

rel=“nofollow”>EDIFACT一般使用35个姓名领域和I d拷贝(并作为依据记载)。 新的障碍往往在XML中加以界定,而且通常不局限于外地范围的定义。

或者,加拿大的邮局recommends 每条地址不超过40个。

注,即是特质而非特质。 筛选应考虑到多面性,但显然并非所有名字都是最长期限。 我用十种特性作为衡量估计数的广泛近似,但各国、各族裔之间可能有很大差异。

我知道,你们要求的是最小的区块,但对于大自由区,你应当考虑使用CLOB值。 Oracle在如何处理这些物品、如何储存数据等问题上很有道理。 NEVER必须担心规模。 此外,通常可在pretend上看到,它们是便于操作的VARCHAR2栏。





相关问题
Export tables from SQL Server to be imported to Oracle 10g

I m trying to export some tables from SQL Server 2005 and then create those tables and populate them in Oracle. I have about 10 tables, varying from 4 columns up to 25. I m not using any constraints/...

Connecting to Oracle 10g with ODBC from Excel VBA

The following code works. the connection opens fine but recordset.recordCount always returns -1 when there is data in the table. ANd If I try to call any methods/properties on recordset it crashes ...

How to make a one to one left outer join?

I was wondering, is there a way to make a kind of one to one left outer join: I need a join that matches say table A with table B, for each record on table A it must search for its pair on table B, ...

Insert if not exists Oracle

I need to be able to run an Oracle query which goes to insert a number of rows, but it also checks to see if a primary key exists and if it does, then it skips that insert. Something like: INSERT ALL ...

How can I store NULLs in NOT NULL field?

I just came across NULL values in NOT-NULL fields in our test database. How could they get there? I know that NOT-NULL constraints can be altered with NOVALIDATE clause, but that would change table s ...

Type reference scope

I m studying databases and am currently working on a object-relational DB project and I ve encountered a small problem with the number of possible constraints in an object table. I m using "Database ...

OracleParameter and DBNull.Value

we have a table in an Oracle Database which contains a column with the type Char(3 Byte). Now we use a parameterized sql to select some rows with a DBNull.Value and it doesn t work: OracleCommand ...

热门标签