I might have missing something to add. Here are the steps I need help: Write the SQL code that will list all of the drivers in the database that have been issued tickets. Write the SQL code that will list all of the drivers in the database that have not been issued tickets. Write the SQL code that will list all of the drivers in the database that have been issued tickets, along with the total number of tickets that they have been issued and the total amount of fines that they have been charged. Does anyone know how to?

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
icon
Concept explainers
Question

I might have missing something to add. Here are the steps I need help:

  1. Write the SQL code that will list all of the drivers in the database that have been issued tickets.
  2. Write the SQL code that will list all of the drivers in the database that have not been issued tickets.
  3. Write the SQL code that will list all of the drivers in the database that have been issued tickets, along with the total number of tickets that they have been issued and the total amount of fines that they have been charged.

Does anyone know how to?

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
Knowledge Booster
Query Syntax
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.
Similar questions
  • SEE MORE QUESTIONS
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