Читать книгу Английский для программистов. Как общаться в международных IT-командах - - Страница 9

Working with Databases (Работа с базами данных)

Оглавление

Оля, опытный разработчик, делится своим опытом с новичком, Вячеславом, который только начинает изучать взаимодействие с базами данных в проекте.


Оля объясняет Вячеславу, как использовать SQL для работы с данными и какие шаги нужно предпринять для безопасной работы с базами данных.


Диалог на встрече:


Olya:

«Hi, Vyacheslav! Today we need to connect our app to the database and perform some queries. Have you worked with databases before?»


Vyacheslav:

«Not much, I’ve only used simple examples for practice. What should I do first?»


Olya:

«First, you need to establish a connection to the database. You’ll use a connection string that includes the database host, username, password, and database name.»


Vyacheslav:

«Okay, I understand. So after I connect to the database, what’s the next step?»


Olya:

«Once connected, you can start executing SQL queries. For example, you can use a SELECT query to retrieve data, or INSERT to add new records.»


Vyacheslav:

«Got it! Do I need to worry about SQL injection when working with user inputs?»


Olya:

«Definitely! SQL injection is a big security concern. You should always use parameterized queries or prepared statements to prevent SQL injection attacks.»


Vyacheslav:

«Thanks for the tip! After I execute the query, how do I handle the results?»


Olya:

«Good question! You’ll typically get the results as a data set. Then you can loop through it and extract the values you need.»


Vyacheslav:

«Great! I’ll start by setting up the connection and writing some basic queries.»


Olya:

«Perfect! Let me know if you run into any issues. Don’t forget to close the connection after you’re done.»

Полезные фразы и выражения

Connection string – строка подключения.


SQL queries – SQL-запросы.


SELECT query – запрос SELECT (для получения данных).


INSERT query – запрос INSERT (для добавления данных).


SQL injection – SQL-инъекция (вредоносные запросы).


Parameterized queries – параметризованные запросы.


Prepared statements – подготовленные запросы.


Data set – набор данных (результаты запроса).


Close the connection – закрыть соединение.

Упражнения

1. Vocabulary Match:


Соедините английские фразы с их русскими эквивалентами:


Connection string


SELECT query


INSERT query


SQL injection


Data set


a) SQL-инъекция

b) Строка подключения

c) Запрос SELECT

d) Запрос INSERT

e) Набор данных


2. Fill in the blanks:


Заполните пропуски подходящими словами из списка:


«To connect to the database, you need a ______ that contains the host, username, password, and database name.»


«We will use a ______ to retrieve data from the database.»


«Make sure to use ______ to avoid potential security risks.»


«After executing the query, the results will be returned as a ______.»


(Answers: connection string, SELECT query, SQL injection, data set)


3. Translate the following sentences into English:


Для подключения к базе данных необходимо использовать строку подключения с данными для аутентификации.


Мы будем использовать запрос SELECT для извлечения данных.


Не забудьте закрыть соединение с базой данных после выполнения запросов.


4. Conversation Practice:


Практикуйте диалог с партнером или самостоятельно, используя фразы из главы. Один из вас будет играть роль Оли, а другой – Вячеслава. Пример:


Person 1 (Olya): «Vyacheslav, don’t forget to close the connection once you’re done with the database.»


Person 2 (Vyacheslav): «Yes, I’ll make sure to do that after executing the queries.»


Самопроверка:


Which of the following phrases means «a query used to retrieve data from the database»?


a) INSERT query


b) SELECT query


c) SQL injection


What is the purpose of parameterized queries?


a) To execute SQL queries faster


b) To prevent SQL injection


c) To handle results from a database query


Choose the correct sentence in English:


a) «I will write a parameterized query to prevent SQL injection attacks.»


b) «I will write a parameterize query to prevent SQL injection attacks.»

Ответы

1. Vocabulary Match:

1 – b

2 – c

3 – d

4 – a

5 – e


2. Fill in the blanks:


«To connect to the database, you need a connection string that contains the host, username, password, and database name.»


«We will use a SELECT query to retrieve data from the database.»


«Make sure to use parameterized queries to avoid potential security risks.»


«After executing the query, the results will be returned as a data set.»


3. Translate the sentences:


To connect to the database, you need to use a connection string with authentication data.


We will use the SELECT query to retrieve data.


Don’t forget to close the connection to the database after executing the queries.


4. Self-Check:


b) SELECT query


b) To prevent SQL injection


a) «I will write a parameterized query to prevent SQL injection attacks.»

Английский для программистов. Как общаться в международных IT-командах

Подняться наверх