[ Prev ]
2019-10-16

-- Oct 16 In-Class Exercise Thread
Resource Description for Cs157A- weak entity - Oct 16 2019 - 8-53 PM - p1.jpg
  • The first example: The BookLoan entity only exists if a student loan a book, while a student still exists if they loan a book or not.
  • Second example: If the ER diagram is turned into a binary ER diagram, then the entity Song will depend on the keys of other Entity
(Edited: 2019-10-16)
((resource:Cs157A- weak entity - Oct 16 2019 - 8-53 PM - p1.jpg|Resource Description for Cs157A- weak entity - Oct 16 2019 - 8-53 PM - p1.jpg)) * The first example: The BookLoan entity only exists if a student loan a book, while a student still exists if they loan a book or not. * Second example: If the ER diagram is turned into a binary ER diagram, then the entity Song will depend on the keys of other Entity

-- Oct 16 In-Class Exercise Thread
1) Course could be a weak entity set. Knowing the number of the course does not tell us what course it is unless we know what subject it is.
2) The entity set Professor has a Works relationship with the University to teach a Course. If we get rid of the relationship, we have a Works Entity set that is weak because its key will depend on attributes of Professor, University, and Course
1) Course could be a weak entity set. Knowing the number of the course does not tell us what course it is unless we know what subject it is. 2) The entity set Professor has a Works relationship with the University to teach a Course. If we get rid of the relationship, we have a Works Entity set that is weak because its key will depend on attributes of Professor, University, and Course
2019-10-19

-- Oct 16 In-Class Exercise Thread
 1) Performer (name, instrument, chair) belongs to an orchestra (name, conductor). Performer could be a weak entity set because to uniquely identify one, you need performer name/instrument and the orchestra name.
 2) Eliminating the teach relationship between courses, instructors, and classrooms will result in a weak entity set because the key will come from a combination of keys from courses, instructors, and classrooms.
1) Performer (name, instrument, chair) belongs to an orchestra (name, conductor). Performer could be a weak entity set because to uniquely identify one, you need performer name/instrument and the orchestra name. 2) Eliminating the teach relationship between courses, instructors, and classrooms will result in a weak entity set because the key will come from a combination of keys from courses, instructors, and classrooms.

-- Oct 16 In-Class Exercise Thread
Resource Description for Blank Diagram.jpeg
1) See Top Diagram. A student attends one university and is a weak entity set because the university assigns an id to all students that attend (and in this schema we do not store the student's id number in the students relation).
2) See Bottom Diagram. Assume that Store has attributes: name, location, store_id. Assume product has attributes: company, product_name, amount. Assume price has only one attribute called price. If we were to eliminate the sells multi-way relationship, we would create a new entity set called Sells (which could contain the price as an attribute). Sells would be a weak entity set whose key would bee the product_name attribute from the Product relation and the store_id from the Store relation.
((resource:Blank Diagram.jpeg|Resource Description for Blank Diagram.jpeg)) 1) See Top Diagram. A student attends one university and is a weak entity set because the university assigns an id to all students that attend (and in this schema we do not store the student's id number in the students relation). 2) See Bottom Diagram. Assume that Store has attributes: name, location, store_id. Assume product has attributes: company, product_name, amount. Assume price has only one attribute called price. If we were to eliminate the sells multi-way relationship, we would create a new entity set called Sells (which could contain the price as an attribute). Sells would be a weak entity set whose key would bee the product_name attribute from the Product relation and the store_id from the Store relation.
2019-10-20

-- Oct 16 In-Class Exercise Thread
A bedroom can only exist if it has a house to be inside.
A child can only exist with a parent.
A bedroom can only exist if it has a house to be inside. A child can only exist with a parent.

-- Oct 16 In-Class Exercise Thread
Example 1: In cars, a vehicle from Toyota is designated by its year and model. We could imagine the model as an entity in which Toyota might be a member and its year is the weak entity set of it. We don’t always know the year. We need a key from the model as well. Example 2: A School(name, location) and Class(name, professor) is necessary to create Department(name, class).
Example 1: In cars, a vehicle from Toyota is designated by its year and model. We could imagine the model as an entity in which Toyota might be a member and its year is the weak entity set of it. We don’t always know the year. We need a key from the model as well. Example 2: A School(name, location) and Class(name, professor) is necessary to create Department(name, class).

-- Oct 16 In-Class Exercise Thread
First example of a weak entity could involve a Street entity, that has an attribute that is an entity set for a house which has a street number. If your given a street number for a house, you don't know which house still, because it could be on any street.
Second, we can have a grade relation that needs Assignments and the Weights of those assignments that are held in seperate relations
(Edited: 2019-10-21)
First example of a weak entity could involve a Street entity, that has an attribute that is an entity set for a house which has a street number. If your given a street number for a house, you don't know which house still, because it could be on any street. Second, we can have a grade relation that needs Assignments and the Weights of those assignments that are held in seperate relations

-- Oct 16 In-Class Exercise Thread
1. A weak entity can arise when we say that all birds fly but pengunies don't fly. In this case saying all birds fly would be a weak entity. 2. apartment cannot be identified with just number and without building name. In this case, apartment number would be a a weak entity.
1. A weak entity can arise when we say that all birds fly but pengunies don't fly. In this case saying all birds fly would be a weak entity. 2. apartment cannot be identified with just number and without building name. In this case, apartment number would be a a weak entity.

-- Oct 16 In-Class Exercise Thread
 1. In a situation where the Customer borrows a loan, and Customer contains customer id and customer name. Loan is a weak entity knowing the loan name and customer id.
 2. The entity set customer has a borrows relationship with loan. If we take out the relationship, borrow relationship is weak and depends on customer and loan keys.
1. In a situation where the Customer borrows a loan, and Customer contains customer id and customer name. Loan is a weak entity knowing the loan name and customer id. 2. The entity set customer has a borrows relationship with loan. If we take out the relationship, borrow relationship is weak and depends on customer and loan keys.

-- Oct 16 In-Class Exercise Thread
1. A company insurance policy has an employee and dependents. However, dependents cannot exist without employee. That is, a customer cannot get insurance unless they are a dependent of the employee. Therefore, dependent is the weak entity of this relation.
2. An apartment has buildings. However, the apartment cannot exist without a building, so apartment is the weak entity.
1. A company insurance policy has an employee and dependents. However, dependents cannot exist without employee. That is, a customer cannot get insurance unless they are a dependent of the employee. Therefore, dependent is the weak entity of this relation. 2. An apartment has buildings. However, the apartment cannot exist without a building, so apartment is the weak entity.
X