Computers and Technology

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.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 08:00, jcastronakaya
Apex q: what does a low employment rate indicate? a. not many people are earning high salaries b. not many people are going to college c. not many people are renting their homes d. not many people have jobs
Answers: 2
image
Computers and Technology, 22.06.2019 11:30, mmimay3501
What do character formats do for your document's message? a. set the tone b. provide organization c. provide clarity d. set how texts align with documents
Answers: 2
image
Computers and Technology, 22.06.2019 20:00, jc624826
What side length would you specify if you were required to create a regular hexagonal plate that was composed of 33 cm(squared) of sheet metal? dimension the side length to 0.1 cm
Answers: 2
image
Computers and Technology, 22.06.2019 22:00, delawdermia27
Researchers measured the data speeds for a particular smartphone carrier at 50 airports. the highest speed measured was 78.1 mbps. the complete list of 50 data speeds has a mean of x overbarequals16.11 mbps and a standard deviation of sequals18.65 mbps. a. what is the difference between carrier's highest data speed and the mean of all 50 data speeds? b. how many standard deviations is that [the difference found in part (a)]? c. convert the carrier's highest data speed to a z score. d. if we consider data speeds that convert to z scores between minus2 and 2 to be neither significantly low nor significantly high, is the carrier's highest data speed significant? a. the difference is nothing mbps.
Answers: 3
Do you know the correct answer?
USING MYSQL WORKBENCH

BookStore_Maged Books has become the exclusive distributor for a n...

Questions in other subjects:

Konu
Mathematics, 20.10.2019 21:30