Question: 1. Create a 'Part_Structure' table as follows (key attributes are underlined): (5 points) Part_Structure Table: MAJOR P MINOR P P1 P1 P2 P2 P3

1. Create a Part_Structure table as follows (key attributes are underlined): (5 points) Part_Structure Table: 2. Write a Ja

1. Create a 'Part_Structure' table as follows (key attributes are underlined): (5 points) Part_Structure Table: MAJOR P MINOR P P1 P1 P2 P2 P3 P4 P5 print UPPER_P# ; DO "forever"; P3 P2 P4 P3 CALL RECURSION (GIVENP# ); RECURSION: PROC (UPPER_P# ) RECURSIVE ; DCL UPPER_P# ... ; P5 P5 P6 2. Write a Java program (use JDBC to connect to the database) that implements the following function (written in pseudo code) that prints out the subparts of a part using a depth-first search, and the branch with a smaller part number will be searched first (where there is more than branch): (20 points) DCL LOWER P#... INITIAL (' ')); EXEC SQL DECLARE C CURSOR FOR END DO; END PROC; SELECT MINOR_P# FROM PART_STRUCTURE WHERE MAJOR_P# = :UPPER_P# AND MINOR_P# > LOWER_P# ORDER BY MINOR_P# ; QTY 2 4 1 3 983 EXEC SQL OPEN C ; EXEC SQL FETCH C INTO :LOWER_P# ; EXEC SQL CLOSE C; IF no "lower P#" retrieved THEN RETURN; IF "lower P#" retrieved THEN CALL RECURSION (LOWER_P#) ; END IF; END IF; Given the value of the input parameter 'P1', it should print out the following sequence (in the exact same order) for the table in Q1: P1 P2 P3 P5 P6 P4 P5 P6 P3 P5 P6

Step by Step Solution

3.48 Rating (165 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

It seems that youve shared the details of a question which involves creating a SQL table and writing a corresponding Java program that uses JDBC to se... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!