Skip to content

Instantly share code, notes, and snippets.

@Kegnar
Created July 4, 2025 16:31
Show Gist options
  • Select an option

  • Save Kegnar/fb85b1cfe5f6ae01c774ed5cc799dd56 to your computer and use it in GitHub Desktop.

Select an option

Save Kegnar/fb85b1cfe5f6ae01c774ed5cc799dd56 to your computer and use it in GitHub Desktop.
SQL_Homework#2
--Выведите поступления денег от пользователя с email 'vasya@mail.com'.
select * from billing
where payer_email = 'vasya@mail.com'
--Добавьте в таблицу одну запись о платеже
insert into billing (payer_email, recipient_email, sum, currency, billing_date, comment)
values
('pasha@mail.com', 'katya@mail.com', 300.00, 'EUR', 20160214, 'Valentines day present)');
--Измените адрес плательщика на 'igor@mail.com' для всех записей таблицы, где адрес плательщика 'alex@mail.com'.
update billing
set payer_email = 'igor@mail.com'
where payer_email = 'alex@mail.com'
--
--Удалите из таблицы записи, где адрес плательщика или адрес получателя установлен в неопределенное значение или пустую строку.
delete from billing
where payer_email is null or recipient_email is null or payer_email = '' or recipient_email = '';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment