Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Bartleby Related Questions Icon
Related questions
bartleby
Concept explainers
Question
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?
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)
);
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
Check MarkThis question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
bartleby
This is a popular solution
bartleby
Trending nowThis is a popular solution!
bartleby
Step by stepSolved in 2 steps
Knowledge Booster
Background pattern image
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
- SQL question helparrow_forwardThe SQL statement below is used to select students with the last name "Smith". What is wrong with the statement? SELECT FirstName FROM Student WHERE LastName = Smith; The literal "Smith" must be surrounded by single quotes or double quotes. The WHERE clause should be removed. The last name "Smith" may not exist in the database.arrow_forwardSQL CODE FOR For the players who show up in Batting, Bowling, and Fielding tables, create a list that shows their names, runs they have scored, wickets they have taken, and catches they have taken? table is in picture (bowling table is same as batting and fielding )arrow_forward
- Imagine that you are a database manager at a company that makes custom shirts. One column in the database lists the wholesale price of the shirts. A second column lists the labor charge, which is currently set to 11 percent of the wholesale price of the shirt. A third column lists the retail price of the shirt, which is the combination of the wholesale price and the labor charge. Write the statements that calculate the values that belongs in the second and third columns. How could you use a query to format these columns?arrow_forwardDatabase: CUSTOMER (CustomerID, LastName, FIrstName, Phone, EmailAddress) PURCHASE (InvoiceNumber, InvoiceDate, PreTaxAmount, CustomerID) PURCHASE_ITEM (InvoiceNumber, InvoiceLineNumber, Item Number, RetailPrice) ITEM (ItemNumber, ItemDesciption, Cost, ArtistLastName, ArtistFirstName) Write an SQL statement to show which cutomers bought which items, and include any items that have not been sold. Include CUSTOMER.LastName, CUSTOMER.FirstName, IvoiceNumber, InvoiceDate, ItemNumber, ItemDescription, ArtistLastName, and ArtistFirstName,. Use a join using JOIN ON syntax, and sort the results by ArtistLastName and ArtistFirstName in ascending order. Note that in Microsoft Access this require multiple queries. From Database Concepts 9th Ed. (Kroenke)arrow_forwardT-SQL procedure A: obtain the name and credit limit of the customer whose number currently is stored in I_CUSTOMER_NUM. Place these valuse in the variables I_CUSTOMER_NAME and I_CREDIT_LIMIT, respectively. Output the content of I_CUSTOMER_NAME and I_CREDIT_LIMIT. B: obtain the order date, customer number and name for the order whose number currently is stored in I_ORDER_NUM. place these values in the variables I_ORDER_DATE, I_CUSTOMER_NUM and I_CUSTOMER_NAME , respectively. output the contents of I_ORDER_DATE, I_CUSTOMER_NUM , and I_CUSTOMER_NAME. C: add a row to the ORDERS table. D: change the date of the whole number is stored in I_ORDER_DATE to the date currently found in I_ORDER_DATE. E: delete the order whose number is stored in I_ORDER_NUM.arrow_forward
- Need help writing SQL queries for sample data basearrow_forwardTrying to write SQL statements for these shown here and having issues with them working. Explanation on this would be appreciated.arrow_forwardWrite SQL code for the following: Create a stored procedure "setRelocationFee" to set the relocation fee for a givenemployee. If the employee’s office is in San Francisco, the relocation fee is 10000ドル; ifthe employee’s office is in Boston, the relocation fee is 8000ドル; if the employee’s officeis in London, the relocation fee is 20000ドル; if the employee works in other offices, therelocation fee is 15000ドル. (see image for table structure) I am stuck for the part that I have to select employeeNumber and officeCode and set the relocationFee to be able to obtain the result but I do not know how. Bellow is what I have gotten. Delimiter| CREATE PROCEDURE setRealocationFee(IN EmployeeID INT(11), OUT realocationFee INT(5))arrow_forward
- Database: https://www.w3schools.com/sql/trysql.asp?filename=trysql_select_allarrow_forwardAdjust the following information so that1) all users on the system are able to run the SQL Executable and 2) multiple users (such as a team of software engineers) have the power to modify the SQL Executable Introduce any new groups that are needed and assign them group IDs USERS SQL Manager UID: 3 GROUPS SQL Users GID: 5 FILESDatabase File Owner 3 Group NA owner: rw group: - world: - setUID: 0 setGID: 0 sticky: 0 SQL Executable Owner 3 Group 5 owner: rwx group: r-x world: - setUID: 1 setGID: 0 sticky: 0arrow_forwardYou have the following tables: MANAGERS (MANAGER_ID, LAST_NAME, FIRST_NAME, DEPARTMENT) ACCOUNTS (ACCOUNT_NUMBER, MANAGER_ID, CUST_ID, BALANCE) CUSTOMERS (CUST_ID, LAST_NAME, FIRST_NAME) Write a SQL statement that lists account number, balance, MANAGER’s last name, CUSTOMER ID, and CUSTOMER’s last name for every account in the ACCOUNTS table.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Text book imageDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationText book imageStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONText book imageDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- Text book imageC How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONText book imageDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningText book imageProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education