How to create PostgreSQL Function / Stored Prcoe?

How to create PostgreSQL Function / Stored Prcoe?

Follow these steps to create PostgreSQL Functions
  1. Click on "CREATE PROBLEM" button. PostgreSQL problem creation is a 4-step process.

  2. First Step - Problem Description: Select language as "PostgreSQL". Select suggested time, title and statement of the problem. Optionally select/create tags too.




  3. Second Step - Problem Template: Create a template for the PostgreSQL function. This template should not include the solution but just a template for a student to get started quickly.

    Note: For SQL, there can't be multiple test cases. The test cases data must be included as a template.




  4. Third Step - Test Cases: Set the test case output value. Your input field will be blank. Just the output field will be available in the test case.

    Note: For SQL we suggest to copy output from the 4th step instead of creating your own. Keep "Trim Output" checked. You can specify any "Reserved Keyword" if required in this step.




  5. Fourth Step - Provide Solution: A faculty needs to provide a solution for the SQL problem in this step and verify it by click on run-all test cases button on an editor. This solution also makes sure that test cases and code-template are working properly. This is optional, but we recommend a faculty to provide a solution.




After completing all the four steps, click on "VERIFY & ACTIVATE" button. This will run your solution with the test cases provided and activate the problem. Once the problem gets activated, it will be ready to be added to the class or problem set.