
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
Write prolog query: closest_common_ancestor.
x is a closest common ancestor of two people y and z if x is an ancestor of both y and z and no child of x is an ancestor of y and z. (A closest common ancestor of two ?rst cousins will be someone who is a grandparent of both.)
first_cousin(C1,C2):- parent(P1,C1), parent(P2,C2), sibling(P1,P2).
grand_parent(GP,GC):- parent(GP,P), parent(P,GC).
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- PLZ help with the following: IN SQL Let R (A, B, C) be a relation schema. What happens if we execute the following query? SELECT* FROM R WHERE A=D; Select one: a. We get an error. b. The query executes successfully but returns no tuples. c. The query returns all the tuples in R.arrow_forwardSuppose relations R(A,B) and S(B,C,D) have the tuples shown below: R A B 5 3 4 46 8 479 Compute the result of the join query: SELECT A, R.B, S.B, C, D FROM R, S WHERE R.Aarrow_forwardWrite relational algebra expressions for database providedarrow_forward
- Suppose a single relation (table) is used to record the information about students’ enrollment in courses. We assume that each student may enroll in more than one course and one course is assigned to one instructor. All questions below are based on the following ENROLLMENT unnormalized table. ENROLLMENT StudentID StuName CourseCode CourseName Grade CreditHr Instructor InstrOffice 1021234 Ali 1102 1201 Database Internet A B 3 3 Zaid Sumaiya 5.01 5.05 1024131 Amina 1201 1401 Internet Operating System C B 3 3 Sumaiya Abdullah 5.05 5.10 1. What would be the First Normal Form (1NF) relation? Identify the primary key. 2. Identify the functional dependencies represented by the attributes shown in the ENROLLMENT table. Label partial or transitive dependency where applicable.arrow_forward(Choose all of the correct superkeys.) Find all superkeys of the DEPARTMENT relation. Its primary key (PK) is underlined. DEPARTMENT (number, dname, mgrssn, location) PK = {dname, location} {number} {number, dname} {number, dname, mgrssn} {number, dname, mgrssn, location} {dname} {dname, mgrssn} {dname, mgrssn, location} {mgrssn} {mgrssn, location} {location} {number, dname, mgrssn} {number, dname, location} {number, mgrssn} {number, mgrssn, location} {number, location} {dname, location}arrow_forwardSuppose relations R(A,B) and S(B,C,D) are as followsarrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education