The Car Maintenance team wants to add Tire Change (ID: 1) maintenance task for all cars with the due date of 1 September, 2020. However, the team also wants to know chat if an error occurs the updates will rollback to their previous state. Create a script or them to first add all tasks and then rollback the changes.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Database Question  using SQL 

Task 2:
The Car Maintenance team wants to add Tire Change (ID: 1) maintenance task for all
cars with the due date of 1 September, 2020. However, the team also wants to know
that if an error occurs the updates will rollback to their previous state. Create a script
for them to first add all tasks and then rollback the changes.
Task
Add a tire change maintenance task for every car and rollback the changes.
<>
Transcribed Image Text:Task 2: The Car Maintenance team wants to add Tire Change (ID: 1) maintenance task for all cars with the due date of 1 September, 2020. However, the team also wants to know that if an error occurs the updates will rollback to their previous state. Create a script for them to first add all tasks and then rollback the changes. Task Add a tire change maintenance task for every car and rollback the changes. <>
Expected Results
CAR_ID
MAINTENANCE_TYPE_ID
MAINTENANCE_DUE
1001
1
2020-09-01
1001
2020-12-31
1002
2020-09-01
1003
1
2020-09-01
1004
1
2020-09-01
1001
2
2020-06-01
1003
2
2020-06-01
Transcribed Image Text:Expected Results CAR_ID MAINTENANCE_TYPE_ID MAINTENANCE_DUE 1001 1 2020-09-01 1001 2020-12-31 1002 2020-09-01 1003 1 2020-09-01 1004 1 2020-09-01 1001 2 2020-06-01 1003 2 2020-06-01
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

This doesn't have the rollback or insert it into the maintenances table

Solution
Bartleby Expert
SEE SOLUTION
Follow-up Question

You are assigned as the database administrator to collect and manage transactional data of the InstantRide operations. Your main task is to create SQL scripts to help other teams to retrieve the requested data. In the following activities, you will create the scripts, run against the database and send the result to the corresponding teams.

Car Maintenance team wants to add new maintenance tasks to the MAINTENANCES table which was created in Chapter 8, Activity 1. However, the team also wants to insert the tasks in a batch into the database. In other words, they want to insert the rows all together without inserting one-by-one. Therefore, you will need to create a script to add the following tasks and ensure that they are added together:

  • Car ID: 1001, Maintenance Type: 2, Due: 2020-06-01
  • Car ID: 1003, Maintenance Type: 2, Due: 2020-06-01
Solution
Bartleby Expert
SEE SOLUTION
Knowledge Booster
Database Functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education