Conversation
|
|
||
| -- 6. Какая функция позволяет выполнить замену NULL значения на значимую величину? | ||
| -- COALESCE, NULLIF, CASE WHEN | ||
| SELECT COALESCE(NULL, 'value') AS coalesce_example; |
Collaborator
There was a problem hiding this comment.
NULLIF -????
CASE WHEN - это не функция, а выражение
hw2.sql
Outdated
|
|
||
| -- 7. Какая функция (функции) позволяет получить: | ||
| -- a. Часть строки, удовлетворяющую заданной маске? | ||
| -- SUBSTRING, REGEXP_MATCH, REGEXP_REPLACE |
Collaborator
There was a problem hiding this comment.
Где примеры применения еще двух функций?
hw2.sql
Outdated
| SELECT LEFT('example string', 10) AS left_example; | ||
| -- c. Все символы справа, начиная с указанной позиции | ||
| -- RIGHT, SUBSTRING | ||
| SELECT RIGHT('example string', 6) AS right_example; |
Collaborator
There was a problem hiding this comment.
Не верное использование второго аргумента
hw2.sql
Outdated
|
|
||
| -- 8. Какая функция используется для округления числа до 2-х знаков после запятой? | ||
| -- ROUND, TRUNC, CAST | ||
| SELECT ROUND(123.4567, 2) AS round_example; |
hw2.sql
Outdated
| UPPER(SUBSTRING('строковые' FROM 1 FOR 1)) || SUBSTRING('строковые' FROM 2) || ' ' || | ||
| UPPER(SUBSTRING('функции' FROM 1 FOR 1)) || SUBSTRING('функции' FROM 2) || ' ' || | ||
| UPPER(SUBSTRING('PostgreSQL' FROM 1 FOR 1)) || SUBSTRING('PostgreSQL' FROM 2) | ||
| AS initcap_string; |
Collaborator
There was a problem hiding this comment.
Хочу увидеть логическое решение
hw2.sql
Outdated
| -- c. Замените в массиве элемент sqlserver на postgres | ||
| SELECT ARRAY_REPLACE(ARRAY['sql', 'sqlserver', 'database', 'plsql'], 'sqlserver', 'postgres') AS replaced_array; | ||
| -- d. Верните из полученного массива последний элемент | ||
| SELECT (ARRAY_REPLACE(ARRAY['sql', 'sqlserver', 'database', 'plsql'], 'sqlserver', 'postgres'))[4] AS last_element; |
Collaborator
There was a problem hiding this comment.
Разве сказано вернуть 4-й элемент? Вернуть последний!!!
Collaborator
There was a problem hiding this comment.
Необходимо внести исправления в соответствии с комментариями.
Collaborator
|
Все ок! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.