FexamF03Solutions

FexamF03Solutions - CSE 412/598 Database Management Systems...

Info icon This preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE 412/598 Database Management Systems Final Exam Spring 2003 NAME_________________________ASUID____________________ CLASS_____________ [24 pts.] 1. Use the relational schema below to develop solutions to the queries on the following pages. The ER diagram that was used to derive the relational schema is provided to assist in understanding the meaning of the relational schema. . bank b-name b-code location s_account_no 1 n 1 n 1 branch has_branch br-code savings checking savings accounts checking accounts c_account_no customers balance balance has_savings has_checking n n n 1 1 Bank(b-code , b-name) Branch(b-code, br-code , location) Savings(b-code, br-code, s-account-no , balance, ssn) Checking(b-code, br-code, c-account-no , balance, ssn) Customers(ssn , name, addr) 1
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
1. (continued) [6 pts.] a. Write a TRC solution for the following query: QUERY: Print the name and address of customers that have more than one savings accounts at the Tempe branch of Wells Fargo Bank ("Tempe" is the branch location name). { c.name, c.address | Customers(c) and exists( S1, S2, Br, B) (Savings(S1) and S1.ssn = c.ssn and Savings(S2) and S2.ssn=c.ssn and Branch(Br) and Br.Location = ‘Tempe’ and Branch(B) and b.bname=’Wells Fargo Bank’ and S1.s_account_no < > S2.s_account_no and B.b_code = S1.b_code and B.b_code = S2.b_code and S1.br_code = BR.br_code and S2.br_code = BR.br_code)}; [6 pts.] b. Write a DRC solution for the same query as in part (a). {CName, CAddr | exists Cssn (Customer( Cssn, CName, CAddr ) and (exists Sbc, Bn, Sbrc, Loc, Sav1, Sav2 ) (Savings( Sbc, Sbrc, Sav1, _, Cssn ) and (Savings( Sbc, Sbrc, Sav2, _, Cssn) and Sav1 <> Sav2 and Bank( Sbc, Bn) and Bn = ‘Wells Fargo Bank’ and Branch( Sbc, Sbrc, Loc ) and Loc = ‘Tempe’ ) }; 2
Image of page 2
1.
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern