Skip to content

Instantly share code, notes, and snippets.

View chukwujekwu-code's full-sized avatar

Chukwujekwu chukwujekwu-code

View GitHub Profile
SELECT column1, column2, ...
FROM table_name;
SELECT column_name(s)
FROM table_name
WHERE condition
GROUP BY column_name(s)
ORDER BY column_name(s);
SELECT column_name
FROM table_name # the main query
WHERE column_name expression operator
( SELECT COLUMN_NAME from TABLE_NAME WHERE ... ) #the subquery;
WITH my_cte AS (
SELECT a,b,c
FROM T1
)
SELECT a,c
FROM my_cte
WHERE ....
WITH my_cte AS (
SELECT column1, column2, column3
FROM table
)
SELECT column1, column3
FROM my_cte
WHERE condition ;
SELECT column_name(s)
FROM table1
INNER JOIN table2
ON table1.column_name = table2.column_name;
# import modules
import random, sys
# start the game
Print('ROCK, PAPER, SCISSORS')
wins = 0
losses = 0
ties = 0
while True: # The main game loop
print('%s Wins, %s Losses, %s Ties' % (wins, losses, ties))
while True: # The player input loop.
print('Enter your move: (r)ock (p)aper (s)cissors or (q)uit')
playerMove = input()
if playerMove == 'q':
sys.exit() #Quit the program.
if playerMove == 'r' or playerMove == 'p' or playerMove == 's':
break # Break out of the player input loop.
print('Type one of r, p, s, or q.')