TAILIEUCHUNG - SQL Clearly Explained- P2

SQL Clearly Explained- P2: You don’t need to be a database designer to use SQL successfully. However, you do need to know a bit about how relational databases are structured and how to manipulate those structures. | Join 45 understand how the result table came to be might assume that it is correct and make business decision based on the bad data. The joins you have seen so far have used a single-column primary key and a single-column foreign key. There is no reason however that the values used in a join can t be concatenated. As an example let s look again at the accounting firm example from Chapter 1. The design of the portion of the database that we used was Equi-Joins over Concatenated Keys accountant acct first name acct last name date_hired office_ext customer customer numb first_name last_name street city state_province zip_postcode contact_phone project tax year customer numb acct_first_name acct_last_name form tax year customer numb form id is_complete Suppose we want to see all the forms and the year that the forms were completed for the customer named Peter Jones by the accountant named Edgar Smith. The sequence of relational operations would go something like this 1. Restrict from the customer table to find the single row for Peter Jones. Because some customers have duplicated names the restrict predicate would probably contain the name and the phone number. 2. Join the table created in Step 1 to the project table over the customer number. 3. Restrict from the table created in Step 2 to find the projects for Peter Jones that were handled by the accountant Edgar Smith. Please purchase PDF Split-Merge on to remove this watermark. 46 Chapter 2 Relational Algebra customer numb first name last name sale id customer numb I 4- sale date I sale total amt 4- 1 Janice Jones I 3 1 I 15 JUN 13 00 00 00 I 2 Jon Jones I 3 I 1 I 15 JUN 13 00 00 00 I 3 John Doe I 3 I 1 I 15 JUN 13 00 00 00 I 4 Jane Doe I 3 I 1 I 15 JUN 13 00 00 00 I 5 Jane Smith I 3 I 1 I 15 JUN 13 00 00 00 I 6 Janice Smith I 3 I 1 I 15 JUN 13 00 00 00 I 7 Helen Brown I 3 I 1 I 15 JUN 13 00 00 00 I 8 Helen Jerry I 3 I 1 I 15 JUN 13 00 00 00 I 9 Mary .

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.