Question: 27. Consider a social network database, about people and their relationships. The database has two relations: Person(pid, name) Relationship(pidi, rel, pid2) Here Person.pid is a

 27. Consider a social network database, about people and their relationships.

27. Consider a social network database, about people and their relationships. The database has two relations: Person(pid, name) Relationship(pidi, rel, pid2) Here Person.pid is a key, and Relationship.pid1 and Relationship.pid2 are foreign keys; rel is a string representing the relation type, and can be friend or enemy. Note that the relationship is not necessarily symmetric: if Ahmad is friend with Samer, this does not imply that Samer is friend with Alhmad. Write the SQL statements that define the relational schema for this database. Assume that pid's are integers, and name and rel are character strings. 28. State true or false: Every weak entity set must be associated with an identifying entity 29. An ER model of a database consists of entity types A and B. These are connected by a relationship R which does not have its own attribute. Under which one of the following conditions, can the relational table for R be merged with that of A? 30. Suppose a company stores information about its employees and their hobbies using the following schema: Empleid, name, city) Hobbies leid, hobby); Hobbies.eid references to Empeid Write an SQL query to output the name of the employees who live in city='Seattle' and have at least five (25) hobbies. 31. Which operator performs pattern matching? 32. What do we call a collections of operations that form a single logical unit of work

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!