Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add postgresql functions concept #5220

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hakdo99
Copy link
Contributor

@hakdo99 hakdo99 commented Sep 16, 2024

Description

Add a concept entry about PostgreSQL functions. The new file is functions.md.

Issue Solved

Closes #4589

Type of Change

  • Adding a new entry

Checklist

  • All writings are my own.
  • My entry follows the Codecademy Docs style guide.
  • My changes generate no new warnings.
  • I have performed a self-review of my own writing and code.
  • I have checked my entry and corrected any misspellings.
  • I have made corresponding changes to the documentation if needed.
  • I have confirmed my changes are not being pushed from my forked main branch.
  • I have confirmed that I'm pushing from a new branch named after the changes I'm making.
  • I have linked any issues that are relevant to this PR in the Issues Solved section.

@SaviDahegaonkar SaviDahegaonkar self-assigned this Sep 16, 2024
@SaviDahegaonkar SaviDahegaonkar added new entry New entry or entries postgresql PostgreSQL status: under review Issue or PR is currently being reviewed labels Sep 16, 2024
Copy link
Collaborator

@SaviDahegaonkar SaviDahegaonkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @hakdo99 ,
The entry is nicely written, and I have suggested a few changes. Please make them asap.

Thanks,
Savi

- 'PostgreSQL'
- 'Functions'
CatalogContent:
- 'learn-postgresql'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- 'learn-postgresql'
- 'learn-postgresql'

Include only those course paths that are already available in the catalog-content.md file. You can add one if you want it to get included in the PR. Here learn-postgresql is not available in the catalog-content file so it makes it invalid to get included in PR.

- 'paths/analyze-data-with-sql'
---

**`Functions`** in PostgreSQL, also known as Stored Procedures, are sets of SQL and procedural commands stored on the database server. They enable us to perform executions within the database within a single function that usually require several commands and round trips.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
**`Functions`** in PostgreSQL, also known as Stored Procedures, are sets of SQL and procedural commands stored on the database server. They enable us to perform executions within the database within a single function that usually require several commands and round trips.
**`Functions`** in PostgreSQL, also known as Stored Procedures, are sets of SQL and procedural commands stored on the database server. They enable us to perform executions within the database within a single function that usually requires several commands and round trips.

Comment on lines +24 to +34
CREATE [OR REPLACE] FUNCTION function_name (parameters)
RETURNS return_type AS $$
DECLARE
< variable_declaration >
[...]
BEGIN
< function_body >
[...]
RETURN { variable_name | value }
END;
$$ LANGUAGE lang_name;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
CREATE [OR REPLACE] FUNCTION function_name (parameters)
RETURNS return_type AS $$
DECLARE
< variable_declaration >
[...]
BEGIN
< function_body >
[...]
RETURN { variable_name | value }
END;
$$ LANGUAGE lang_name;
CREATE [OR REPLACE] FUNCTION function_name (parameters)
RETURNS return_type AS $$
DECLARE
< variable_declaration >
[...]
BEGIN
< function_body >
[...]
RETURN { variable_name | value } ;
END;
$$ LANGUAGE lang_name;

Added semicolon at line number 32 for correct syntax.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Concept Entry] Postgresql functions
2 participants