Skip to content

Instantly share code, notes, and snippets.

View onegrx's full-sized avatar

Bartłomiej Szałach onegrx

  • Kraków, Poland
View GitHub Profile
use joindb
select buyer_name, qty
from Buyers
cross join sales
select buyer_name, prod_name, qty
from buyers
inner join sales on buyers.buyer_id = sales.buyer_id
inner join produce on sales.prod_id = produce.prod_id
use library
select fine_paid, in_date, member_no, datediff(day, due_date, in_date) as time_delay
from title inner join loanhist on title.title_no = loanhist.title_no
where title = 'Tao Teh King' and in_date > due_date
select isbn
from reservation inner join member on reservation.member_no = member.member_no
where firstname = 'Stephen' and middleinitial = 'A' and lastname = 'Graff'
@onegrx
onegrx / northwind.sql
Last active October 29, 2015 13:01
Databases 29 Oct, sum
use northwind
select productid, sum(quantity) as totalquan
from [Order Details]
group by productid
having sum(quantity)>1200
select orderid, count(*)
from [Order Details]
group by OrderID
@onegrx
onegrx / conversation
Created April 12, 2015 18:58
Namecheap problem
21:31 Your Question: I got GitHub Student Developer Pack and active @edu email. Can I register a free .me domain on your website even
though I do not live in US/UK/CAN/AUS?
21:31 Please wait, an operator will be with you shortly.
21:32 You are now chatting with Eugenia K. ­ Domains Support
21:32 Eugenia K.: Hello! Thank you for contacting our Live Chat Support!
21:32 Eugenia K.: You can grab your free .me domain only on condition that you claim it through Github student pack
21:33 Bartłomiej Szałach: Yes, I do claim it throug GH.
21:33 Bartłomiej Szałach: But before order I was asked to give my adress and only those countries were available
21:33 Bartłomiej Szałach: Should I fill the form random data?
21:34 Bartłomiej Szałach: Or have I done something wrong way?