write the SQL statements to do the following: a. Modify the CUSTOMER table so the customer number
Question:
write the SQL statements to do the following:
a. Modify the CUSTOMER table so the customer number field is set to auto increment and the auto increment value is set to 2000. (Note: The INVOICE table will need to be modified first to remove the foreign key constraint on the customer number. After the auto increment value property has been added to the customer number field, add the foreign key constraint back to the INVOICE table).
b. Modify the INVOICE table so the invoice number field is set to auto increment and the auto increment value is set to 9000.
Save all the SQL statements as a script. Copy and paste an image of the script after a successful run showing the SQL statements and all the log results below (no results grid will be displayed).
The MySQL command to remove a foreign key constraint has the following format:
ALTER TABLE tbl_name DROP FOREIGN KEY constraint_name;
(The constraint_name can be found in the table properties under the foreign keys tab)
The MySQL command to modify a column to be auto increment has the following format:
ALTER TABLE tbl_name MODIFY COLUMN col_name col_type AUTO_INCREMENT;
The MySQL command to set an auto increment value has the following format:
ALTER TABLE tbl_name AUTO_INCREMENT = value;
The MySQL command to add a foreign key constraint has the following format:
ALTER TABLE tbl_name ADD FOREIGN KEY (col_name) REFERENCES tbl_name(col_name);
ch08_simpleco database schema created in problem 1:
Concepts of Database Management
ISBN: 978-1285427102
8th edition
Authors: Philip J. Pratt, Mary Z. Last