Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

MYSQL Exercises 1. Write a script that adds an index to the AP database for the zip code field in the Vendors table Write a

image text in transcribed

MYSQL

Exercises 1. Write a script that adds an index to the AP database for the zip code field in the Vendors table Write a script that contains the CREATE TABLE statements needed to imple- ment the following design in the EX database: 2. members members groups groups member idmember id first name last name address city state phone group_id group name group _id These tables provide for members of an association, and each member can be registered in one or more groups within the association. The member_id and group id columns are the primary keys of the Members and Groups tables, and these columns are foreign keys in the Members Groups table. Include any constraints or default values that you think are necessary Include statements to drop the tables if they already exist. Write INSERT statements that add rows to the tables that are created in exercise 2 Add two rows to the Members table for the first two member IDs. Add two rows to the Groups table for the first two group IDs. Add three rows to the Group_Membership table: one row for member 1 and group 2: one for member 2 and group 1: and one for member 2 and group 2. Write a SELECT statement that joins the three tables and retrieves the group 3. name, member last name, and member first name. Sort the results by the group name. member last name, and member first name. Write an ALTER TABLE statement that adds two new columns to the Members table created in exercise 2 Add one column for annual dues that provides for three digits to the left of the decimal point and two to the right. This column should have a default value of 52.50. 4. Add one column for the payment date. Write an ALTER TABLE statement that modifies the Groups table created in exercise 2 so the group name in each row has to be unique. Then, use an INSERT statement to attempt to insert a duplicate name. This statement should fail due to the unique constraint. 5

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Readings In Database Systems

Authors: Michael Stonebraker

2nd Edition

0934613656, 9780934613651

More Books

Students also viewed these Databases questions

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago