TAILIEUCHUNG - Joe Celko s SQL for Smarties - Advanced SQL Programming P14

Joe Celko s SQL for Smarties - Advanced SQL Programming P14. In the SQL database community, Joe Celko is a well-known columnist and purveyor of valuable insights. In Joe Celko's SQL for Smarties: Advanced SQL Programming, he picks up where basic SQL training and experience leaves many database professionals and offers tips, techniques, and explanations that help readers extend their capabilities to top-tier SQL programming. Although Celko denies that the book is about database theory, he nevertheless alludes to theory often to buttress his practical points. This title is not for novices, as the author points out. Instead, its intended audience. | 102 CHAPTER 3 NUMERIC DATA IN SQL Numbers in SQL are classified as either exact or approximate. An exact numeric value has a precision p and a scale s. The precision is a positive integer that determines the number of significant digits in a particular radix. The Standard says the radix can be either binary or decimal so you need to know what your implementation does. The scale is a nonnegative integer that tells you how many decimal places the number has. Today there are not that many base-ten platforms so you probably have a binary machine. However a number can have one of many binary representations twos-complement ones-complement high-end or low-end and various word sizes. The proper mental model of numbers in SQL is not to worry about the bits and bytes level of the physical representation but to think in abstract terms. The data types numeric decimal integer bigint and smallint are exact numeric types. An integer has a scale of zero but the syntax simply uses the word INTEGER or the abbreviation INT. smallint has a scale of zero but the range of values it can hold is less than or equal to the range that integer can hold in the implementation. Likewise bigint has a scale of zero but the range of values it can hold is greater than or equal to the range that integer can hold in the implementation. bigint was added in SQL-99 but had been common in products before then. decimal p s can also be written DEC p s . For example DECIMAL 8 2 could be used to hold the number which has eight significant digits and two decimal places. The difference between numeric and decimal is subtle. numeric specifies the exact precision and scale to be used. decimal specifies the exact scale but the precision is implementation-defined to be equal to or greater than the specified value. Mainframe COBOL programmers can think of NUMERIC as a COBOL PICTURE numeric type whereas DECIMAL is like a BCD. Personal computer programmers these days probably have not seen anything like .

TÀI LIỆU MỚI ĐĂNG
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.