subject

USING MYSQL WORKBENCH

BookStore_Maged Books has become the exclusive distributor for a number of books. The company now needs to assign sales representatives to retail bookstores to handle the new distribution duties.

For these assignments, create new tables to support the following:

1. Modify the following SQL command so that the Rep_ID column is the PRIMARY KEY for the table and the default value of Y is assigned to the Comm column. (The Comm column indicates whether the sales representative earns commission.)

1.

CREATE TABLE store_reps

(rep_ID int(5),

last VARCHAR(15),

first VARCHAR(10),

comm CHAR(1));

2.

Change the STORE_REPS table so that NULL values can’t be entered in the name columns (First and Last).



Answer

3.

Change the STORE_REPS table so that only a Y or N can be entered in the Comm column.



4.

Add a column named Base_salary with a datatype of decimal(7,2) to the STORE_REPS table. Ensure that the amount entered is above zero.



5.

Create a table named BOOK_STORES to include the columns listed in the following chart.

Column Name Datatype Constraint Comments

Store_ID int(8) PRIMARY KEY column

Name VARCHAR(30) Should be UNIQUE and NOT NULL

Contact VARCHAR(30)

Rep_ID VARCHAR(5)



6.

Add a constraint to make sure the Rep_ID value entered in the BOOK_STORES table is a valid value contained in the STORE_REPS table. The Rep_ID columns of both tables were initially created as different datatypes. Does this cause an error when adding the constraint? Make table modifications as needed so that you can add the required constraint.



7.

Change the constraint created in Assignment #6 so that associated rows of the

BOOK_STORES table are deleted automatically if a row in the STORE_REPS table is deleted.



8.

Create a table named REP_CONTRACTS containing the columns listed in the following chart. A composite PRIMARY KEY constraint including the Rep_ID, Store_ID, and Quarter columns should be assigned. In addition, FOREIGN KEY constraints should be assigned to both the Rep_ID and Store_ID columns.



9.

Produce a list of information about all existing constraints on the STORE_REPS table.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:10
David is in week 3 of his current ashford course and has a paper due by monday night at midnight. he has finished everything but the concluding paragraph. as he boots up his computer to work on it, he sees a flash across the screen and then the screen goes black. he begins to panic as he tries desperately to turn the laptop back on. david should have saved his work on what kind of portable device?
Answers: 2
question
Computers and Technology, 22.06.2019 21:30
Elements such as fonts colors visual structure graphics and the interface of a web page should complement each other to ensure blank
Answers: 3
question
Computers and Technology, 23.06.2019 01:40
You have a linux system that has a 1000gb hard disk drive, which has a 90gb partition containing an ext4 filesystem mounted to the / directory and a 4gb swap partition. currently, this linux system is only used by a few users for storing small files; however, the department manager wants to upgrade this system and use it to run a database application that will be used by 100 users. the database application and the associated data will take up over 200gb of hard disk space. in addition, these 100 users will store their personal files on the hard disk of the system. each user must have a maximum of 5gb of storage space. the department manager has made it very clear that this system must not exhibit any downtime as a result of hard disk errors. how much hard disk space will you require, and what partitions would you need to ensure that the system will perform as needed? where would these partitions be mounted? what quotas would you implement? what commands would you need to run and what entries to /etc/fstab would you need to create? justify your answers.
Answers: 3
question
Computers and Technology, 24.06.2019 16:00
5.a fishing rod is formed from a composite material of 0.5 kg of glass fibers embedded in a matrix of 0.5 kg of epoxy resin. the glass fibers are assumed to be long, continuous and unidirectional. to achieve a greater stiffness it is proposed to use a different composite that is comprised of long continuous carbon fibers that will be embedded in a matrix of 0.5 kg of epoxy resin. if the modulus of elasticity of the carbon fiber composite is 10% greater than the elastic modulus of the glass fiber composite, estimate the mass of carbon fibers that will be used to make the carbon fiber composite. assume the applied tensile stress is parallel to the direction of the long axis of the fibers. the epoxy resin, glass fiber, and carbon fiber have an elastic modulus of 5, 86, and 350 gpa respectively and a density of 1100, 2500, and 1800 respectively.
Answers: 3
You know the right answer?
USING MYSQL WORKBENCH

BookStore_Maged Books has become the exclusive distributor for a n...
Questions
question
English, 28.08.2019 17:30
question
History, 28.08.2019 17:30
Questions on the website: 13722361