Where, Consider the following Database schema: Company (name, city, country) Dancer (did, name, birthyear, country) Show...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Where, Consider the following Database schema: Company (name, city, country) Dancer (did, name, birthyear, country) Show (sid, title, choreographer, composer, year) Role (did, sid, role, company) [4 marks] Company stores information about dance companies. The attributes name, city, and country are all string; we assume that all companies have unique names. • • Dancer stores information about individual dancers. did is a unique integer id for each dancer, name is a string with the dancer's name, birthyear is an integer, and the dancer's native country is a string. Show stores information about ballet shows (dances). Each show has a unique integer id sid, string attributes for the show title, choreographer, and composer, and an integer year in which the show was created. • Role stores information about which dancers have been in which shows, the name of the role (part) they danced, and the company where they danced that part in that particular show. The dancer and show id's are integers, the role and company names are strings. A dancer may have danced multiple roles in the same show at the same company, or danced the same role in the same show for different companies, and so forth. • Several attributes in Role are foreign keys: did references did in Dancer, sid references sid in Show, and company references name in Company. Write the SQL queries for each of the following: a. Write the CREATE TABLE command needed to create the Dancer and Role tables. b. Write the SELECT query to show, for every dancer who has performed the role Black Swan' in the show "Swan lake' for one or more companies, list the name of the dancer and the company name(s), sorted by dancer name. If the dancer has performed that role for more than one company, there should be one line of output for each dancer, company pair. The companies can be listed in any order. c. Write the SELECT query to List the dancer ids (did) and names of all dancers born on or before 1950 and who have danced in at least three different shows. If a dancer has danced different roles in the same show, it still only counts once in the total number of shows. Each dancer/did pair should only be listed once. d. Write the SELECT query to show, for every dancer who has danced for one or more companies in a different country than where they were bom, list the name of the dancer and the names of those companies. Where, Consider the following Database schema: Company (name, city, country) Dancer (did, name, birthyear, country) Show (sid, title, choreographer, composer, year) Role (did, sid, role, company) [4 marks] Company stores information about dance companies. The attributes name, city, and country are all string; we assume that all companies have unique names. • • Dancer stores information about individual dancers. did is a unique integer id for each dancer, name is a string with the dancer's name, birthyear is an integer, and the dancer's native country is a string. Show stores information about ballet shows (dances). Each show has a unique integer id sid, string attributes for the show title, choreographer, and composer, and an integer year in which the show was created. • Role stores information about which dancers have been in which shows, the name of the role (part) they danced, and the company where they danced that part in that particular show. The dancer and show id's are integers, the role and company names are strings. A dancer may have danced multiple roles in the same show at the same company, or danced the same role in the same show for different companies, and so forth. • Several attributes in Role are foreign keys: did references did in Dancer, sid references sid in Show, and company references name in Company. Write the SQL queries for each of the following: a. Write the CREATE TABLE command needed to create the Dancer and Role tables. b. Write the SELECT query to show, for every dancer who has performed the role Black Swan' in the show "Swan lake' for one or more companies, list the name of the dancer and the company name(s), sorted by dancer name. If the dancer has performed that role for more than one company, there should be one line of output for each dancer, company pair. The companies can be listed in any order. c. Write the SELECT query to List the dancer ids (did) and names of all dancers born on or before 1950 and who have danced in at least three different shows. If a dancer has danced different roles in the same show, it still only counts once in the total number of shows. Each dancer/did pair should only be listed once. d. Write the SELECT query to show, for every dancer who has danced for one or more companies in a different country than where they were bom, list the name of the dancer and the names of those companies.
Expert Answer:
Answer rating: 100% (QA)
Step 1 of 4 a Write the CREATE TABLE command needed to create the Dancer and Role tables 1 CREATE TABLE Dancer 2 3 6 8 CREATE TABLE Role 9 2 13 14 15 ... View the full answer
Related Book For
Database management systems
ISBN: 978-0072465631
3rd edition
Authors: Raghu Ramakrishan, Johannes Gehrke, Scott Selikoff
Posted Date:
Students also viewed these programming questions
-
In each of the following systems, a particle on a horizontal surface is acted on by two forces, F and F2. Find the i and j components of the resultant force, where j represents due north and i...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
The Crazy Eddie fraud may appear smaller and gentler than the massive billion-dollar frauds exposed in recent times, such as Bernie Madoffs Ponzi scheme, frauds in the subprime mortgage market, the...
-
The fieldwork for the 30 June 20X0 audit of Tracy Brewing Company Ltd was finished on 19 August 20X0 and the completed financial statements, accompanied by the signed audit reports, were mailed on 6...
-
Determine the location (xc, yc) of the centroid C of the area. Given: a = 6 in b = 6 in c = 3 in d = 6 in a
-
Personality can and has been defined in a myriad of ways. In preparation for delving into the topic of personality assessment address the following questions: Why measure personality? How do you...
-
For each of the following situations, calculate the \(z\)-statistic \((z)\), make a decision about the null hypothesis (reject, do not reject), and indicate the level of significance \((p>.05, p
-
Sam wants to help his brother, Lou, start a new business. Lou is a capable auto mechanic but has little business sense, so he needs Sam to help him make business decisions. Should this partnership be...
-
what manner does the dialectic between consequentialist utilitarianism and deontological ethics elucidate the ethical complexities inherent in contemporary technological advancements, particularly in...
-
Preparing an Individuals Tax Form. Caleb Lee graduated from college in 2018 and began work as a systems analyst in July of that year. He is preparing to file his income tax return for 2018, and has...
-
Let A= {2, 3, 4}, B= {3, 4, 5, 6}, and suppose the universal set is U= {1, 2, 3, ..,9} List all the elements in the following sets. ..... a) (AUB) b) 4 OB c) d) UC
-
Stanley Corporation has no material problem with uncollectible accounts or obsolete inventory. All sales and purchases are on account. The company provided the following information for the year...
-
Identify three products and three services that are purchased without buyers using the Internet in any way during the buying process. Now identify three products and three services that are purchased...
-
Considering all of the elements of the digital environment covered in this chapter holistically, list the 13 case study organizations in order of the impact of those elements on the organizations....
-
Consider the research results presented in section 3.3 in the Practical insight: A matter of attitude? and reflect on the reasons why IT and marketing opinions differ so widely. Section 3.3 3.3...
-
In section 3.15 on strategic digital marketing the statement is made that: Digital is simply one aspect of a marketing strategy. For some organizations, digital may be the foremost element of its...
-
3: The equilibrium price and quantity of the Y product is P = 15 v Q = 20. At this equilibrium, the demand elasticity is Ep = -0,5 and the supply elasticity is Es = 0,5. The demand and supply curve...
-
Currently, there are five concepts of food stands, including: hot dogs, soft pretzels, turkey legs, sandwich wraps, and funnel cakes. This approach will double the existing number of food stands...
-
Consider a relation R(a, b, c, d) containing 1 million records, where each page of the relation holds 10 records. R is organized as a heap file with unclustered indexes, and the records in R are...
-
Consider the B+ tree index of order d = 2 shown in Figure 10.1. 1. Show the tree that would result from inserting a data entry with key 9 into this tree. 2. Show the B+ tree that would result from...
-
Explain the following terms briefly: attribute, domain, entity, relationship, entity set, relationship set, one-to-many relationship, many-to-many relationship, participation constraint, overlap...
-
1. Describe the bases of power held by Dr. Jamie Thompson. Describe the bases of power held by Dr. Elizabeth Clarke. 2. What activities and people have contributed to Jaime Thompsons power? What...
-
What is the current in the wire in Figure Q22.1? 1.0 VR + 1.0-1.0V + FIGURE Q22.1
-
Electroconvulsive therapy is a last-line treatment for certain mental disorders. In this treatment, an electric current is passed directly through the brain, inducing seizures. The total charge that...
Study smarter with the SolutionInn App