Skip to content

Instantly share code, notes, and snippets.

View spaghettiSyntax's full-sized avatar
🏠
Working from home

spaghettiSyntax spaghettiSyntax

🏠
Working from home
View GitHub Profile
@spaghettiSyntax
spaghettiSyntax / guitarShop1.sql
Created December 6, 2017 07:39
murach's SQL SERVER 2016: GuitarShop 1
--Exercise 1 Test After Columns are entered, then with ORDER BY clause entered
SELECT ProductCode
, ProductName
, ListPrice
, DiscountPercent
FROM Products
ORDER BY ListPrice DESC;
--Exercise 2 Ascending order M-Z last names with combined name = Full name
SELECT LastName + ', ' + FirstName AS [Full Name]
@spaghettiSyntax
spaghettiSyntax / exercises1.sql
Created December 6, 2017 07:36
murach's SQL SERVER 2016: Exercises 1
--Exercise 1
SELECT VendorContactLName AS [Last Name]
, VendorContactFName AS [First Name]
, VendorName AS [Vendor]
FROM Vendors
ORDER BY VendorContactLName
, VendorContactFName; --Learned to use column numbers as ORDER BY's,
--but not recommended & Semi-Colon use will be
--required in future SQL Server editions so to
--get used to ending each statement with one.
@spaghettiSyntax
spaghettiSyntax / ch3_Notes.sql
Created December 6, 2017 07:29
murach's SQL SERVER 2016: Ch3 Notes
--AM CP 150 9/27 Ch 3
/*
This is a Multi-Line
Comment
*/
--SELECT *
--Grabs all columns
--from vendors tab
--Semi-Colon to show end of queries, not necessary in T-SQL
@spaghettiSyntax
spaghettiSyntax / compound.py
Created December 6, 2017 07:15
Tony Gaddis Python: Compound Interest
#ch_2_jrn_4
#Exercise 14
#This program calculates
#Compound Interest
print(' ')
print('Calculate compound interest by inputting values.')
print(' ')
@spaghettiSyntax
spaghettiSyntax / hotdogBuns.py
Created December 6, 2017 07:14
Tony Gaddis Python: Hot Dogs and Buns
#Write a Python program to convert a number of hot dogs to a number of
#packs of hot dogs and a number of packs of buns. You can assume that hot
#dogs come 10 to a pack and that buns come 8 to a pack. Prompt the user to
#enter a number of hotdogs, then compute and print the number of packages
#of hot dogs and buns that are needed to ensure you have enough hot dogs
#and buns,For example, if you need to serve 75 hot dogs and buns, you will
#need 8 packages of hot dogs and 10 packages of buns. To get the calculation
#of packages to come out to an integer, use math.ceil. For example,
#math.ceil(1.23)will give the value 2 as an integer. So if you need num_dogs,
#( say, 75)hot dogs and buns, that is math.ceil(num_dogs /10), i.e. 8,
@spaghettiSyntax
spaghettiSyntax / format.py
Created December 6, 2017 07:12
Tony Gaddis Python: Formatting
#To round a number when printing, we use the format function. Write the
#following code, run it to see what it prints. Then change the ‘.2f’ to
#‘.3f’ and see how that affects the results.
amount_due = 5000.0
payment = amount_due / 12
print('payment is', format(payment, '.2f'))
amount_due = 5000.0
payment = amount_due / 12
@spaghettiSyntax
spaghettiSyntax / personInfo.py
Created December 6, 2017 07:10
Tony Gaddis Python: Personal Info
# this program asks the user for
# personal data and then prints
# it on the screen
name = input('Name: ')
city = input('City: ')
state = input('State: ')
zipcode = input('ZIP Code: ')
telephone_number = input('Telephone: ')
email_address = input('E-Mail: ')
@spaghettiSyntax
spaghettiSyntax / average.py
Created December 6, 2017 07:09
Tony Gaddis Python: Average
# this program will compute
# the average of three values
# input by the user.
x = float(input('Number: '))
y = float(input('Number: '))
z = float(input('Number: '))
average = (x + y + z) / 3
@spaghettiSyntax
spaghettiSyntax / tipTaxFoodCalc.py
Created December 6, 2017 07:06
Tony Gaddis Python: Tip, Tax, Food
# Tip, Tax Food Calculator
# First Flowchart problem homework 1
# We will use 18% as the tip rate
TIP_PERCENTAGE = 0.18
# Currently the tax rate is 9%
TAX_PERCENTAGE = 0.09
charge_for_food = float(input('Input charge for food: '))
@spaghettiSyntax
spaghettiSyntax / lastName.py
Created December 6, 2017 07:04
Tony Gaddis Python: Last Name
# Asks for user's last name.
name = input('Last name: ')
print('Last name is:', name)