Question: ORACLE SQL The Loan.csv considers all data values as strings. However, some values are indeed numbers and dates. Map a string to a NUMBER or

ORACLE SQL

The Loan.csv considers all data values as strings. However, some values are indeed numbers and dates. Map a string to a NUMBER or DATE data type in your program and insert into a Loan table declared accordingly.

Note:

  1. For this example, it is strongly recommended to go from a working-to-working condition. First, write the create table statement. Then use the first line of data values to manually write an `Insert Into ` statement in SQLDeveloper. From that determine a pattern, based on which you should write your program to generate several `Insert Into` statements.
  2. Copy and paste the output from your program in SQLDeveloper to see if your `Insert Into` statements are correct. If correct, data will be inserted.
  3. No attribute is missing a value, so your program need not check for NULLs.
  4. For more information on screenshots read Resources FAQ on the website. Failure to comply with Screenshot instructions will result in loss of points.

drop table Loan; create table Loan (

Amount number(6,0), Loan_date date, Loan_Title varchar(60), Risk_Score number(3,0), Debt_to_income_ratio number(6,2), Zipcode number(5), State varchar(2), Employment_Length number(1), Policy_Code number(1),

check (Amount between 0 and 999999), check (Debt_to_income_ratio between 0 and 9999.99) );

Example information from csv file:

Where Val1 and Val4 are numeric and Val2 and Val3 are strings.

Amount

Loan_Date

Loan_Title

Risk_Score

Debt_To_Income_Ratio

Zipcode

State

Employment_Length

Policy_Code

1000

5/26/07

Wedding Covered but No Honeymoon

693

10

48127

NM

4

0

1000

5/26/07

Consolidating Debt

703

10

1027

MA

1

0

11000

5/27/07

Want to consolidate my debt

715

10

21227

MD

1

0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!