Wednesday, October 3, 2018

Normalization: Morning

Here are the rules for the first three normal forms

First Normal Form

Everything in a column must be of the same type (logically, datatype)

No Lists

No arrays

if lists or arrays break into a new entity

Second Normal Form

Get rid of subsets, groups of attributes that depend on each other rather than the topic (key) of the Entity (the group of advisor attributes that don't relate directly to student.)

Structural dependencies.

Third normal forms

- remove transitive dependency. One attribute that relates to something other than the topic of the entity.

The gist

Every column should have values of the same type

No arrays or lists (any plural values should be broken into their own entity)

An entity should only be about one thing

Anything that relates to something other than the topic of entity should be broken out into a new entity

Here is the student Entity as we started

Here is the diagram after normalizing

Tuesday, October 2, 2018

More python and loops:

Conversion.py

#conversion.py
# A program that converts celsius to fahrenheit
# by steve

#steps
#look up conversion formula
#get the celsius from input
#apply the equation (9/5)* c + 32)
# display the results

def main():
    print ("This program converts Celsius temperatures to Fahrenheit.")
    celsius=eval(input("Please enter a celsius temperature: "))
    fahrenheit = 9/5 * celsius + 32
    print("The fahrenheit temperature is", fahrenheit)

main()

Loops.py

# look at counted loops

def main():
    sum=0.0
    loops = int(input("How many numbers do you want to enter: "))
    for i in range(loops):
        number = int(input("Enter an integer"))
        sum =sum + number
    average=sum/loops
    print("the total is:",sum)
    print("the average is:",average)

main()

Monday, October 1, 2018

First Entity Relationships Afternoon

Here are the bakery entities and relationships

Here are the relationship diagrams

First ERDs mornings

Here is our little bakery ERD as far as we god

Here Are the diagrams for relationships

Thursday, September 27, 2018

First Python

First console

Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> print("Hello")
Hello
>>> name = 'Steve'
>>> print("hello, ",name)
hello,  Steve
>>> name=input("Enter your name: ")
Enter your name: Bob
>>> print ("Hello,",name)
Hello, Bob
>>> 

Hello Bob Program

#This program takes a name as input
#and outputs a greeting
#steve C 9/27/2018

#input
#process (algorithm) --
#def of algorithm--steps needed to accomplish a task
# in the order that they need to be taken
# take inputs and turn them into outputs
#output

def main():
    #get the input
    name = input('Enter your name: ')
    # print the text and variable
    print('Hello,',name)

#call main
main()

Cube program

# user enter an integer
# output a cube of that integer
# When using numbers use eval or number type int float
def main():
    number = float(input("Enter an integer: "))
    cube=number * number * number
    print("The cube is",cube)

main()

Chaos program with additional input for user to determine number of loops

# chaos program (page 13)

def main():
    print('This program illustrates a chaotic function')
    x=float(input('Enter a number between 0 and 1: '))
    y=int(input('Enter the number of loops '))
    for i in range(y):
        x=3.9 * x *(1-x)
        print(i,x)

    

main()
            

Wednesday, September 26, 2018

Afternoon Notes

Process--Organized-- out growing current system

Figure out the scope of the database:

The database will manage business transactions to make sure they are profitable. The Database will track inventory. The database will track point of sale. The database will track customers who are willing to enter data. (loyality awards). Manage requests. Manage purchases. Security. (Query or reports, profit and loss)

Gather information:

look at documents: spiral notebooks, receipts, Forms and Reports. Procedures and manuals.

Talk interview stakeholders

Job Shadowing: exceptions

Analysis: forming requirements:

Data requirements--what data has to be in the database

Reporting requirements--kinds of reports the database must produce

security requirements--Who has access to what

Inventory: Title, Year, genre, condition, rating, artist, purchase price, purchase date, Section (location), purchased from, Description, sellprice, Album version

Point of sale: employee, Date, time, album, customer (optional), discount, type of discount, taxpercent,

--don't store calculations

Customer: (frequency) name, email, phone, dateentered, birthday

Purchase: Date, Seller info, items purchased(title, condition) price paid for each

Requests: customer info, What album or artist, Condition, Year, album versions

Business Rules--

  • Only vince can purchase albums
  • If a customer purchase 5 albums they get a 15% discount on the next album
  • Only vince can do overrides
  • Customers are encouraged to register but not required
  • Sellers are required to provide contact info
  • Default sale price is 150% of purchase price.

Classroom Notes Morning

Process: Identifying the need

--lot of transaction, secure, better track of transactions--track inventory, point of sale autonomize

Setup statement of scope

The database will track inventory, and manage point of sale, track purchasing, expenses, manage profitability. The database will track customers and sellers. track requests.

Talking to primary stakeholders

2. Gathering information

Documents Notebooks used to track sales. receipts, pricing guides, purchasing Forms and Reports Manuals, procedures,

Talk stakeholders: Vince, employees, possibly customers.

Job shadowing: exceptions

3. useful and not : Requirements

inventory : accurate, updatable, album name, price purchased, purchase date every album will as unique, conditions, press date, labels, album year, artist where purchased, genres, store location, trends--queries, reports

Point of sale: customer, method(type of payment), saleprice, discount, kind of discount, saledate, vinyl, time, gross profit/ net (generally don't store calculated fields), employee, number of items

Customer : name, contact (email), zip, phone, date entered (discount for x number of purchases)

Sellers: name, contact (email), zip, phone, date entered, id

Requests: customer, album requested, date, artist, condition, date pressed, Notes<.p>

Business Rules--

  • Default sale price is 150% of the purchase price
  • Vince can always give discounts
  • Only Vince can purchase
  • Employees can only discount with Vince's permission
  • Customers are encouraged to register but not required
  • A registered customer who makes 5 purchases gets a disount on the 6th
  • Customers must be registered to get discounts
  • A customer must register to make a request
  • Sellers must register