-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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 entry] PostgreSQL Identifiers #5338
base: main
Are you sure you want to change the base?
Conversation
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.
Hey @cigar-galaxy82 ,
The entry LGTM. I have suggested a few changes please make them asap, so I can merge this PR.
@@ -0,0 +1,289 @@ | |||
--- | |||
Title: 'Identifier' | |||
Description: 'Refers to the name given to databases object such as tables, columns, indexes, etc.' |
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: 'Refers to the name given to databases object such as tables, columns, indexes, etc.' | |
Description: 'Refers to the name given to database objects such as tables, columns, indexes, etc.' |
- 'paths/analyze-data-with-sql' | ||
--- | ||
|
||
In PostgreSQL, identifiers refer to the names given to database objects such as tables, columns, indexes, views, sequences, and other database components. |
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.
In PostgreSQL, identifiers refer to the names given to database objects such as tables, columns, indexes, views, sequences, and other database components. | |
In PostgreSQL, **Identifiers** refer to the names given to database objects such as tables, columns, indexes, views, sequences, and other database components. |
First mention of the concept must be in bold.
`Identifier Types` refers to names given to objects in a database like tables, columns, indexes, and other components of a database. These names help **PostgreSQL** to interact with the database. The are different types of Identifier that are used. | ||
|
||
- Table Identifier | ||
- Column Identifiers | ||
- Index Identifiers | ||
- View Identifiers | ||
- Constraint Identifiers | ||
- Schema Identifiers | ||
- Sequence Identifiers | ||
- Function Identifiers | ||
- Trigger Identifiers | ||
- Role Identifiers | ||
- Foreign Key Identifiers | ||
- Aggregate Type Identifiers | ||
- Tablespace Identifiers |
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.
`Identifier Types` refers to names given to objects in a database like tables, columns, indexes, and other components of a database. These names help **PostgreSQL** to interact with the database. The are different types of Identifier that are used. | |
- Table Identifier | |
- Column Identifiers | |
- Index Identifiers | |
- View Identifiers | |
- Constraint Identifiers | |
- Schema Identifiers | |
- Sequence Identifiers | |
- Function Identifiers | |
- Trigger Identifiers | |
- Role Identifiers | |
- Foreign Key Identifiers | |
- Aggregate Type Identifiers | |
- Tablespace Identifiers | |
`Identifier Types` refers to names given to objects in a database like tables, columns, indexes, and other components of a database. These names help **PostgreSQL** to interact with the database. There are different types of identifiers that are used. | |
- Table Identifiers | |
- Column Identifiers | |
- Index Identifiers | |
- View Identifiers | |
- Constraint Identifiers | |
- Schema Identifiers | |
- Sequence Identifiers | |
- Function Identifiers | |
- Trigger Identifiers | |
- Role Identifiers | |
- Foreign Key Identifiers | |
- Aggregate Type Identifiers | |
- Tablespace Identifiers |
|
||
### Table Identifier | ||
|
||
Table Identifier refers to the name given to a table in the database. These names are used for interacting with the tables, they must follow certain rules like each table must have a unique name, using only characters in the name that are allowed, etc. |
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.
Table Identifier refers to the name given to a table in the database. These names are used for interacting with the tables, they must follow certain rules like each table must have a unique name, using only characters in the name that are allowed, etc. | |
A Table Identifier refers to the name given to a table in the database. These names are used for interacting with the tables, and must follow certain rules such as each table must have a unique name, using only characters in the name that are allowed, etc. |
|
||
### Schema Identifiers | ||
|
||
Schema Identifiers refers to name given to schemas, which are logical container for building relation between tables, views, indexes and other database objects. It helps in organizing database object and avoid conflicts. |
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.
Schema Identifiers refers to name given to schemas, which are logical container for building relation between tables, views, indexes and other database objects. It helps in organizing database object and avoid conflicts. | |
Schema Identifiers refer to names given to schemas, which are a logical container for building relations between tables, views, indexes, and other database objects. It helps organize database objects and avoid conflicts. |
I rephrased the sentence for more clarity.
|
||
### Sequence Identifiers | ||
|
||
Sequence Identifiers refer to names assigned to sequences which are used to generate unique integer values and can be used in scenarios when the purpose is to make sure each row has a distinct value, typically used for auto-incrementing primary key columns. |
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.
Sequence Identifiers refer to names assigned to sequences which are used to generate unique integer values and can be used in scenarios when the purpose is to make sure each row has a distinct value, typically used for auto-incrementing primary key columns. | |
Sequence Identifiers refer to names assigned to sequences that are used to generate unique integer values and can be used in scenarios when the purpose is to make sure each row has a distinct value, typically used for auto-incrementing primary key columns. |
|
||
#### Example | ||
|
||
In the below example a custom function `add_numbers` used to add numbers passed to it: |
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.
In the below example a custom function `add_numbers` used to add numbers passed to it: | |
In the below example a custom function `add_numbers` is used to add numbers passed to it: |
|
||
### Role Identifiers | ||
|
||
Role Identifiers refer to names given to roles which are used to manage roles within the database. They are fundamental parts of security and permission systems They can be used to give certain access to a user like reading all the tables, writing to all tables, etc. |
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.
Role Identifiers refer to names given to roles which are used to manage roles within the database. They are fundamental parts of security and permission systems They can be used to give certain access to a user like reading all the tables, writing to all tables, etc. | |
Role Identifiers refer to names given to roles that are used to manage roles within the database. They are fundamental parts of security and permission systems They can be used to give certain access to a user like reading all the tables, writing to all tables, etc. |
CREATE TABLE departments ( | ||
id SERIAL PRIMARY KEY, | ||
name VARCHAR(100) | ||
); | ||
|
||
CREATE TABLE employees ( | ||
id SERIAL PRIMARY KEY, | ||
name VARCHAR(100), | ||
department_id INT, | ||
CONSTRAINT fk_department FOREIGN KEY (department_id) | ||
REFERENCES departments(id) | ||
ON DELETE CASCADE |
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.
CREATE TABLE departments ( | |
id SERIAL PRIMARY KEY, | |
name VARCHAR(100) | |
); | |
CREATE TABLE employees ( | |
id SERIAL PRIMARY KEY, | |
name VARCHAR(100), | |
department_id INT, | |
CONSTRAINT fk_department FOREIGN KEY (department_id) | |
REFERENCES departments(id) | |
ON DELETE CASCADE | |
CREATE TABLE departments ( | |
id SERIAL PRIMARY KEY, | |
name VARCHAR(100) | |
); | |
CREATE TABLE employees ( | |
id SERIAL PRIMARY KEY, | |
name VARCHAR(100), | |
department_id INT, | |
CONSTRAINT fk_department FOREIGN KEY (department_id) | |
REFERENCES departments(id) | |
ON DELETE CASCADE | |
); |
Added closing parenthesis for employees table SQL statement.
|
||
#### Example | ||
|
||
In the below example, a build-in `SUM` aggregate function is used and a custom aggregate function `my_sum` is created and used. |
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.
In the below example, a build-in `SUM` aggregate function is used and a custom aggregate function `my_sum` is created and used. | |
In the below example, a built-in `SUM` aggregate function is used and a custom aggregate function `my_sum` is created and used. |
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.
Hey @cigar-galaxy82 ,
The entry LGTM.
Thanks,
Savi
|
||
In the below example `employees` is the table identifier: | ||
|
||
```pseudo |
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.
```pseudo | |
```sql |
|
||
#### Example | ||
|
||
In the below example, `employee_name_idx` index is created on the `employees` table: |
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.
In the below example, `employee_name_idx` index is created on the `employees` table: | |
In the below example, the `employee_name_idx` index is created on the `employees` table: |
|
||
Foreign Key Identifiers are used to give names to foreign key constraints that help in establishing a relationship between two tables, it helps in building relations between columns in different tables. It ensures that values in one column (or a set of columns) match values in another column, typically the primary key of another table. | ||
|
||
### Example |
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.
### Example | |
#### Example |
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.
I think we should split this concept into different terms and just explain all the identifiers in very short way, what do you say @cigar-galaxy82 ?
This entry is too long if we see the docs standards for concept entry. |
Hi @dakshdeepHERE I get your point, sure I can split the entry in first just identifier, and create a different file for each type of identifier |
Description
Issue Solved
#4532
Type of Change
Checklist
main
branch.Issues Solved
section.