TAILIEUCHUNG - Databases Demystified- P3

Tham khảo tài liệu 'databases demystified- p3', công nghệ thông tin, cơ sở dữ liệu phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Databases Demystified Figure 3-21 Example 3-11 Multiple Joins Calculated Columns top and the query results bottom Example 3-12 Aggregate Functions In reviewing the Example 3-11 results you probably noticed that a lot of rows were returned 352 to be exact you may get a different number of rows if you use a version other than Microsoft Access 2000 . Also there are many rows for each customer. Not only do customers have many orders but also each order can have many rows. All the details are here but at a glance it is difficult to easily get a sense of the total amount that each customer has ordered from Northwind. What we really need CHAPTER 3 Forms-Based Database Queries to do is sum up the ExtPrice column for each customer. In relational databases this is done with the SUM function. Afunction is a special type of program that returns a single value each time it is invoked named for the mathematical concept of a function. Because we will use the function to operate on a column it will be invoked for each row and therefore return a single value for each row the query handles. Sometimes the term column function is used to remind us that the function is being applied to a table or view column. An example of an ordinary column function is ROUND which can be used to round numbers in various ways. Special classes of functions that combine multiple rows together into one row are called aggregate functions. The following table shows aggregate functions that are commonly used in relational databases Function Name Description AVG Calculates the average value for a column COUNT Counts the number of values found in a column MAX Finds the maximum value in a column MIN Finds the minimum value in a column SUM Sums totals up the values in a column If we use an aggregate function by itself in a query we get one row back for the entire query. This makes sense because there is no way for the RDBMS to know what other result we might want. So if we want the aggregate result to be for .

TỪ KHÓA LIÊN QUAN
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.