Write an alter table statement

Assignment Help Database Management System
Reference no: EM131235547

Exercises

1. Use MySQL Workbench to create an EER diagram for a database that stores information about products.

Each product must have a product name, description, and price.

Each product must belong to one category.

Each category must have a category name and description.

Each category can include multiple products.

2. Use MySQL Workbench to create an EER diagram for a database that stores information about customers.

Each customer must have an email address, first name, and last name.

Each customer can have two or more addresses.

Each customer can have a default billing address and a default shipping address.

Each address must have a street address, city, state, postal code, and country.

Each country name should be stored in one place only. In other words, you shouldn't store the name of the country, which may be many characters, in the address.

3. Use MySQL Workbench to create an EER diagram for a database that tracks the memberships for an association and for the groups within the association.

Each member must have an email address, first name, and last name.

Each member can belong to any number of groups.

Each group must have a name.

Each group can have any number of members.

Exercises

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

2. Write a script that contains the CREATE TABLE statements needed to implement the following design in the EX database:

1344_Figure.png

These tables provide for members of an association, and each member can be re6stered 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 Niembers_Groups table.

Include any constraints or default values that you think are necessary. Include statements to drop the tables if they already exist.

3. 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 name, member last name, and member first name. Sort the results by the group name, member last name, and member first name.

4. 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.

Add one column for the payment date.

5. 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.

Attachment:- Assignment.rar

Reference no: EM131235547

Questions Cloud

Negative outcomes on multinationals and other stakeholders : Free-floating currency can have positive and negative outcomes on multinationals and other stakeholders. Should global decision makers be able to manipulate currency rates? If yes, when is it appropriate to do so and what global criteria should be..
What is the organization current business model : What is the organization's current business model? Did you make any financial adjustments that go against the way the organization planned its finances in the past? If so, what were they, and why did you make the changes?
What was the marginal investors tax rate : If your tax rate is 40%, what interest rate do you earn in after-tax terms if the before-tax interest rate is 6%? - What was the marginal investor's tax rate?
Current interest rate for newly issued bonds : Determine the yield to maturity on a 10-year 6% bond selling at par if the going rate (current interest rate for newly issued bonds of the same quality rating) is 6%? This is a think question; not a calculation question. Briefly explain how you re..
Write an alter table statement : 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 defa..
Prevent the bankruptcy of a customer : Cash application should be done as quickly as  possible by a seller because:
Different type of customers involved in the process : Think of a “supply chain” for filling a doctor’s prescription. Please describe the following; Describe the different type of customers involved in the process. Build a strategy for determining the Voice of the customer and tracking how well their nee..
Difference in the obligation of one with a long position : What is the major difference in the obligation of one with a long position in a futures (or forward) contract in comparison to an options contract? Do they have any risk for the investors?
Nonprofit organizations contribute to society : How can you find some middle ground in this debate to show that both businesspeople and those who work for nonprofit organizations contribute to society and need to work together more closely to help people

Reviews

Write a Review

Database Management System Questions & Answers

  Describing the purpose of database an its functionality

Describing the purpose of database an its functionality, plus a detailed E-R diagram.

  Display the last name and phone number of all dog owners

Display the last name and phone number of all dog owners. Use a subquery to do this. Display the first and last name of owners and the type of animal of all unknown breeds. Display the pet name and owner last name of all dogs.

  Data modeling and normalization

Data Modeling and Normalization

  An electricity supply authority records on an electricity

At the end of the program, compare the total electricity usage accumulated in the program with the value provided in the header record, and print an appropriate message if the totals are not equal.

  Compare the pros and cons of consolidating data

Compare the pros and cons of consolidating data on a SAN central data facility versus the dispersed arrangement it replaces. Evaluate the issues raised from the Carlson SAN mixing equipment from a number of vendors and determine the management option..

  Database management system and database design

To what extent should end users be involved in the selection of a database management system and database design

  What is the difference between database and data warehouse

What is the difference between database and data warehouse? What is OLAP? What is a data cube? How do DSS take advantage of the structure?

  Explain the level of normalization

Use Microsoft Access to create the keys and relationships between tables for the Huffman Trucking Driver Log.

  Describe a database and its various elements

Describe a database and its various elements. Define Primary Key, foreign key, and metadata.

  Design an expanded entity relationship model diagram

You are to design an Expanded Entity Relationship Model Diagram. An example of the Expanded Entity Relationship Model Diagram is seen in Figure 3.27 on page 89.

  Create stored procedure to updates members balance

Create a stored procedure that updates the members' balance in the membership table by correctly recording the current or outstanding balance for each customer.

  Create a fully attributed loagical data model diagram

Create Conceptual Schema Diagram. Create a fully attributed Loagical Data Model Diagram. Create the SQL script that will generate atleast 4 tables in the data model that you have created.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd