-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[New Concept Entry for existing topic] POSTGRESQL array-constructor #4637
Conversation
Tags: | ||
- 'Arrays' | ||
- 'Data Types' | ||
- 'PostgresSQL' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 'PostgresSQL' | |
- 'PostgreSQL' |
@@ -0,0 +1,139 @@ | |||
--- | |||
Title: 'array-constructors' | |||
Description: 'an array constructor is a method use to work with collections of data ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description: 'an array constructor is a method use to work with collections of data ' | |
Description: 'An array constructor is a method used to work with collections of data' |
|
||
## Example 2 | ||
|
||
Now lets create a naw table called `example 2` with `team` column and add two-dimensional values of type `text`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now lets create a naw table called `example 2` with `team` column and add two-dimensional values of type `text`: | |
Now let's create a new table called `example 2` with `team` column and add two-dimensional values of type `text`: |
| --- | ------- | | ||
| 1 | Micheal | | ||
|
||
Finally, let try updating our table using the same idea, with the following script |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally, let try updating our table using the same idea, with the following script | |
Finally, let's try updating our table using the same idea, with the following script |
@@ -0,0 +1,139 @@ | |||
--- | |||
Title: 'array-constructors' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Title: 'array-constructors' | |
Title: 'Array Constructors' |
Finally, let try updating our table using the same idea, with the following script | ||
|
||
```sql | ||
update example3 set Contacts[1]='(+234)81-0000-0000' where names='Tolu'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update example3 set Contacts[1]='(+234)81-0000-0000' where names='Tolu'; | |
UPDATE example3 SET Contacts[1]='(+234)81-0000-0000' WHERE names = 'Tolu'; |
Now, if we check our `example3` table again we will find out that the contact `(+234)81-1265-3347` has been changed to `(+234)81-0000-0000` in the table below: | ||
|
||
```sql | ||
select * from example3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
select * from example3 | |
SELECT * FROM example3 |
|
||
```sql | ||
-- This creates a table named 'example1' with two columns: 'id' and 'numbers'. | ||
-- 'id' is an auto-incrementing primary key, and 'tesm1' can hold a collection of text. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- 'id' is an auto-incrementing primary key, and 'tesm1' can hold a collection of text. | |
-- 'id' is an auto-incrementing primary key, and 'team' can hold a collection of text. |
|
||
## Example 3 | ||
|
||
We have now successfully learn how to insert arrays into our postgres table, now lets learn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have now successfully learn how to insert arrays into our postgres table, now lets learn | |
We have now successfully learned how to insert arrays into our postgres table, now let's learn |
We have now successfully learn how to insert arrays into our postgres table, now lets learn | ||
how to access our array element using the `example3` table below: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have now successfully learn how to insert arrays into our postgres table, now lets learn | |
how to access our array element using the `example3` table below: | |
We have now successfully learned how to insert arrays into our postgres table, now let's learn | |
how to access our array element using the `example3` table below: |
Hi @achur00 Thank you for contributing to the Codecademy Docs I've suggested some changes for this entry, could you please review and modify those at your earliest convenience |
Alright, will do, thanks. |
Hello @cigar-galaxy82 I have made all corrections in a new commit, let me know if you have any recommendation. |
@cigar-galaxy82 Please approve this PR. |
@cigar-galaxy82 I have fixed the issue with the formatting. |
Hi @achur00 thank you now all checks have passed. |
@cigar-galaxy82 Do I have something more i need to do before this can be merged? |
👋 @achur00 🎉 Your contribution(s) can be seen here: https://www.codecademy.com/resources/docs/postgresql/array-constructors Please note it may take a little while for changes to become visible. |
Hi @achur00 I have merged the PR |
@cigar-galaxy82 I wasn't finished with my review. Once the second reviewer is done, then they merge the PR. Please remember this for future PRs. |
@achur00 Are you comfortable opening a new PR to make changes within this entry? The changes are as follows:
I will suggest a couple more direct changes to that PR and then it can be merged. When you create a new PR, tag me so we can treat it as a continuation of this PR. |
Description
I created a new entry and file in the path docs/content/postgresql/concepts/array-constructors/array-constructors.md.
Issue Solved
Issue Solved
Closes #4592
Type of Change
Checklist
main
branch.Issues Solved
section.