I got a question on this problem. It says: Create a transaction inside a stored procedure to record a traffic stop – that includes code similar to what you wrote for #13. Pass the details about the traffic stop to the procedure through its parameters. Then call the procedure with a statement similar to this: CALL traffic_stop_transaction (“Jane”, “Jones”, “Waller”, “TX”, “VNR 971”, 1039, “2014-12-25”,”Speeding”) How do I create a transaction?

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

I got a question on this problem. It says:

  1. Create a transaction inside a stored procedure to record a traffic stop – that includes code similar to what you wrote for #13. Pass the details about the traffic stop to the procedure through its parameters. Then call the procedure with a statement similar to this:
    CALL traffic_stop_transaction (“Jane”, “Jones”, “Waller”, “TX”, “VNR 971”, 1039, “2014-12-25”,”Speeding”)

How do I create a transaction?

CREATE TABLE OFFENSE (
OFFENSE VARCHAR (30),
FINE NUMERIC(7),
CONSTRAINT OFFENSE PRIMARY KEY(OFFENSE)
);
CREATE TABLE DRIVERS (
LICENSE_NUMBER VARCHAR(30),
DRIVER_FNAME VARCHAR(30) NOT NULL,
DRIVER_LNAME VARCHAR (30) NOT NULL,
DRIVER_CITY VARCHAR ( 30) NOT NULL,
DRIVER_STATE VARCHAR (18) NOT NULL,
CONSTRAINT PK_LICENSE_NUMBER PRIMARY KEY(LICENSE_NUMBER),
CONSTRAINT UQ_DRIVER_FNAME UNIQUE KEY(DRIVER_FNAME),
CONSTRAINT UQ_DRIVER_LNAME UNIQUE KEY(DRIVER_LNAME)
);
CREATE TABLE TICKETS (
TICKET_NUMBER NUMERIC(10) PRIMARY KEY,
TICKET DATE DATE,
LICENSE_NUMBER VARCHAR (30),
OFFENSE VARCHAR (30),
FOREIGN KEY (LICENSE_NUMBER) REFERENCES DRIVERS (LICENSE_NUMBER),
FOREIGN KEY (OFFENSE) REFERENCES OFFENSE (OFFENSE)
);
Transcribed Image Text:CREATE TABLE OFFENSE ( OFFENSE VARCHAR (30), FINE NUMERIC(7), CONSTRAINT OFFENSE PRIMARY KEY(OFFENSE) ); CREATE TABLE DRIVERS ( LICENSE_NUMBER VARCHAR(30), DRIVER_FNAME VARCHAR(30) NOT NULL, DRIVER_LNAME VARCHAR (30) NOT NULL, DRIVER_CITY VARCHAR ( 30) NOT NULL, DRIVER_STATE VARCHAR (18) NOT NULL, CONSTRAINT PK_LICENSE_NUMBER PRIMARY KEY(LICENSE_NUMBER), CONSTRAINT UQ_DRIVER_FNAME UNIQUE KEY(DRIVER_FNAME), CONSTRAINT UQ_DRIVER_LNAME UNIQUE KEY(DRIVER_LNAME) ); CREATE TABLE TICKETS ( TICKET_NUMBER NUMERIC(10) PRIMARY KEY, TICKET DATE DATE, LICENSE_NUMBER VARCHAR (30), OFFENSE VARCHAR (30), FOREIGN KEY (LICENSE_NUMBER) REFERENCES DRIVERS (LICENSE_NUMBER), FOREIGN KEY (OFFENSE) REFERENCES OFFENSE (OFFENSE) );
License
Driver's
Driver's
Ticket
Number
Driver
City
State
Number Ticket Date
Offense
Fine
МAА 823
Elizabeth Blair
Houston
TX
Henry Newman Pearland
12/3/2014 Failure to Stop
12/3/2014 Parking
12/6/2014 Speeding
1023 12/20/2014 | Parking
GRE 720
TX
1022
30
MVX 322
Eva Mills
Waller
TX
1211
15
MVX 322
Eva Mills
Waller
TX
1212
65
E. Mills
Stephen Sholes Pearland
MVX 322
Waller
TX
15
ARG 595
TX
1024 12/21/2014 Speeding
1025 12/21/2014 Red Light
1027 12/22/2014 Parking
1225 12/22/2014 Speeding
1037 12/23/2014 Red Light
RVX 287
Rod Brooks
Bellaire
TX
65
RVX 287
Rod Brooks
Bellaire
TX
50
TGY 832
Luci Silva
Sugarland
TX
15
КЕС 654
Richard Pence
Houston
TX
65
MVX 322
E. Mills
Waller
TX
50
Transcribed Image Text:License Driver's Driver's Ticket Number Driver City State Number Ticket Date Offense Fine МAА 823 Elizabeth Blair Houston TX Henry Newman Pearland 12/3/2014 Failure to Stop 12/3/2014 Parking 12/6/2014 Speeding 1023 12/20/2014 | Parking GRE 720 TX 1022 30 MVX 322 Eva Mills Waller TX 1211 15 MVX 322 Eva Mills Waller TX 1212 65 E. Mills Stephen Sholes Pearland MVX 322 Waller TX 15 ARG 595 TX 1024 12/21/2014 Speeding 1025 12/21/2014 Red Light 1027 12/22/2014 Parking 1225 12/22/2014 Speeding 1037 12/23/2014 Red Light RVX 287 Rod Brooks Bellaire TX 65 RVX 287 Rod Brooks Bellaire TX 50 TGY 832 Luci Silva Sugarland TX 15 КЕС 654 Richard Pence Houston TX 65 MVX 322 E. Mills Waller TX 50
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY