Skip to content

Instantly share code, notes, and snippets.

View DigitalSapience's full-sized avatar
🌍

Theodore DigitalSapience

🌍
  • Berlin
View GitHub Profile
@DigitalSapience
DigitalSapience / postgres-cheatsheet.md
Created January 10, 2022 08:11 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
#task1 Создать лист из 6 любых чисел. Отсортировать его по возрастанию
list10 = [1, 3, 10, 2, 22, 44, 2, 0, 11]
list10.sort()
#task2 Создать словарь из 5 пар: int -> str, например {6: '6'}, вывести его в консоль попарно
#task3 Создать tuple из 10 любых дробных чисел, найти максимальное и минимальное значение в нем
tuple = (1/2, 2/12, 2/44, 41/11, 24/22, 22/19, 3/2, 4/7, 11/9, 2/3)
#homework 1
#riddle 1
riddle1 = input('Лучший язык програмирования?')
corrent_answer = 'python'
riddle1 == correct_answer
#riddle 2