Problems with RelationDomainCalculus
Posted in 1997
Topics: SQL Development & Query Writing
Hello, could anyone please help me with some problems in Relation - Tuple - Calculus and Domain-Calculus????!!!!!! I need the translation of some queries into Relation-Algebra, Relation-Tuple-Calculus and Domain-Calculus. The relations needed are: 1.) | Professors | |______________________________________________ | | Personal ID | Name | Status | Room | |_____________|_____________|_______|____________ | | 2125 | Sokrates | C4 | 226 | | 2126 | Russel | C4 | 232 | | 2127 | Kopernikus | C3 | 310 | | 2133 | Popper | C3 | 52 | | 2134 | Augustinus | C3 | 309 | | 2136 | Curie | C4 | 36 | | 2137 | Kant | C4 | 7 | |_____________|_____________|_______|____________ | 2.) | Assistants | |_____________________________________________________| | Personal ID | Name | Special interest | Boss | |_____________|_____________|____________________|______| | 3002 | Platon | Ideenlehre | 2125 | | 3003 | Aristoteles | Syllogistic | 2125 | | 3004 | Wittgenstein | Language-theory | 2126 | | 3005 | Rheticus | Movement of planets | 2127 | | 3006 | Newton | Keplersche Gesetze | 2127 | | 3007 | Spinoza | God and nature | 2134 | |_____________|_____________|____________________|______| 3.) | Lessons | |____________________________________________________________| | Lesson ID | Title | SWS | hold by | |_____________|____________________|_____________|____________ | | 5001 | Base | 4 | 2137 | | 5041 | Ethics | 4 | 2125 | | 5043 | Knowledgetheory | 3 | 2126 | | 5049 | Maeutics | 2 | 2125 | | 4052 | Logics | 4 | 2125 | | 5052 | Wissenschaftstheorie | 3 | 2126 | | 5216 | Bioethik | 2 | 2126 | | 5259 | Der Wiener Kreis | 2 | 2133 | | 5022 | Glaube und Wissen | 2 | 2134 | | 4630 | Die 3 Kritiken | 4 |2137 | |_____________|____________________|_____________|____________ | 4.) | Students | |_______________________________________ | |Student ID | Name | Semester | |________________________________________| | 24002 | Xenokrates | 18 | | 25403 | Jonas | 12 | | 26120 | Fichte | 10 | | 26830 | Aristoxenos | 8 | | 27550 | Schopenhauer | 6 | | 28106 | Carnap | 3 | | 29120 | Theophrastos | 2 | | 29555 | Feuerbach | 2 | |_____________|_____________|_____________| 5.) | listen | |__________________________ | |Student ID | Lesson ID | |26120 | 5001 | | 27550 | 5001 | | 27550 | 4052 | | 28106 | 5041 | | 28106 | 5052 | | 28106 | 5216 | | 28106 | 5259 | | 29120 | 5001 | | 29120 | 5041 | | 29120 | 5049 | | 29555 | 5022 | | 25403 | 5022 | | 29555 | 5001 | |_____________|_____________| The queries are: 1. Find all Professors by Personal ID and Name who hold a Lesson with SWS = 4. My solutions in this case are Relationen-Algebra: (p stands for projection, s for selection and * for the natural join) p_Personal ID, Name (s_SWS=4 (Professors * Lessons)) Relation-Tuple-Calculus: (t, u and v are tuple-variables and E is the quantor of existence and + is the logical "and") { t | (E u) (E v) (Professor(u) + Lesson(v) + u[Personal ID] = v[hold by] + t[Personal ID] = u[Peronal ID] + t(Name) = u(Name) + v(SWS) = 4)} I hope this is right.... Please tell me if not... Sorry I dont know it in Domain Calculus 2. Find all Students by their Student ID, who listen to the Lesson Bioethik Relationen -Algebra p_Student ID ( s_Title=Bioethik (Students * listen * Lessons) Please tell me this query in Relation- Domain-Calculus und Tuple-Calculus.... 3. Find the Names and the special Interests of those Assistants whose boss is Sokrates p_Name, Special Interest ( s_Boss=Personal ID (Assistants)) Again please... I think you know already what I need 4. Find all Lessons hold by Russel p_Title ( s_hold by =Personal ID (Professors * Lessons)) look query above.... 5. Find all Professors with the status C3 p_Name ( s_Status = C3 (Professors)) Well I hope anyone of you is so nice to help me. I would be very much obliged to you.... Thank you very much Yours, Hanni PS: Please send an e-mail to hatml@aon.at Thank you again