Question
ORACLE SQL Bonus: The Loan.csv considers all data values as strings. However, some values are indeed numbers and dates. Map a string to a NUMBER
ORACLE SQL
Bonus: 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:
- 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.
- 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.
- No attribute is missing a value, so your program need not check for NULLs.
- For more information on screenshots read Resources FAQ on the website. Failure to comply with Screenshot instructions will result in loss of points.
Where Val1 and Val4 are numeric and Val2 and Val3 are strings.
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) );
Inserted data by inserting into Oracle SQL
insert into Loan values(1000, '26-May-07', 'Wedding Covered but No Honeymoon', 693, 10, 48127, 'NM', 4, 0); insert into Loan values(1000, '26-May-07', 'Consolidating Debt', 703, 10, 1027, 'MA', 1, 0); insert into Loan values(11000, '27-May-07', 'Want to consolidate my debt', 715, 10, 21227, 'MD', 1, 0);
I programmed in Java to read the excel file and format the data into these insert statements. I have to Map a string to a NUMBER or DATE data type program and insert into a Loan table declared accordingly.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started