This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
#price | |
water = 1.00 | |
cola = 1.50 | |
Redbull = 2.00 | |
#Printing what machine have in menu | |
print("1.Water = $%s" % water) | |
print("2.Cola = $%s" % cola) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Instagram database clone-- | |
--SCHEMA-- | |
-- users-- | |
CREATE TABLE users ( | |
id INT AUTO_INCREMENT PRIMARY KEY, | |
username VARCHAR(255) UNIQUE NOT NULL, | |
created_at TIMESTAMP DEFAULT NOW() | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
first_name, | |
last_name, | |
COUNT(rating) AS count, | |
IFNULL(MIN(rating),0) AS min, | |
IFNULL(MAX(rating), 0) AS max, | |
ROUND(IFNULL(AVG(rating), 0), 2) AS avg, | |
CASE | |
WHEN COUNT(rating) > 0 THEN 'ACTIVE' | |
ELSE 'INACTIVE' |