
Concept explainers
Problem 20.a
Using MySQL, create a table named CUST_MYSQL with the same fields as in Problem 16, except, use the AUTO_INCREMENT feature for the CUST_NUM field.
Problem 20.b
Using MySQL, alter the table to populate the CUST_NUM field, beginning the increment with 2000.
Problem 20.c
Using MySQL, populate the CUST_LNAME, CUST_FNAME, and CUST_BALANCE fields with the following customers:
CUST_LNAME | CUST_FNAME | CUST_BALANCE |
---|---|---|
Smith | Jeanne | 1050.11 |
Ortega | Juan | 840.92 |
Problem 21.a
Using MySQL, create a table named INV_MYSQL with the same fields as in Problem 17, except, use the AUTO_INCREMENT feature for the INV_NUM field. Do not create a FOREIGN KEY constraint.
Problem 21.b
Using MySQL, alter the table to populate the INV_NUM field, beginning the increment with 9000.
Problem 21.c
Populate the CUST_NUM, INV_DATE, and INV_AMOUNT fields with the following customers:
CUST_NUM | INV_DATE | INV_AMOUNT |
---|---|---|
1000 | 2016-03-23 | 235.89 |
1001 | 2016-03-23 | 312.82 |
1001 | 2016-03-30 | 528.10 |
1000 | 2016-04-12 | 194.78 |
1000 | 2016-04-23 | 619.44 |
Problem 22
Insert the following customer into the CUST_MYSQL table, allowing the AUTO_INCREMENT attribute set up in Problem 20.a and Problem 20.b to generate the customer number automatically:
CUST_LNAME | CUST_FNAME | CUST_BALANCE |
---|---|---|
Powers | Ruth | 500 |

Trending nowThis is a popular solution!
Step by stepSolved in 2 steps

- write MySQL functions to accomplish the following tasks: A:Delete the order whose number is stored in I_ORDER_NUM. B: Change the date of the order whose number is stored in I_ORDER_NUM to the date currently found in I_ORDER_DATE. C: Retrieve and output the item number, description, storehouse number, and unit price of every item in the category stored in I_CATEGORY.arrow_forwardWrite a procedure named prc_inv_add to add a new invoice record to the INV_MYSQL table. Use the following values in the new record: INV_NUM CUST_NUM INV_DATE INV_AMOUNT 9006 2000 2018-04-30 301.72 (You should execute the procedure and verify that the new invoice was added to ensure your code is correct.)arrow_forwardHi, This is what I have, but I am stuck with what to write and not sure if my function is even correct, to begin with. Can someone show me a walk-through solution? MUST USE postgreSQL CREATE TABLE instructor_course_nums (ID VARCHAR(25), name VARCHAR(25), tot_courses VARCHAR(25)); CREATE OR REPLACE PROCEDURE calculate_instr_course(ID VARCHAR(25), name VARCHAR(25), tot_courses VARCHAR(25))LANGUAGE plpgsqlAS$$BEGIN END;$$;arrow_forward
- Task 6: The Car Maintenance team considered that the available maintenance tasks should also have the price information in the database. Alter the MAINTENANCE_TYPES table to include a new column named MAINTENANCE_PRICE of type FLOAT. ANSWER IN MYSQL PLEASEarrow_forwardCorrect Query from table given.arrow_forwardCreate LessonSchedule table with FK constraints in mysql database Two tables are created: Horse with columns: ID - integer, primary key RegisteredName - variable-length string Student with columns: ID - integer, primary key FirstName - variable-length string LastName - variable-length string Create the LessonSchedule table with columns: HorseID - integer with range 0 to 65 thousand, not NULL, partial primary key, foreign key references Horse(ID) StudentID - integer with range 0 to 65 thousand, foreign key references Student(ID) LessonDateTime - date/time, not NULL, partial primary key If a row is deleted from Horse, the rows with the same horse ID should be deleted from LessonSchedule automatically. If a row is deleted from Student, the same student IDs should be set to NULL in LessonSchedule automatically.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





