Upload
synapseindiaappsdevelopment
View
221
Download
0
Embed Size (px)
Citation preview
8/10/2019 Synapseindia Reviews Sharing Intro on Phpcomp
1/19
Databases and the Web
I. Databases in the Abstract
II. Creating Databases using Relational
DataBase Management Systems(RDBMSs)
III. Databases and Web Interfaces
8/10/2019 Synapseindia Reviews Sharing Intro on Phpcomp
2/19
I. Databases in the Abstract
A. Definition
B. ormali!ationC. Structure
D. "anguage
8/10/2019 Synapseindia Reviews Sharing Intro on Phpcomp
3/19
I. A. Definition
A databaseis an organi!ed collection of data
#hose content must be quicklyand easily
Accessed Managed
$%dated
A relational databaseis one #hose data are
s%lit u% into tables& sometimes called
relations
8/10/2019 Synapseindia Reviews Sharing Intro on Phpcomp
4/19
'irst ormal 'orm (') All attributes are single alued * non+re%eating
Second ormal 'orm (,') Must be ' * must hae %rimary -ey ach non+%rimary -ey attribute must be
functionally dependenton %rimary -ey
/hird ormal form (0') Must be ,' ach non+%rimary -ey attribute must be
de%endent onlyon %rimary -ey
I. B. Normalization
(read logical organization)
http://www.stuart.iit.edu/courses/im510/database/1NF.htmhttp://www.stuart.iit.edu/courses/im510/database/1NF.htmhttp://www.stuart.iit.edu/courses/im510/database/2NF.htmhttp://www.stuart.iit.edu/courses/im510/database/3NF.htmhttp://www.stuart.iit.edu/courses/im510/database/3NF.htmhttp://www.stuart.iit.edu/courses/im510/database/2NF.htmhttp://www.stuart.iit.edu/courses/im510/database/1NF.htmhttp://www.stuart.iit.edu/courses/im510/database/1NF.htm8/10/2019 Synapseindia Reviews Sharing Intro on Phpcomp
5/19
I. C. . !ables ("elations)
ach columnconstitutes an attribute
ach rowconstitutes a recordor tuple
Attribute 1(column 1)
Attribute 2(column 2)
Record 1
(tuple 1)
Record 2(tuple 2)
8/10/2019 Synapseindia Reviews Sharing Intro on Phpcomp
6/19
1rimary An attribute or grou% of attributes #hich
uni2uely identifies each record in a table May not be a Nullalue
'oreign
used %rimarily for enforcing referential integrity&but also for establishing relationshipsbet#een
the t#o tables
I. C. #. $eys
8/10/2019 Synapseindia Reviews Sharing Intro on Phpcomp
7/19
3ne+to+one (+to+)
3ne+to+many (+to+M or +to+)
Many+to+Many (M+to+M or +to+)
I. C. %. "elationships
8/10/2019 Synapseindia Reviews Sharing Intro on Phpcomp
8/19
I. D. &tructured 'uery anguage
(&') 1ronounce 4Se2uel5 or 4ss 6ue ll5
Industry standard language of (Relational)
Databases Allo#s for com%lete
/able Creation& Deletion& diting
Data e7traction (6ueries) Database management * administration
8/10/2019 Synapseindia Reviews Sharing Intro on Phpcomp
9/19
II. Creating Databases
using "DB&sA. Microsoft Access
Creating /ables
ntering& Im%orting& diting& * 8ie#ing Data Defining Relationshi%s
Constructing 6ueries
A. MyS6"9 (Documentation)
Where to %ut it (serers at $8a) Ditto MS Access
A. 3thers mS6"& 1ost:reS6"& 3racle& DB,& Informi7&
Sybase& m%ress& Adabas& 9.
http://www.mysql.com/http://www.mysql.com/documentation/mysql/bychapter/http://www.mysql.com/documentation/mysql/bychapter/http://www.mysql.com/8/10/2019 Synapseindia Reviews Sharing Intro on Phpcomp
10/19
III. Databases and Web Interfaces
(What you need to get started)
A. Re2uirements for a Database WebInterface
B. Where to 1ut ;our Database and Scri%ts
C. Serer+Side Scri%ting "anguages AS1
Cold 'usion 1erl
1
8/10/2019 Synapseindia Reviews Sharing Intro on Phpcomp
11/19
III. A. "e*uirements for a Database Web
Interface
;our database (Access& MyS6")
A Web serer #ith a%%ro%riate RDBMS
A #ay of connecting the t#o
(Common :ate#ay Interface = C:I =
scri%ts and S6")
Security concerns
8/10/2019 Synapseindia Reviews Sharing Intro on Phpcomp
12/19
III. B. Where to +ut,our Database
and &cripts Academic side of $8a
Access SR8ICS es+#eb (#eb.irginia.edu)
MyS6" MyS6" serer (dbm.itc.irginia.edu) m.acs= ###.itc(.irginia.edu)
Medical side of $8a See the $8a
8/10/2019 Synapseindia Reviews Sharing Intro on Phpcomp
13/19
Acti-e &er-er +ages (A&+)
When a bro#ser calls an AS1 document&
the AS1 Serer reads the .as% document
and. Substitutes a%%ro%riate files for the (serer+side)
include statements
Runs the AS1 code (8isual Basic Scri%t = see the
/utorial and "anguage Reference& 9),. Returns the resulting
8/10/2019 Synapseindia Reviews Sharing Intro on Phpcomp
14/19
A&+ $ey +oints ()
AS1 code enclosed in@ 8BScri%t code
erything outside is
8/10/2019 Synapseindia Reviews Sharing Intro on Phpcomp
15/19
A&+ $ey +oints (#)
Connect #ith database@ Create connection ob>ect@
set conn Serer.Create3b>ect(EAD3DB.ConnectionE)
3%en connection@ conn.o%en(E1roiderMicrosoft.Oet.3"DB.G.HJData
Sourcef@P#ebPdatabasePrescom%Pstudy.mdbE)
Submit a (read+only) 6uery@
:enerate S6" statement@ S6" ES"C/ 'irstame& "astame& D3B& :ender'R3M 1atients W
8/10/2019 Synapseindia Reviews Sharing Intro on Phpcomp
16/19
A&+ $ey +oints (%)
Moe through the data records@ do #hile 3/ 1atients.eof
ame 1atients(H) * E E * 1atients()1atients.Moee7t
loo%
Add to or edit table@
Create and o%en Record Set ob>ect@ set RS Serer.Create3b>ect(EAD3DB.RecordsetE)
RS.3%en 4table nameE& conn& & ad"oc-3%timistic&
adCmd/able
(#here adLockOptimistic 0& adCmdTable ,)
8/10/2019 Synapseindia Reviews Sharing Intro on Phpcomp
17/19
A&+ $ey +oints ()
Add to or edit table (continued)@ Create ne# record& dit& * $%date@
RS.Adde#
RS(4Dosage5) ,HHRS.$%date
3r 'ind desired record& dit& * $%date @ do #hile 3/ RS.eof
if RS(4ID5) thenRS(4Dosage5) ,HH
RS.$%dateelse
RS.Moee7tend if
loo%
8/10/2019 Synapseindia Reviews Sharing Intro on Phpcomp
18/19
A&+ $ey +oints (/)
Clean u% (free serer resources) #hen done@ 6ueries@
1atients.Closeset 1atients nothing
Record Sets@ RS.Close
set RS nothing
/he Connection@ conn.close
set conn nothing
8/10/2019 Synapseindia Reviews Sharing Intro on Phpcomp
19/19
A&+ &ecurity
A%art from arious Internet Information
Serices (IIS = Windo#?s Web serice)
security holes (for iruses and #orms)&security is 2uite good.
$se htt%s@FF if you #ant to %rotect content
oer the internet = %roides Secure Soc-et
"ayer (SS") security