tailieunhanh - Oracle SQL Plus The Definitive Guide- P10

Oracle SQL Plus The Definitive Guide- P10:Every day, computer professionals the world over wake up, travel to the office, sit down in front of a computer, and begin another day working with that database called Oracle. Programmers write queries and stored procedures. Database administrators monitor performance, make database changes, and perform other maintenance tasks. Operations people may need to back up or recover a database. | previous page page_67 next page Page 67 Step 1 Formulate the Query The very first step to designing a report is to formulate the underlying SQL query. There is little point in doing anything else until you have done this. The remaining steps all involve formatting and presentation. If you haven t defined your data there is no reason to worry about how to format it. For this chapter let s look at developing a report that answers the following questions To what projects is each employee assigned How many hours have been charged to each project What is the cost of those hours One way to satisfy those requirements would be to develop a report based on the following query which summarizes the hours and dollars charged by employee and project SELECT SUM SUM FROM EMPLOYEE E PROJECT P PROJECT_HOURS PH WHERE AND GROUP BY If you execute this query using SQL Plus here s what the output will look like EMPLOYEENAME PROJECTNAME SUM LOGGED SUM CHARGED Jonathan Gennick 20 Corporate Web Site 3380 Jonathan Gennick 24 Year 2000 Fixes 4056 Jonathan Gennick 24 Accounting System Implementation 4056 Looks pretty ugly doesn t it I wouldn t want to hand that to a client. It s a start though. At least now you can see what the data looks like and you know what you have to work with. previous page page_67 next page previous page page_68 next page Page 68 Step 2 Format the Columns Now that you have the data you can begin to work through the formatting process. Look again at the listing produced in step 1. There are at least three things that can be done to improve the presentation of the data Get each record to fit on just one line. Use better column headings. Format the numbers. The first thing that probably leaped out at you was the need to avoid having report lines so long that they wrap .

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã 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.