58 lines
2.6 KiB
SQL
58 lines
2.6 KiB
SQL
drop table if exists `Loan Additional Data`;
|
|
CREATE TABLE `Loan Additional Data` (
|
|
`loan_id` bigint(20) NOT NULL,
|
|
`PurposeOfLoan_cd` int(11) NOT NULL,
|
|
`CollateralType_cd` int(11) NOT NULL,
|
|
`Collateral notes` text NOT NULL,
|
|
`YesNo_cd_Guarantor` int(11) NOT NULL,
|
|
`Guarantor name` varchar(100) DEFAULT NULL,
|
|
`Guarantor relation` varchar(100) DEFAULT NULL,
|
|
`Guarantor address` varchar(100) DEFAULT NULL,
|
|
`Guarantor telepone number` varchar(20) DEFAULT NULL,
|
|
PRIMARY KEY (`loan_id`),
|
|
CONSTRAINT `FK_loan_additional_data` FOREIGN KEY (`loan_id`) REFERENCES `m_loan` (`id`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
|
|
drop table if exists `Client Additional Data`;
|
|
CREATE TABLE `Client Additional Data` (
|
|
`client_id` bigint(20) NOT NULL,
|
|
`Gender_cd` int(11) NOT NULL,
|
|
`Date of Birth` date NOT NULL,
|
|
`Home address` text NOT NULL,
|
|
`Telepone number` varchar(20) NOT NULL,
|
|
`Telepone number (2nd)` varchar(20) NOT NULL,
|
|
`Email address` varchar(50) NOT NULL,
|
|
`EducationLevel_cd` int(11) NOT NULL,
|
|
`MaritalStatus_cd` int(11) NOT NULL,
|
|
`Number of children` int(11) NOT NULL,
|
|
`Citizenship` varchar(50) NOT NULL,
|
|
`PovertyStatus_cd` int(11) NOT NULL,
|
|
`YesNo_cd_Employed` int(11) NOT NULL,
|
|
`FieldOfEmployment_cd_Field of employment` int(11) DEFAULT NULL,
|
|
`Employer name` varchar(50) DEFAULT NULL,
|
|
`Number of years` int(11) DEFAULT NULL,
|
|
`Monthly salary` decimal(19,6) DEFAULT NULL,
|
|
`YesNo_cd_Self employed` int(11) NOT NULL,
|
|
`FieldOfEmployment_cd_Field of self-employment` int(11) DEFAULT NULL,
|
|
`Business address` text DEFAULT NULL,
|
|
`Number of employees` int(11) DEFAULT NULL,
|
|
`Monthly salaries paid` decimal(19,6) DEFAULT NULL,
|
|
`Monthly net income (of business activity)` decimal(19,6) DEFAULT NULL,
|
|
`Monthly rent` decimal(19,6) DEFAULT NULL,
|
|
`Other income generating activities` varchar(100) DEFAULT NULL,
|
|
`YesNo_cd_Bookeeping` int(11) NOT NULL,
|
|
`YesNo_cd_Loans with other institutions` int(11) NOT NULL,
|
|
`From whom` varchar(100) DEFAULT NULL,
|
|
`Amount` decimal(19,6) DEFAULT NULL,
|
|
`Interest rate p.a` decimal(19,6) DEFAULT NULL,
|
|
`Number of people depending on overal income` int(11) NOT NULL,
|
|
`YesNo_cd_Bank account` int(11) NOT NULL,
|
|
`YesNo_cd_Business plan provided` int(11) NOT NULL,
|
|
`YesNo_cd_Access to internet` int(11) DEFAULT NULL,
|
|
`Introduced by` varchar(100) DEFAULT NULL,
|
|
`Known to introducer since` date NOT NULL,
|
|
`Last visited by` varchar(100) DEFAULT NULL,
|
|
`Last visited on` date NOT NULL,
|
|
PRIMARY KEY (`client_id`),
|
|
CONSTRAINT `FK_client_additional_data` FOREIGN KEY (`client_id`) REFERENCES `m_client` (`id`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |