Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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. 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started