Write the CREATE TABLE statements needed to implement the following design in the EX schema: members...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write the CREATE TABLE statements needed to implement the following design in the EX schema: members member_id first_name last_name address city state phone members_groups member_id group_id groups group_id group_name These tables provide for members of an association, and each member can be registered in one or more groups within the association. There should be one row for each member in the Members table and one row for each group in the Groups table. The member ID and group ID columns are the primary keys for the Members and Groups tables. And the Members Groups table relates each member to one or more groups. When you create the tables, be sure to include the key constraints. Also, include any null or default constraints that you think are necessary. 4. Write INSERT statements that add two rows to the Members table for member IDs 1 and 2, two rows to the Groups table for group IDs 1 and 2, and three rows to the Members Groups table: one row for member 1 and group 2; one for member 2 and group 1; and one for member 2 and group 2. Then, write a SELECT statement that joins the three tables and retrieves the group name, member last name, and member first name. 5. Create sequences that can be used to number the member ID and group ID values starting with 3 (since you already added members and groups for IDs 1 and 2). 6. Write an INSERT statement that adds another row to the Groups table. This statement should use the NEXTVAL pseudo column to get the value for the next group ID from the sequence that you created in exercise 5. Then, write a SELECT statement that gets all of the data for all of the rows in the Groups table to make sure your sequence worked correctly. 7. Write an ALTER TABLE statement that adds two new columns to the Members table: one column for annual dues that provides for three digits to the left of the decimal point and two to the right; and one column for the payment date. The annual dues column should have a default value of 52.50. 8. Write an ALTER TABLE statement that modifies the Groups table so the group name in each row has to be unique. Then, re-run the INSERT statement that you used in exercise 6 to make sure this works. Write the CREATE TABLE statements needed to implement the following design in the EX schema: members member_id first_name last_name address city state phone members_groups member_id group_id groups group_id group_name These tables provide for members of an association, and each member can be registered in one or more groups within the association. There should be one row for each member in the Members table and one row for each group in the Groups table. The member ID and group ID columns are the primary keys for the Members and Groups tables. And the Members Groups table relates each member to one or more groups. When you create the tables, be sure to include the key constraints. Also, include any null or default constraints that you think are necessary. 4. Write INSERT statements that add two rows to the Members table for member IDs 1 and 2, two rows to the Groups table for group IDs 1 and 2, and three rows to the Members Groups table: one row for member 1 and group 2; one for member 2 and group 1; and one for member 2 and group 2. Then, write a SELECT statement that joins the three tables and retrieves the group name, member last name, and member first name. 5. Create sequences that can be used to number the member ID and group ID values starting with 3 (since you already added members and groups for IDs 1 and 2). 6. Write an INSERT statement that adds another row to the Groups table. This statement should use the NEXTVAL pseudo column to get the value for the next group ID from the sequence that you created in exercise 5. Then, write a SELECT statement that gets all of the data for all of the rows in the Groups table to make sure your sequence worked correctly. 7. Write an ALTER TABLE statement that adds two new columns to the Members table: one column for annual dues that provides for three digits to the left of the decimal point and two to the right; and one column for the payment date. The annual dues column should have a default value of 52.50. 8. Write an ALTER TABLE statement that modifies the Groups table so the group name in each row has to be unique. Then, re-run the INSERT statement that you used in exercise 6 to make sure this works.
Expert Answer:
Answer rating: 100% (QA)
Based on the provided task description and schema heres how you would implement the CREATE TABLE statements INSERT statements SELECT statements and AL... View the full answer
Related Book For
Concepts of Database Management
ISBN: 978-1285427102
8th edition
Authors: Philip J. Pratt, Mary Z. Last
Posted Date:
Students also viewed these databases questions
-
a) Find the set of solutions of each of the linear congruence: i. 8x = 12 (mod 28). ii. 7x = 1 (mod 9). b) Hashing Function is used to assign a memory location for the records in the computer (For...
-
1 ) Describe the key differences between equity and debt 2 ) What is preferred stock? 3 ) Describe the concept of Market Efficiency?
-
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...
-
Read the case study of Statistics regarding the Lawler Grocery Store chain. The use of the sign test is demonstrated in this case study. In your opinion, what is the biggest benefit of the sign test?...
-
Chee purchases Tan, Inc. bonds for $108,000 on January 2, 2015. The face value of the bonds is $100,000, the maturity date is December 31, 2019, and the annual interest rate is 5%. Chee will amortize...
-
The following data come from independent samples drawn from normally distributed populations. Use these data to test the following hypotheses. Let the Type I error rate be .05. H0: 1 - 2 = 0 Ha: 1 -...
-
Exactly two vertices of odd degree Use the graphs and multigraphs in Figure 12.354. Identify any graphs and/or multigraphs with the given characteristics. If there are none, state so.
-
Information pertaining to Hedlund Corporation's property, plant, and equipment for 2011 follows. The salvage value s of the depreciable assets are immaterial. Depreciation is computed to the nearest...
-
On September 1 , the board of directors of Colorado Outfitters, Incorporated, declares and issues a stock dividend on its 2 9 , 0 0 0 , $ 2 0 par, common shares. The market price of the common stock...
-
The following information pertains to the City of Williamson for 2024, its first year of legal existence. For convenience, assume that all transactions are for the general fund, which has three...
-
The Leadership Challenge, you are introduced to the third and fourth of the five practices of effective leadership: challenge the process and enable others to act. According to Kouzes and Posner,...
-
write a program that asks the user to enter the size of the array, then enter and display the array elements. Then check each element of the array to know if it is prime or not
-
What is the formula for activity based costs and how to use it?
-
What is the slope of the line tangent to the curve y-xy+3=5 at the 1 point (1,2)?
-
Elvis was cruising down Main Street in his convertible car when he accidently ran a red light and crashed his car into a passing motorist. Elvis' car then hit a light post. Use the following...
-
What is the amount of sensible heat (in Btu) generated from students in each hour? Assume the average heat release rate from each person is 55 W. Use a conversion factor, 1W=3.41 Btu/h
-
Question 1. [15 marks] Consider the functions fi() and f() in Fig. 1, use the graphical method to compute he convolution f(t) = fi(t) f(t). Figure 1: Functions fi(r) and f(1)
-
Copy and complete the statement. 3800 m ? km =
-
What is locking and what does it accomplish?
-
In Example 23 on page 58, would you get the same result if you performed the PROJECT command before the JOIN command? Why or why not?
-
How can splitting a table improve performance?
-
Moods differ from emotions in what ways?
-
How has emotional intelligence (EI) been found to be beneficial in a work setting?
-
Why could recording your thoughts and feelings in a journal increase your EI?
Study smarter with the SolutionInn App