Lesson 9: Database - Java programming 1. Create a database of salesman: a. Table Description: o Salesman Number – Integer – Primary Key – Not Null o Salesman Name – VarChar Quarterly Sales – Real (Float) * Note: input of sales per quarter (1st, 2nd, 3rd, 4th) o Total Sales - Double o Commission – Real (Float) b. Compute the Total Sales c. Compute the Commission based on the following: Total Sales Commission <= 5000 10% of Total Sales <= 10000 15% of Total Sales <= 15000 20% of Total Sales <= 20000 25% of Total Sales > 20000 35% of Total Sales or 15000 whichever is higher d. Search a salesman (input must be Salesman Number), determine if the salesman is existing in the database, otherwise update the record by inputting new values of Quarterly Sales. e. Search a salesman (input must be Salesman Number), determine if the salesman is existing in the database, otherwise delete the record. f. Display all the record of database. 2. Modify #1, input Salesman Number: 2.1. Search if the record is existing or not; 2.2. If exist, ask if you are going to update or delete the record: 2.2.1. If update, change the values of Salesman Name and Quarterly Sales 2.2.2. If delete, remove the record from the table; 2.3. If not, display “Record not exists!” and input another ID number repeat 2.1 to 2.3; 2.4. Display the new contents of table
Lesson 9:
1. Create a database of salesman:
a. Table Description:
o Salesman Number – Integer – Primary Key – Not Null
o Salesman Name – VarChar
Quarterly Sales – Real (Float)
* Note: input of sales per quarter (1st, 2nd, 3rd, 4th)
o Total Sales - Double
o Commission – Real (Float)
b. Compute the Total Sales
c. Compute the Commission based on the following:
Total Sales Commission
<= 5000 10% of Total Sales
<= 10000 15% of Total Sales
<= 15000 20% of Total Sales
<= 20000 25% of Total Sales
> 20000 35% of Total Sales or 15000 whichever is higher
d. Search a salesman (input must be Salesman Number), determine if the salesman is existing in the database, otherwise update the record by inputting new values of Quarterly Sales.
e. Search a salesman (input must be Salesman Number), determine if the salesman is existing in the database, otherwise delete the record.
f. Display all the record of database.
2. Modify #1, input Salesman Number:
2.1. Search if the record is existing or not;
2.2. If exist, ask if you are going to update or delete the record:
2.2.1. If update, change the values of Salesman Name and Quarterly Sales
2.2.2. If delete, remove the record from the table;
2.3. If not, display “Record not exists!” and input another ID number repeat 2.1 to 2.3;
2.4. Display the new contents of table
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 3 images