Sobes.tech
Intern

28. Какие потоки данных в Linux вы знаете? 29. Укажите варианты запросов которые выполнятся без ошибок - select * from processing_db where user_id=413; - SELECT user_id FROM processing_db; - select * from processing_db where user_id=413 - select * from pg_state_activity where db_name="processing_db"; - select * form instruct;

sobes.tech AI

Answer from AI

In Linux, the following main data streams (standard streams) exist:

  • stdin (standard input) — the stream from which the program reads data (usually the keyboard).
  • stdout (standard output) — the stream to which the program outputs data (usually the screen).
  • stderr (standard error stream) — the stream for error messages.

These streams can be redirected and used to organize pipelines (pipes).


Options of SQL queries that will execute without errors:

  • select * from processing_db where user_id=413; — correct query.
  • SELECT user_id FROM processing_db; — correct query.
  • select * from processing_db where user_id=413 — correct query, the semicolon at the end is not mandatory.

Errors in other queries:

  • select * from pg_state_activity where db_name="processing_db"; — error due to using double quotes for strings; in SQL, strings are enclosed in single quotes: 'processing_db'.
  • select * form instruct; — typo in the word form instead of from.

A correct example of the fixed query:

select * from pg_stat_activity where datname='processing_db';