Data Types (Domains)

Sunday, January 25, 2015

Lazada Indonesia
Text. Text columns generally have a limited number of characters. SQL Server and Oracle both cut the limit in half for Unicode (2-byte) characters. Microsoft Access is the most limited at 255 characters. Some database management systems ask you to distinguish between fixed-length and variable-length text.




Numbers
Numeric data is also common, and computers recognize several variations of numeric data. The most important decision you have to make about numeric data columns is choosing between integer and floating-point numbers. Integers cannot hold fractions (values to the right of a decimal point). Integers are often used for counting and include values such as 1; 2; 100; and 5,000. Floating-point numbers can include fractional values and include numbers like 3.14159 and 2.718.

Dates and Times
All databases need a special data type for dates and times. Most systems combine the two into one domain; some provide two separate definitions. Many beginners try to store dates as string or numeric values. Avoid this temptation. Date types have important properties. Dates (and times) are actually stored as single numbers. Dates are typically stored as integers that count the number of days or seconds from some base date.

Binary Objects
A relatively new domain is a separate category for objects or binary large object (BLOB). It enables you to store any type of object created by the computer. A useful example is to use a BLOB to hold images and files from other software packages.

Computed Values
Some business attributes can be computed. For instance, the total value of a sale can be calculated as the sum of the individual sale prices plus the sales tax. Or an employee’s age can be computed as the difference between today’s date and the DateOfBirth. At the design stage, you should indicate which data attributes could be computed. The UML notation is to precede the name with a slash (/) and then describe the computation in a note.

User-Defined Types (Domains/Objects)
A relatively recent object-relational feature is supported by a few of the larger database systems. You can build your own domain as a combination of existing types. This domain essentially becomes a new object type.


Lazada Indonesia

No comments:

Post a Comment

 
Learn on Udemy Today!