Starting Out with Java: From Control Structures through Objects (6th Edition)
Starting Out with Java: From Control Structures through Objects (6th Edition)
6th Edition
ISBN: 9780133957051
Author: Tony Gaddis
Publisher: PEARSON
bartleby

Videos

Textbook Question
Book Icon
Chapter 17, Problem 5PC

Population Database

Make sure you have downloaded the hook’s source code from the companion Web site at www.pearson.com/gaddis. In this chapter’s source code folder you will find a program named CreateCityDB.java. Compile and run the program. The program will create a Java

DB or Apache Derby database named CityDB. The CityDB database will have a table named City, with the following columns:

Column Name Data Type
CityName CHAR (50)
Primary key  
Population DOUBLE

The CityName column stores the name of a city and the Population column stores the population of that city. After you run the CreateCityDB.java program, the City table will contain 20 rows with various cities and their populations.

Next, write a program that connects to the CityDB database, and allows the user to select any of the following operations:

  • Sort the list of cities by population, in ascending order.
  • Sort the list of cities by population, in descending order.
  • Sort the list of cities by name.
  • Get the total population of all the cities.
  • Get the average population of all the cities.
  • Get the highest population.
  • Get the lowest population.
Blurred answer
Students have asked these similar questions
in C# in Visual Studios using Windows Form App(.Net Framework)   Thank you
in C# using Visual Studio in Windows Form App (.Net Framework)   Thank you!
SQL A table Products have: a name (TEXT) a description (TEXT) a unit cost stored in cents (INTEGER) and of course we also add an id column to identify them. Separately, we'd like to track the number of items in stock for each product. To do so we'll have a store and an inventory table. Stores have just an id and a name. Then, our inventory table should combine stores and products, listing how much of each product each store has in stock. a product_id (INTEGER) a store_id (INTEGER) a quantity (INTEGER) in stock Now we can insert some stores, products and inventory into our database. There are 2 stores -- one called NY and one called NJ. There are 2 products we are concerned with. Their names are sneakers, costing $220 (remember this is dollars!) and boots costing $350. Use any description for each that you'd like. NY has 4 sneakers in stock and 3 boots. NJ has 5 sneakers in stock and no boots. Insert the above data into the tables you have created.

Chapter 17 Solutions

Starting Out with Java: From Control Structures through Objects (6th Edition)

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...
Knowledge Booster
Background pattern image
Computer Science
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
Text book image
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
Text book image
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Text book image
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:9780357392676
Author:FREUND, Steven
Publisher:CENGAGE L
Text book image
A Guide to SQL
Computer Science
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Course Technology Ptr
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