cloudacus = lamp + appaserver ©tim riley appahost model
TRANSCRIPT
![Page 1: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/1.jpg)
Cloudacus = LAMP + Appaserver
©Tim Riley
Appahost ModelAppahost Model
![Page 2: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/2.jpg)
Why LAMP?
©Tim Riley
Why Linux?Why Apache?
Why MySQL?Which Programming
Language?
![Page 3: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/3.jpg)
What is a structured database?
©Tim Riley
Cloudacus = LAMP + Appaserver
Appahost ModelAppahost Model
![Page 4: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/4.jpg)
What is a structured database?
Set Name
©Tim Riley
Database sets are also known as:* categories* tables* folders* collections
![Page 5: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/5.jpg)
What is a structured database?
Set Name
Attribute 1 datatypeAttribute 2 datatype …Attribute n datatype
Attributes are also known as:* columns* fields* properties
©Tim Riley
![Page 6: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/6.jpg)
What is a structured database?
Set Name
Attribute 1 datatypeAttribute 2 datatype …Attribute n datatype
Examples of datatypes:* Integer number* Floating point (real) number* Date* Time* Line of text* Notepad of text
©Tim Riley
![Page 7: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/7.jpg)
Example Set
Personfull_name textskin_color textreligion textheight_inches integerweight_pounds integerbirth_date dateannual_income floatgeneral_characterists notepad
©Tim Riley
![Page 8: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/8.jpg)
Set Elements
PersonFull Name
Linus Torvalds
Guido van Rossum
Bill Henry Gates III
Sets contain elements
©Tim Riley
Elements are also known as:* members* records* rows* tuples
![Page 9: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/9.jpg)
Making Subsets
Personfull_name textskin_color textreligion textheight_inches integerweight_pounds integerbirth_date dateannual_income floatgeneral_characterists notepad
©Tim Riley
![Page 10: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/10.jpg)
Set Relationships
©Tim Riley
Set 1 Set 2Verb phrase
![Page 11: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/11.jpg)
Set Relationships
Person StateReside in
©Tim Riley
![Page 12: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/12.jpg)
Many Set Relationships
©Tim Riley
Person StateReside in
School
Attend
![Page 13: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/13.jpg)
Many Set Relationships
Person StateReside in
Born in
©Tim Riley
![Page 14: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/14.jpg)
Set Relationship TypesSet 1
There are 5 types of set relationships:1) many-to-one2) one-to-many3) many-to-many4) one-to-one5) is-a
Set 2Verb phrase
©Tim Riley
![Page 15: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/15.jpg)
Many-to-one RelationshipPerson
”Many persons
StateReside in
many one
one state.”reside in
©Tim Riley
![Page 16: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/16.jpg)
One-to-many RelationshipPerson
Reverse the arrow to reverse the relationship. ”One state has as residents many persons.”
StateHas resident
many one
©Tim Riley
![Page 17: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/17.jpg)
Many-to-many RelationshipPerson
”One person can visit many states. And one state can have as visitors many persons.”
StateVisit
many many
©Tim Riley
![Page 18: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/18.jpg)
One-to-one RelationshipOffice
”One office has one phone.”
PhoneHas
one one
©Tim Riley
![Page 19: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/19.jpg)
Is-a RelationshipAccountant
”An accountant is a person.”
PersonIs a
one one
©Tim Riley
![Page 20: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/20.jpg)
Enforcing Business Rules
Two broad categories of business rule enforcement are:
1) Implementational restrictions (bad)2) Integrity constraints (good)
©Tim Riley
![Page 21: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/21.jpg)
Enforcing Business Rules
Implementational restrictions are business rules the information system cannot enforce.
Person StateReside in
many one
©Tim Riley
![Page 22: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/22.jpg)
Implementational Restrictions
©Tim Riley
Person StateVisit
many many
![Page 23: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/23.jpg)
one one
many
Implementational Restrictions
©Tim Riley
Person State
many
Person Visit
![Page 24: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/24.jpg)
Enforcing Business RulesIntegrity constraints are business rules the information system succeeds at enforcing. Two imperative integrity constraints are:
1) Relational integrity2) Element uniqueness
©Tim Riley
![Page 25: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/25.jpg)
Enforcing Business RulesRelational integrity is the constraint that an element in each set must exist in order for a relationship to exist between them.
Person StateReside in
many one
A state element can exist without any persons residing in it.
A person element can exist without residing in a state.
©Tim Riley
![Page 26: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/26.jpg)
Enforcing Business RulesElement uniqueness is the constraint that an element cannot exist more than once in a set.
Personfull_name text *
Only one person named Bill Henry Gates III can belong to the person set.
The set of attributes enforcing uniqueness is called the primary key.
©Tim Riley
![Page 27: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/27.jpg)
Element UniquenessNatural primary key: the set of attributes that naturally enforce uniqueness.
Personfull_name text *street_address text *
Names are likely to be naturally duplicated.
If a set has more than one attribute assigned to its primary key, then it's called a multi-attribute primary key.
©Tim Riley
![Page 28: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/28.jpg)
Element Uniqueness
Primary keys naturally occur.
To identify the natural primary key, always consider the four dimensions. Uniqueness can always be naturally identified with:
1) Longitude2) Latitude3) Elevation4) Time
All of the organization's places should be categorized.
All events need a date/time stamp.
©Tim Riley
![Page 29: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/29.jpg)
Foreign key: in a many-to-one relationship, the many table needs to have as attributes the primary key of the one table.
Personfull_name text *street_address text *state text
Statestate text *
Reside in
many one
Foreign key is the primary key of the one table.
Primary key of the one table.
©Tim Riley
Element Uniqueness
![Page 30: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/30.jpg)
Element UniquenessMutable primary keys: The value of primary keys can change when using Appaserver.
Personfull_name text *street_address text *
©Tim Riley
You can change the person's name if she gets married or change the street address if he moves.
![Page 31: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/31.jpg)
Story Telling: Seabed Study
©Tim Riley
![Page 32: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/32.jpg)
©Tim Riley
Cloudacus = LAMP + Appaserver
Appahost ModelAppahost Model
![Page 33: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/33.jpg)
©Tim Riley
Cloudacus = LAMP + Appaserver
![Page 34: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/34.jpg)
Appaserver's Database Structure
Tabletable_name text *
Columncolumn_name text *
Is described
by
many many
Table is the relational database synonym for set.
Column is the relational database synonym for attribute.
©Tim Riley
![Page 35: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/35.jpg)
Table ColumnIs
described by
many many
Appaserver's Database Structure
©Tim Riley
![Page 36: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/36.jpg)
Appaserver's Database Structure
Folderfolder text *
Attributeattribute text *
many many
Appaserver stores tables in the table called ”Folder.”
Appaserver stores columns in the table called ”Attribute.”
©Tim Riley
![Page 37: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/37.jpg)
one one
manymany
Appaserver's Database StructureFolder
folder text *
Attributeattribute text *
Folder_Attributefolder text *attribute text *
©Tim Riley
![Page 38: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/38.jpg)
Appaserver's Database Structure
Storing Relationships
Person
StateReside in
SchoolAttend
©Tim Riley
![Page 39: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/39.jpg)
Appaserver's Database Structure
Storing Relationships
Person
Accountant Teacher
Is aIs a
©Tim Riley
![Page 40: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/40.jpg)
Appaserver's Database Structure
Storing Relationships
Folder Has relationship
many
many
©Tim Riley
![Page 41: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/41.jpg)
Appaserver's Database Structure
Storing Relationships
Folder Relation
©Tim Riley
![Page 42: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/42.jpg)
Relational Database Operations
©Tim Riley
1) Select2) Insert3) Update4) Delete
![Page 43: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/43.jpg)
Building Non-trivial Databases
©Tim Riley
![Page 44: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/44.jpg)
Appaserver's Screen Types
©Tim Riley
1) Insert2) Lookup3) Update4) View5) Detail
![Page 45: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/45.jpg)
Insert Screen
©Tim Riley
![Page 46: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/46.jpg)
Insert Screen
©Tim Riley
![Page 47: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/47.jpg)
Lookup Screen
©Tim Riley
![Page 48: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/48.jpg)
Update Screen
©Tim Riley
![Page 49: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/49.jpg)
View Screen
©Tim Riley
![Page 50: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/50.jpg)
Detail Screen
©Tim Riley
![Page 51: Cloudacus = LAMP + Appaserver ©Tim Riley Appahost Model](https://reader035.vdocuments.us/reader035/viewer/2022062221/56649f325503460f94c4e967/html5/thumbnails/51.jpg)
©Tim Riley
Cloudacus = LAMP + Appaserver
Appahost ModelAppahost Model