Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with this exercise 20-1. Attached is the exercise and what is needed with the SQL query CONNECT 'jdbc:derby:DBTest;create=true'; CREATE TABLE Products (

I need help with this exercise 20-1. Attached is the exercise and what is needed with the SQL query image text in transcribed

CONNECT 'jdbc:derby:DBTest;create=true';

CREATE TABLE Products

(

ProductCode VARCHAR(10),

Description VARCHAR(40),

Price DOUBLE

);

INSERT INTO Products

VALUES ('jsps', 'Murach''s Java Servlets and JSP', 49.50);

INSERT INTO Products

VALUES ('bvbn', 'Murach''s Beginning Visual Basic .NET', 49.50);

INSERT INTO Products

VALUES ('cshp', 'Murach''s C#', 49.50);

INSERT INTO Products

VALUES ('java', 'Murach''s Beginning Java', 49.50);

INSERT INTO Products

VALUES ('mcb2', 'Murach''s Mainframe COBOL', 59.50);

INSERT INTO Products

VALUES ('sqls', 'Murach''s SQL for SQL Server', 49.50);

INSERT INTO Products

VALUES ('zjcl', 'Murach''s OS/390 and z/OS JCL', 62.50);

SELECT * FROM Products;

Exercise 20-1 Work with a Derby database you'll use the ij tool to work with an existing Derby database and to create a new Derby database. Work with an existing Derby database . Add the derby jar and derbytools,jar files to the class path as described in figure 20-8 2. Use your operating system to view the files in the murachljavaldb directory. Note that this directory includes a subdirectory that stores the files for the 3. Start a command prompt and change the current directory to the 4. Use the ij tool to connect to the MurachDB database that's stored in this 5. Run a SELECT statement that selects all rows from the Products table. MurachDB database. murachljavaldb directory directory Run an INSERT statement that adds a row to the Products table. Then, select all rows in the Products table again to make sure the INSERT statement worked correctly. 6. Run a SELECT statement that only selects the row you just added to the Products table. 7. Run a DELETE statement to delete the row you added to the Products table Then, select all rows in the Products table again to make sure the DELETE statement worked correctly 8. 9. Disconnect from the database and exit the ij tool Use a SQL script to create a new Derby database 10. Use your operating system to view the files in the ch20_db directory that's in the ex starts directory. Note that this directory does not contain a directory for the MurachDB database. However, it should contain a SQL script for creating this database and an operating system script for starting the ij tool 11. Open the MurachDBCreate.sql script in a text editor. Note that it has all of the 12. Modify this script so it inserts an additional row that has a product code of 13. Use the appropriate script for your operating system to start the ij tool. Note 14. Use the ij tool to run the MurachDBCreate.sql script. Review the output of the SQL statements necessary to create a database named MurachDB that contains a Products table test", description of "Test Product", and price of 99,99 that this changes the current directory to the ch20_db directory. script. This output should include messages that indicate that the table was created and the rows were inserted. In addition, it should display the data that's stored in the Products table

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Accidental Data Scientist

Authors: Amy Affelt

1st Edition

1573877077, 9781573877077

More Books

Students also viewed these Databases questions