Skip to content

Commit 8364053

Browse files
committed
database section + postgresql final review
1 parent 0ae3644 commit 8364053

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

docs/data_science_tools/database_postgresql.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ To get PostgreSQL running on your local machine, you will need to have the follo
2626

2727
1. **PostgreSQL Server**: You can follow the step-by-step instructions provided on the [official website](https://www.postgresql.org/download/). Once the installation is complete, you can run the server by opening the application.
2828

29-
2. **PostgreSQL Admin/Dev Tools**: Once the PostgreSQL server is installed, you can install tools to manage and interact with PostgreSQL. There are multiple choices, each with its own set of unique features and all of them support the basic functionalities. Here are some famous ones - [PgAdmin](https://www.pgadmin.org/), [DBeaver](https://dbeaver.io/), or you can even use terminal tools like [Psql](https://www.postgresql.org/docs/current/app-psql.html).
29+
2. **PostgreSQL Query Tools**: Once the PostgreSQL server is installed, you can install tools to manage and interact with PostgreSQL. There are multiple choices, each with its own set of unique features and all of them support the basic functionalities. Here are some famous ones - [PgAdmin](https://www.pgadmin.org/), [DBeaver](https://dbeaver.io/), or you can even use terminal tools like [Psql](https://www.postgresql.org/docs/current/app-psql.html).
3030

3131
!!! Hint
3232
**Installation on Mac**
@@ -226,7 +226,7 @@ result = await conn.fetch(
226226
)
227227
```
228228

229-
You can use `conn.execute` to run the query without fetching the result. Below is the modification to the code shown above.
229+
You can use `conn.execute` to run the query without fetching the result. Below is the modification needed.
230230

231231
```python linenums="1"
232232
# insertion example (one row)
@@ -303,7 +303,7 @@ if __name__ == '__main__':
303303
loop.run_until_complete(execute_fetch_script(script, values, "Testing Run"))
304304
```
305305

306-
If you notice, all of the above examples are executing the query in one transaction. In case you want to execute multiple queries in one transaction, you can do as shown below,
306+
If you noticed, all of the above examples are executing the query within a single transaction. In case you want to execute multiple queries in one transaction, you can do as shown below,
307307

308308
```python linenums="1"
309309
# import
@@ -320,10 +320,10 @@ conn = await asyncpg.connect(user='postgres', password='admin',
320320
async with conn.transaction():
321321

322322
try:
323-
# execute the select SQL script
323+
# Query 1 - execute the select SQL script
324324
records = await conn.fetch('SELECT * FROM mytbl where projectid = $1 LIMIT $2', 2, 1)
325325

326-
# update the table
326+
# Query 2 - update the table
327327
await conn.execute('UPDATE mytbl SET name = $1 where projectid = $2', 'mohit', 2)
328328

329329
# handle exception

docs/data_science_tools/databases_introduction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Introduction
44

5-
Databases are like a smart repository of data, where you can keep data in a structured, organized, and secure manner. While you might argue something like, "Why can't I just keep them in a single txt file?", remember things starts to get messy when you have a lot of data *(millions of entries and more)* and you want to be fast in execution *(finding one entry in any modern database will be much faster than from a txt file)*. In a way, databases allow for efficient retrieval, manipulation, and analysis of data. They also offer powerful querying and analysis capabilities, enabling data scientists and analysts to extract insights and make data-driven decisions. This makes them a powerful tool for data science projects.
5+
Databases are like a smart repository of data, where you can keep data in a structured, organized, and secure manner. While you might argue something like, "Why can't I just keep them in a single txt file?", remember things starts to get messy when you have a lot of data *(millions of entries and more)* and you still want to be fast *(finding one entry in any modern database will be much faster than from a txt file)*. In a way, databases allow for efficient retrieval, manipulation, and analysis of data. They also offer powerful querying and analysis capabilities, enabling data scientists and analysts to extract insights and make data-driven decisions. This makes them a powerful tool for data science projects.
66

77
This article will briefly focus on the different types of databases, their features and some important generic concepts. You can also find separate articles for individual databases in this section. So without further delay, let's get started!
88

@@ -28,7 +28,7 @@ Relational databases are the most common type of database. They are structured u
2828
| **Popularity Rank** | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
2929

3030
!!! Warning
31-
Some details in the above table *(like Popularity Rank)* is as per the information aggregated from multiple sources at the time *(August 2024)*. This is subject to change in future.
31+
Some details in the above table *(like Popularity Rank)* are as per the information aggregated from multiple sources at the time the article was written *(August 2024)*. This could change over time.
3232

3333
This table summarizes the key features and characteristics of some of the top relational databases, highlighting their strengths and use cases. Oracle leads in enterprise environments, while MySQL and PostgreSQL are popular for web applications and diverse workloads. Microsoft SQL Server is favored in corporate settings, and MariaDB is recognized for its compatibility with MySQL. SQLite is widely used for lightweight applications, and IBM Db2 and SAP HANA cater to specific enterprise needs.
3434

0 commit comments

Comments
 (0)