Skip to content

Instantly share code, notes, and snippets.

@Manuela82
Manuela82 / Homework_3.3_Losty.sql
Created June 1, 2020 15:24
Create Database, Create Tables,....
CREATE DATABASE "Losty";
CREATE TABLE "Customer" (
"ID" INTEGER PRIMARY KEY AUTOINCREMENT,
"First_name" TEXT,
"Last_name" TEXT,
"Email" TEXT,
"Phone_number" TEXT
);
@Manuela82
Manuela82 / Relationships_Homework_2.1.V.2.0.sql
Last active May 29, 2020 13:25
Relationships, JOIN, GROUP BY, MIN, MAX, etc...
SELECT MAX (Invoice.Total), *
FROM Invoice;
SELECT MIN (Invoice.Total), *
FROM Invoice;
SELECT COUNT(Invoice.BillingCity) AS Invoice_num, Invoice.BillingCity
FROM Invoice
GROUP BY Invoice.BillingCity
ORDER BY Invoice_num DESC;
Select Name
From Artist;
Select *
From Invoice
Where Invoice.BillingCountry='Germany';
Select count (*)
From Album;
SELECT Count (*)
From Teilnahme
Where Teilnahme.Essensauswahl='Fleisch';
@Manuela82
Manuela82 / gist:57f90c7a0967134095a12ebbf662dfd2
Created November 20, 2017 21:46
guess_the_secret_number_main_and_random
import random
secret = 28
print "Welcome to 'Guess the secret number'"
def main():
while True:
random_num = random.randint(0, 29)
print "You don't know which number you want to choose? You can take our randomly created number:" " " \
country_capital_dict = {"Slovenia": "Ljubljana", "Croatia": "Zagreb", "Austria": "Vienna"}
def main():
country_capital_dict = {"Slovenia": "Ljubljana", "Croatia": "Zagreb", "Austria": "Vienna"}
while True:
selected_country = country_capital_dict.keys()[0]
guess = raw_input("What is the capital of %s? " % selected_country)
@Manuela82
Manuela82 / menu.py
Created November 18, 2017 20:44 — forked from kiwiBBC/menu.py
print "Welcome to our fabulous menu creator!"
menu_dict = {}
while True:
dish = raw_input("Please enter a dish: ")
price = raw_input("Please enter a price for the dish: ")
if price == True:
menu_dict[dish] = True
else:
menu_dict[dish] = price
print "TODAY'S MENU\n"
menu_dict = {}
while True:
dish = raw_input("Please enter today's dish: ")
price = raw_input("Please enter the price of that dish: EUR ")
if dish == True:
menu_dict[dish] = True
@Manuela82
Manuela82 / converter.py
Created November 14, 2017 17:12
converter
print "Hello, I'm converting kilometers into miles.\n"
kilometres = raw_input("Please enter the amount of kilometres: ")
miles = float(kilometres) * 0.621372
print miles
answer = raw_input("Do you want to do another conversion? ")
while answer == "yes":
kilometres = raw_input("Please enter the amount of kilometres: ")
@Manuela82
Manuela82 / main.py
Last active November 11, 2017 21:41
secret = 28
guess = int(raw_input("Guess the secret number: "))
if guess == secret:
print "Congratulations!!!"
else:
print "Sorry, wrong number. Try it again!"