Docsity

Action Queries - E-Commerce - Lecture Slides, Slides of Fundamentals of E-Commerce

Toggle sidebar
bg1
Action Queries: UPDATE
• UPDATE table SET field = value [, field =
value ...] WHERE criteria
• Examples
Update Authors Set Commissions = (Sales * 0.1)
Update Authors Set Address = ‘123 Maple’
Where (AuID = 3121)
Update Authors Set Dead = False, Stupid = True
Where ( (Sales > 100000) and (Commissions =
0) )
[Note use of ( ) in where clause]
Docsity.com
pf3
pf4
pf5

Partial preview of the text

Download Action Queries - E-Commerce - Lecture Slides and more Slides Fundamentals of E-Commerce in PDF only on Docsity!

Action Queries: UPDATE

• UPDATE table SET field = value [, field =

value ...] WHERE criteria

• Examples

Update Authors Set Commissions = (Sales * 0.1)Update Authors Set Address = ‘123 Maple’

Where (AuID = 3121)

Update Authors Set Dead = False, Stupid = True

Where ( (Sales > 100000) and (Commissions =0) )

[Note use of ( ) in where clause]

Action Queries: Update

• Notice that we can do computation that

takes place on server side (better).

• Most all of the familiar math operators work

as expected ( + - * / )

• Different SQL variations add mathematical

functions. ( Sin, Cos, Abs, Sgn, Powers )

Special Queries

These queries not supported on all

machines.

Transform and Pivot

• Useful for making cross-tabs and doing

scary manipulations of data.

• Hard to get the syntax right, so best made

with a tool.

TRANSFORM aggfunction selectstatement

PIVOT pivotfield [IN (value1[, value2[, ...]])]

Crosstab Result

Year Published Total Of ISBN