design a database for a movie Industry your design should include at least the following entities and their relationships
(A) the entities are Movies / MovisStars / MovieExec / Presidents / Studios/crews and so forth
1. The Movies entity set has attributes: title/year/length/genre / studioName / producerC#. We assume that the movie would not be remade within the same year, so it has the key consisting of little and year.
2. The MovieStars entity set has attributes: name/address/gender and birthdate. It has the key name
3. Both MovieExec and Presidents entity set have same attributes: name/address/cert # and networth. It has the key cert#
4. The Studios entity set has attributes: name/address and presC#. It has the key name
5. The Crews entity set has attributes: number and crewchief A movie studio might have several film crews. The crews might be designated by a given studio as crew1 / crew2 and so on However other studios might use the same designation for crews so the attributes number is not a key Rather to name a crew uniquely we need to give both the same of the studio to which it belongs and the number of the crew.
(B) The relationship are Stars-In, Owns, Rans, Contracts, Contract1, Contracts, Contracts2, Sequel-of, Unit-of, and so forth
1. Stars-in is a binary relationship connecting each movie to the stars of that movie The relationship consequently also connects stars to the movies in which they appeared
2. Owns is a binary relationship that connects each movie to the studio owns the movie. We assume that every movie must be owned by one studio and that this studio in present in the Studios entity set: (Note that this assumption is the referential integrity constraint )
3. Runs is a binary relationship between entity sets Studios and Presidents. We assume that every president runs a studio that exists in the Studios entity set. i.e. a president is surely associated with some studio(Note that this assumption is the referential integrity constraint) We also assume that each studio has at most one president but might have no president at some time.
4.Contracts1 is a three-way relationship that involves a studio, a star, and a movie. For a particular star and movie, there is only one studio with which the star has contracted for that movie. However, a studio may contract with several stars for a movie and a star may contract with one studio for more than one movie. We also wish to record the attribute salary with this contract. 5. Sequel-of is a relationship between the entity set Movies and itself. To differentiate the two movies in a relationship, one line is labeled by the role Original and one by the role Seguel, indicating the original movie and it sequel We assume that a movie may have many sequels, but for each sequel, there is only one original movie
6.Contacts2 in a relationship that includes a four-way relationship and an entity set with multiple rules. Now, relationship Contracts2 involves two studios, a star, and a movie. The intent is that one studio, having a certain star under contract ( in general, not for a particular movie), may further contract with a second studio to allow that star to act in a particular movie. Thus, the relationship is described by 4-tuples of the form (studio1, studio2, star , movie) meaning that studio2 contracts with studio1 for the use of studio1's star by studio2 for the movie. We indicate the two roles of Studios as"owner of the star and as "producer" of the movie
The rationale is as follows Given a star, a movie, and a studio producing the movie(i.e., studio2), there can be only one studio (ie. studio1), that "owns" the star. Similarly, given a star, a movie, and the star's studio(i.e., studio1) we can determine a unique producing studio (i.e., studio2) only one studio produces a given movie. Note that in both cases we actually need only one of the other entries to determine the unique entry-for example, we need only know the movie to determine the unique producing studio this fact does not change the multiplicity specification for the multiway relationship. Given a star, the star's studio, a producing studio there could be several different contracts allowing the star to act in several movies.Thus, the other three components in a relationship 4-tuple do not necessarily determine a unique movie.Similarly, a producing studio might contract with some other studio to use more than one of their stars in one movie. Thus a star is not determined by the three other components of the relationship.
7. Unit-of is an identifying relationship that helps provide the key for the weak entity set Crews .The key for weak entity set Crews is its own number attribute ane the name attribute of the unique studio to which the crew is related by the Unit-of relationship.
your project report should include:
1)write an E-R diagram for the movie database
2)write the database schema for your E-R diagram
3)list at least 5 sample queries in SQL and
4)answer those queries you list