Starting Out with Java: From Control Structures through Objects (6th Edition)
6th Edition
ISBN: 9780133957051
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 17.5, Problem 17.23CP
The Midnight Coffee Roastery is running a special on decaf coffee. Write an SQL statement that changes the price of all decaf coffees to 4.95.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
TAL Distributors would like to know the number of months between the current date and the order date of an order. Write an SQL statement in MySQL that displays the order number and the number of months between the current date and the order date. The number of months should display as an integer. (Hint: You can nest one function within another function.) This is the code I haveSELECT FLOOR(MONTHS_BETWEEN(CURRENT_DATE,To_date(ORDER_DATE, 'MM/DD/YYYY')))num_monthsFROM ORDERS;is giving me an errorError Code: 1305. FUNCTION tal.MONTHS_BETWEEN does not exist
You are in charge of creating a small database for a store that sells goods so that it can keep track of its customers and their orders.
Write an SQL statement to create a customer table containing the following information:
Every customer has a unique ID, that should not be empty and set as the primary key
The customer's first and last name that shouldn't be empty
The phone number that shouldn't be empty
The email, which could be empty.
The address, which could be empty.
Write a SQL statement to create the table Orders, which will keep track of customer orders, using the following information:
Each order has a unique ID, which shouldn't be empty and should be set as the primary key.
The customer's ID and should not be empty and assign it as the foreign key of the customer ID in table customer.
The Items purchased by the customer and shouldn't be left empty.
The amount of each item, and should not be empty
The price of the items, and should not be empty
PATHS is a table that contains information about paths on a number line. The
structure of PATHS is as follows, where x1 and x2 represent that there is a path
from Coordinate x1 to Coordinate x2 (You can't move from Coordinate x2 to
Coordinate x1 ).
NAME
ΤΥΡE
NULLABLE
X1
INT
FALSE
X2
INT
FALSE
Problem
Please write an SQL statement that returns the beginning and end point of each
path in PATHS . Sort them by the value of the beginning point in ascending order.
Constraints
• In the case where a direct path from Coordinate a to Coordinate b is
available, no path from Coordinate b to Coordinate a will be given.
|x1-x2| = 1
• No path will overlap with one another.
Example
Suppose that PATHS is as follows:
x1
x2
1
2
2
3
4
7
7
6
This table can be visualized as follows:
START
END
END
START
7
8.
9
Therefore, your SQL statement must return the following:
start
end
1
4
8
6
Chapter 17 Solutions
Starting Out with Java: From Control Structures through Objects (6th Edition)
Ch. 17.1 - Why do most businesses use a DBMS to store their...Ch. 17.1 - When a Java programmer uses a DBMS to store and...Ch. 17.1 - Prob. 17.3CPCh. 17.1 - Prob. 17.4CPCh. 17.1 - Prob. 17.5CPCh. 17.1 - Prob. 17.6CPCh. 17.1 - What static JDBC method do you call to get a...Ch. 17.2 - Describe how the data that is stored in a table is...Ch. 17.2 - What is a primary key?Ch. 17.2 - What Java data types correspond with the following...
Ch. 17.3 - Prob. 17.11CPCh. 17.3 - Prob. 17.12CPCh. 17.3 - Prob. 17.13CPCh. 17.3 - Prob. 17.14CPCh. 17.3 - What is the purpose of the % symbol in a character...Ch. 17.3 - How can you sort the results of a SELECT statement...Ch. 17.3 - Assume that the following declarations exist:...Ch. 17.3 - How do you submit a SELECT statement to the DBMS?Ch. 17.3 - Prob. 17.19CPCh. 17.3 - Prob. 17.20CPCh. 17.4 - Prob. 17.21CPCh. 17.4 - Prob. 17.22CPCh. 17.5 - The Midnight Coffee Roastery is running a special...Ch. 17.5 - Prob. 17.24CPCh. 17.6 - Prob. 17.25CPCh. 17.6 - Write a statement to delete the Book table you...Ch. 17 - Prob. 1MCCh. 17 - This is a standard language for working with...Ch. 17 - Prob. 3MCCh. 17 - The data that is stored in a row is divided...Ch. 17 - This is a column that holds a unique value for...Ch. 17 - This type of SQL statement is used to retrieve...Ch. 17 - This contains the results of an SQL SELECT...Ch. 17 - This clause allows you to specify search criteria...Ch. 17 - Prob. 9MCCh. 17 - Prob. 10MCCh. 17 - Prob. 11MCCh. 17 - Prob. 12MCCh. 17 - This method is specified in the Statement...Ch. 17 - This SQL statement is used to insert rows into a...Ch. 17 - This SQL statement is used to remove rows from a...Ch. 17 - Prob. 16MCCh. 17 - Prob. 17MCCh. 17 - True/False: Java comes with its own built-in DBMS.Ch. 17 - True/False: A Java programmer that uses a DBMS to...Ch. 17 - True/False: You use SQL instead of Java to write...Ch. 17 - True/False: In SQL, the not-equal-to operator is...Ch. 17 - Prob. 22TFCh. 17 - Prob. 23TFCh. 17 - Prob. 24TFCh. 17 - Prob. 1FTECh. 17 - Prob. 2FTECh. 17 - Prob. 3FTECh. 17 - What SQL data types correspond with the following...Ch. 17 - Look at the following SQL statement. SELECT Name...Ch. 17 - Write a SELECT statement that will return all of...Ch. 17 - Write a SELECT statement that will return the...Ch. 17 - Prob. 5AWCh. 17 - Write a SELECT statement that will return the...Ch. 17 - Write a SELECT statement that will return all of...Ch. 17 - Write a SELECT statement that will return the...Ch. 17 - Write a SELECT statement that will return the...Ch. 17 - Prob. 10AWCh. 17 - Write an SQL statement that does the following:...Ch. 17 - Prob. 12AWCh. 17 - Prob. 13AWCh. 17 - Assuming that conn references a valid Connection...Ch. 17 - Prob. 17AWCh. 17 - Prob. 18AWCh. 17 - Prob. 19AWCh. 17 - Prob. 1SACh. 17 - Prob. 2SACh. 17 - Prob. 3SACh. 17 - What is a primary key?Ch. 17 - Prob. 5SACh. 17 - What are the relational operators in SQL for the...Ch. 17 - What is the number of the first row in a table?...Ch. 17 - Prob. 8SACh. 17 - Prob. 9SACh. 17 - Customer Inserter Write an application that...Ch. 17 - Customer Updater Write an application that...Ch. 17 - Unpaid Order Sum Write an application that...Ch. 17 - Population Database Make sure you have downloaded...Ch. 17 - Personnel Database Creator Write an application...Ch. 17 - Employee Inserter Write a GUI application that...Ch. 17 - Employee Updater Write a GUI application that...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
Prime Number List This exercise assumes that you have already written the is_prime function in Programming Exer...
Starting Out with Python (4th Edition)
Explain the difference between redundancy and diversity.
Software Engineering (10th Edition)
List in chronological order the major events that take place when a process is interrupted.
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
This problem concerns the m. o module from Figure 7.5 and the following version of the swap, c function that co...
Computer Systems: A Programmer's Perspective (3rd Edition)
Describe the purpose of a database.
Database Concepts (7th Edition)
Bank Charges A bank charges 10 per month plus the following check fees for a commercial checking account: .10 e...
Starting Out with C++ from Control Structures to Objects (9th Edition)
Knowledge Booster
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
- ord_no 70001 70009 70002 70004 purch_amt 150.5 270.65 65.26 110.5 ord_date customer_id salesman_id 2012-10-05 3005 2012-09-10 3001 2012-10-05 3002 2012-08-17 3009 5002 5005 5001 5003 Given the Orders Table above: Write a SQL statement to find the highest purchase amount with their ID and order date, for those customers who have a higher purchase amount in a day is within the range 100 and 300.arrow_forwardYOu have to find SQL code of all and show outputarrow_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_forward
- Database: https://www.w3schools.com/sql/trysql.asp?filename=trysql_select_allarrow_forwardDatabase: https://www.w3schools.com/sql/trysql.asp?filename=trysql_select_allarrow_forwardUse My Guitar Shop Database Use Microsoft SQL Server Write a script that includes these statements coded as a transaction: INSERT Orders VALUES (3, GETDATE(), '10.00', '0.00', NULL, 4, 'American Express', '378282246310005', '04/2019', 4); SET @OrderID = @@IDENTITY; INSERT OrderItems VALUES (@OrderID, 6, '415.00', '161.85', 1); INSERT OrderItems VALUES (@OrderID, 1, '699.00', '209.70', 1); Here, the @@IDENTITY variable is used to get the order ID value that’s automatically generated when the first INSERT statement inserts an order. If these statements execute successfully, commit the changes. Otherwise, roll back the changes.arrow_forward
- There's a "friend_requests" table that has a column "action_taken" that displays if the friend request was rejected, requested, or accepted.Implement a SQL query to return the number of "action_taken" that were "accepted".arrow_forwardDatabase: https://www.w3schools.com/sql/trysql.asp?filename=trysql_select_allarrow_forwardTranslate the following pandas statement in Python to a SQL query so that it can be executed on the SQL database. dfdata[(10*dfdata['cases']>dfdata['cases'])&(dfdata['date']=='2020-10-10')]['county']arrow_forward
- Given is a Python program that connects to a sqlite database and has one table called writers with two columnns: name - the name of a writer num - the number of works the writer has written The writers table originally has the following data: name, num Jane Austen,6 Charles Dickens,20 Ernest Hemingway,9 Jack Kerouac,22 F. Scott Fitzgerald,8 Mary Shelley,7 Charlotte Bronte,5 Mark Twain,11 Agatha Christie,73 Ian Flemming,14 J.K. Rowling,14 Stephen King,54 Oscar Wilde,1 Update the Python program to ask the user if they want to update entries or add new entries. If the name entered already exists in the writers table then the database record is updated, overwriting the original contents. If the name does not exist in the writers table, then add a new record with the writer's name and number of works. The following TODO sections must be completed. Check if a writer exists in the writers table If the writer exists in the table, locate an entry to be updated by writer's name and update the…arrow_forwardGiven is a Python program that connects to a sqlite database and has one table called writers with two columnns: name - the name of a writer num - the number of works the writer has written The writers table originally has the following data: name, num Jane Austen,6 Charles Dickens,20 Ernest Hemingway,9 Jack Kerouac,22 F. Scott Fitzgerald,8 Mary Shelley,7 Charlotte Bronte,5 Mark Twain,11 Agatha Christie,73 Ian Flemming,14 J.K. Rowling,14 Stephen King,54 Oscar Wilde,1 Update the Python program to ask the user if they want to update entries or add new entries. If the name entered already exists in the writers table then the database record is updated, overwriting the original contents. If the name does not exist in the writers table, then add a new record with the writer's name and number of works. The following TODO sections must be completed. Check if a writer exists in the writers table If the writer exists in the table, locate an entry to be updated by writer's name and update…arrow_forwardThere's a "friend_requests" table that has a column "action_taken" that displays if the friend request was rejected, requested, or accepted.Implement a SQL query to return the percentage of "action_taken" that were "accepted".arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- 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
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)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
How to Design DB Tables for any Application? (The Basics); Author: Studytonight;https://www.youtube.com/watch?v=XUdNVaSikqY;License: Standard YouTube License, CC-BY
Create a Table (Introduction to Oracle SQL); Author: Database Star;https://www.youtube.com/watch?v=BiV1IrzB1sY;License: Standard Youtube License