Consider the following database application that is used to assess physical aptitudes and characteristics of the candidates who apply to one or more academies within the US military service system. For a candidate to be acceptable to one particular military academy, he or she must pass a set of rules based on the candidates medical records. There are many rules that are used in the real application, but for this project we will consider only three such rules: age, pulse, and blood pressure. Here are the concrete requirements for this project:A candidate may apply to one or more academies. A separate application is required for each academy that the candidate applies toEach academy has its own specific parameters that the rules use. Hence, a candidate may be declared not acceptable for some academies, but acceptable for othersA candidate evaluation consists of running all the rules for that candidate and a given academy. A separate evaluation is performed for each application. For each evaluation, a row is created in EVALUATIONS table, and three rows in the RESULTS table (one for each of the three rules that we are considering)As mentioned above, the rule evaluation results are stored in RESULTS table. The result of a rule is stored as a number, as follows: 1 Acceptable, 0 Not AcceptableIn order for an applicant to be declared Acceptable for a given application, all the rules must return 1 (Acceptable). If at least one rule returns 0, the candidate is declared Not Acceptable Each rule is implemented by a specific PL/SQL.The three rules are defined below:Age:a. 16 <= age <=22 and (USAFA or USMA) Acceptableb. 16 <= age <= 40 and USUHS Acceptablec. Otherwise Not AcceptablePulse:a. Pulse < 45 Not Acceptableb. 45 <= Pulse <= 99 Acceptablec. Pulse > 99 Not acceptable Blood Pressure:a. Systolic < 140 and Diastolic < 90 Acceptableb. Systolic >= 140 or Diastolic >= 90 UnacceptableThe following tables are created for this application (for concrete details see the attached DDL scrip
t):APPLICANTS (SSN, FirstName, LastName, DOB)ACADEMIES (AcadID, AcadName)APPLICATIONS (AppID, SSN, AcadID, Year)MEDICAL_RECORDS (SSN, Pulse, Systolic, Diastolic, DateUpdated)EVAL_RULES (RuleID, FunctionName)EVALUATIONS (EvalID, EvalDate, AppID)RESULTS (EvalID, RuleID, Result) Given the above application description and database schema, you are asked to do the followings:Create a PL/SQL function for each of the three rules described above. The function accepts one parameter, the AppID, and returns 0 Not Acceptable, or 1 AcceptableDefine a sequence for the primary key of the EVALUATIONS tableCreate a PL/SQL procedure that evaluates an application (by calling all three functions defined at #1) and populates the EVALUATIONS and RESULTS tables accordingly. This procedure accepts AppID as input parameter.Create a PL/SQL function that returns the final result of the most recent evaluation for a given application. This function accepts AppID as input parameter and returns 0 or 1. It uses the EVALUATIONS and RESULTS tablesPerform evaluations for all the applications that exist in APPLICATIONS table by calling the procedure defined at #3, and display the results by calling the function defined at #4, repeatedly for each application, and display the results using DBMS_OUTPUT. The following columns will be displayed: Applicant name, Academy, Evaluation result (Acceptable, Not Acceptable)Use PL/SQL exceptions when defining your PL/SQL blocks.Submit the PL/SQL statements as a text file following the document naming convention FirstLastP2.txt. Grading: this project is awarded 100 points10 points PL/SQL Function for Rule 110 points PL/SQL Function for Rule 210 points PL/SQL Function for Rule 35 points Sequence for EVALUATIONS table20 points PL/SQL procedure that evaluates an application 20 points PL/SQL function that returns the final result of an application evaluation20 points PL/SQL block that evaluates all applications in APPLICATIONS table5 points Proper use of EXCEPTION section of PL/SQL blocks project 2 DDL for reference