Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

CONNECT \'jdbc:derby:DBTest;create=true\'; CREATE TABLE Products ( ProductCode V

ID: 3866166 • Letter: C

Question

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.

Explanation / Answer

You have asked for the SQL queries so here I am answering the sql query qiest only starting from question 5.

5. Select * from Products;

This query returns all the information contained in the product table.

6. INSERT INTO Products

VALUES ('Plsql', ' Biggener guide for SQL Server', 79.50);

This will insert data into product table i.e. one row.

7. Select * from Products where Product_name='Plsql';

This will retrieve the information about the product Plsql.

8. Delete from Products where Product_name='Plsql';

This query will delete the row belonging to the product Plsql.

Select * from Products;

12. Insert into Products values( ' test', ' Test Product ', 99.99);

This will insert the new product information named test.

These are the required Sql queries for the given information.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote