CREATE TABLE IF NOT EXISTS `account` (
`account_number` varchar(15) NOT NULL,
`branch_name` varchar(15) NOT NULL,
`balance` float(10,2) NOT NULL,
PRIMARY KEY (`account_number`),
KEY `branch_name` (`branch_name`),
CONSTRAINT `account_ibfk_1` FOREIGN KEY (`branch_name`) REFERENCES `branch` (`branch_name`)
);
INSERT INTO `account` (`account_number`, `branch_name`, `balance`) VALUES
('1', 'Pownal', 0.00),
('2', 'Brighton', 5.00),
('3', 'Downtown', 10.00),
('4', 'Perryridge', 20.00),
('5', 'Round Hill', 30.00),
('6', 'Redwood', 40.00);
CREATE TABLE IF NOT EXISTS `borrower` (
`customer_name` varchar(15) NOT NULL,
`loan_number` varchar(15) NOT NULL,
PRIMARY KEY (`customer_name`,`loan_number`),
KEY `loan_number` (`loan_number`),
CONSTRAINT `borrower_ibfk_1` FOREIGN KEY (`customer_name`) REFERENCES `customer`
(`customer_name`),
CONSTRAINT `borrower_ibfk_2` FOREIGN KEY (`loan_number`) REFERENCES `loan` (`loan_number`)
);
INSERT INTO `borrower` (`customer_name`, `loan_number`) VALUES
('BROWN', '1'),
('JIMMY', '1'),
('DAVID', '3'),
('DANIEL', '4'),
('NGAHU', '5');
CREATE TABLE IF NOT EXISTS `branch` (
`branch_name` varchar(15) NOT NULL,
`branch_city` varchar(15) NOT NULL,
`assets` float(10,2) NOT NULL,
PRIMARY KEY (`branch_name`)
);
INSERT INTO `branch` (`branch_name`, `branch_city`, `assets`) VALUES
('Brighton', 'Brooklyn', 7000000.00),
('Central', 'Rye', 400280.00),
('Downtown', 'Brooklyn', 900000.00),
('Mianus', 'Horseneck', 400200.00),
('North Town', 'Rye', 3700000.00),
('Perryridge', 'Horseneck', 1700000.00),
('Pownal', 'Bennington', 400000.00),
('Redwood', 'Palo Alto', 2100000.00),
('Round Hill', 'Horseneck', 8000000.00);
CREATE TABLE IF NOT EXISTS `customer` (
`customer_name` varchar(15) NOT NULL,
`customer_street` varchar(12) NOT NULL,
`customer_city` varchar(15) NOT NULL,
PRIMARY KEY (`customer_name`)
);
INSERT INTO `customer` (`customer_name`, `customer_street`, `customer_city`) VALUES
('BROWN', 'NGMI', 'NY'),
('DANIEL', 'LD', 'NY'),
('DAVID', 'JHGC-5', 'BY'),
('JIMMY', 'NY', 'NY'),
('MWANGI', 'DALLAS-H', 'DC'),
('NGAHU', 'DX', 'MSS');
CREATE TABLE IF NOT EXISTS `depositor` (
`customer_name` varchar(15) NOT NULL,
`account_number` varchar(15) NOT NULL,
PRIMARY KEY (`customer_name`,`account_number`),
KEY `account_number` (`account_number`),
CONSTRAINT `depositor_ibfk_1` FOREIGN KEY (`account_number`) REFERENCES `account`
(`account_number`),
CONSTRAINT `depositor_ibfk_2` FOREIGN KEY (`customer_name`) REFERENCES `customer`
(`customer_name`)
);
INSERT INTO `depositor` (`customer_name`, `account_number`) VALUES
('DANIEL', '1'),
('MWANGI', '2'),
('DAVID', '3'),
('NGAHU', '3'),
('JIMMY', '4'),
('BROWN', '6');
CREATE TABLE IF NOT EXISTS `loan` (
`loan_number` varchar(15) NOT NULL,
`branch_name` varchar(15) NOT NULL,
`amount` float(10,2) NOT NULL,
PRIMARY KEY (`loan_number`),
KEY `branch_name` (`branch_name`),
CONSTRAINT `loan_ibfk_1` FOREIGN KEY (`branch_name`) REFERENCES `branch` (`branch_name`)
);
INSERT INTO `loan` (`loan_number`, `branch_name`, `amount`) VALUES
('1', 'Pownal', 10.00),
('2', 'Brighton', 15.00),
('3', 'Downtown', 20.00),
('4', 'Mianus', 21.00),
('5', 'Perryridge', 24.00),
('6', 'Round Hill', 34.00);
1
Student’s Result program using Java
Using Java, we can implement a program student results program. The program will have
GPA, Student name and Major Field of study as displayed in the college database. The entire
student’s data will appear with a message “Dean List” in the program when the GPA of the
student is over 3.5. For those with GPA below 2.0 the program will display “Academic
Probation”. For those with GPA between 2.0 and 3.5 will not have anything displayed. The
program will run as shown below while getting the student data from the data base:
import java.util.*;
import java.lang.*;
import java.io.*;
class Main
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
String name,f_o_s;
double gpa;
System.out.print("Enter the name of the student: ");
name = sc.next();
System.out.print("Enter the field of study: ");
f_o_s = sc.next();
System.out.print("Enter the gpa of the student: ");
gpa = sc.nextDouble();
System.out.println("Student's name: "+name + "\nField of Study: "+f_o_s+"\nGPA: "+gpa);
import java.util.*;
import java.lang.*;
import java.io.*;
class Main
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
String name,f_o_s;
double gpa;
System.out.print("Enter the name of the student: ");
name = sc.next();
System.out.print("Enter the field of study: ");
f_o_s = sc.next();
System.out.print("Enter the gpa of the student: ");
gpa = sc.nextDouble();
System.out.println("Student's name: "+name + "\nField of Study: "+f_o_s+"\nGPA: "+gpa);
2
if(gpa>3.5)
System.out.println("Dean's List");
else if(gpa3.5)
System.out.println("Dean's List");
else if(gpa
Purchase answer to see full
attachment