Skip to content

Лабораторная работа №2#3

Open
DimaRus05 wants to merge 2 commits intomainfrom
lab2
Open

Лабораторная работа №2#3
DimaRus05 wants to merge 2 commits intomainfrom
lab2

Conversation

@DimaRus05
Copy link
Owner

No description provided.

@DimaRus05 DimaRus05 requested a review from pagaf September 21, 2025 12:27
lab2.sql Outdated
SELECT *
FROM "HR"."Employees"
WHERE city = 'London'
AND (title LIKE '%Manager%' OR title ILIKE '%manager%')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Зачем 2 лайка? like и ilike????

lab2.sql Outdated
WHERE city = 'London'
AND (title LIKE '%Manager%' OR title ILIKE '%manager%')
AND (titleofcourtesy = 'Dr.'
OR LOWER(titleofcourtesy) LIKE 'mr%');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOWER(titleofcourtesy) - это вычисляемый столбец, а не исходный.
Мы договаривались, что фильтрация должна выполняться на исходных данных

lab2.sql Outdated
WHERE contactname NOT LIKE '%Linda%'
AND contactname NOT LIKE '%Robert%'
AND contactname NOT LIKE '%Ann%'
AND contactname NOT LIKE '%Venky%';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4!!! Условия!!!
Перепишите фильтр, чтобы было одно условия
Тем более, что ваш фильтр не корректен: '%Ann%' - вы отфильтруете и Annett-у

lab2.sql Outdated
OR SUBSTRING(TRIM(SUBSTRING(contactname FROM POSITION(',' IN contactname) + 1)) FROM 1 FOR 1) = 'M')
AND
(SUBSTRING(TRIM(SUBSTRING(contactname FROM 1 FOR POSITION(',' IN contactname) - 1)) FROM 1 FOR 1) = 'S'
OR SUBSTRING(TRIM(SUBSTRING(contactname FROM 1 FOR POSITION(',' IN contactname) - 1)) FROM 1 FOR 1) = 'K');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Одно условие на исходном столбце!!! А не куча условий на вычисляемых столбцах :(((

Copy link
Collaborator

@ksigorodetskaya ksigorodetskaya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Внести исправления в соответствие с замечаниями

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants