Docsity

Cheat sheet to help students get ahead, Cheat Sheet of Database Management Systems (DBMS)

Toggle sidebar
bg1
Theta
Outer
Join
(IMPORTANT
.
")
R
.
Ass
.
RPRALs
.
RS
RXS
ABC
BC
D
RRALs
.
A
R
.
B
R
.
C S
.
B
S
.
C
D
A
R
.
BR
.
C
S
.
B
S
.
C
D
1232310
cross
product
1st
23
e
45623
11
↳
perform
normal
J
7806712
,
join
1236
712
scheck r
for
tuples
that
didn't
make
it
4
5
6
2
3
Padding
for
tuples
that
didn't
.
AT
ALL
4562
31
have
any
matches
!
7
S
&
23
10
Left
enter
jein
My
:
Only
adds
null
from
R
7892311
Right
enter
join
*
R
:
Only
adds
hall
from
S
7896712x
Natural
Orter
Join
R
*
S
R
S
R
*
S
A
B
C
D
ABC
B
C D
only
one
copy
of
I
2310
12
32 3
10
equating
attributes
12311
↳
Pad
like
the
te
4
56
x
>311
780
+
6712x
Same
D
·
iii
Grouping
!
Aggregation
Operators
VA
,
B
,
AvG()(R)
RI
:
=
V
>
(R2)
what
you
group
on
R
R
↳
L
is
...
1)
Individual
grouping
elements
ABC
ABC
2)
.
A66
operators
456
-
>
125
#
a
3)
Both
123
I
23
12
S
Y
56
2)
Then
aug
C
with
a
ist
,
group
R
by
A
B
Database
Modifications
(SQL
111)
key
words
:
1)
Insert-adds
tuples
INSERT
INTO
Itable
DELETE
FROM
Stable
>
2)
Delete
-
deletes
tuples
VALU ES
(
<
list
of
tuples])
;
WHERE
<condition
3)
Update
-
value
(s)
of
existing
or
where
not
needed
to
remove
tuples
INSERT
INTO
Itable
all
toples
,
but
table
still
exists
VALU ES
If
#
of
attributes
(tuple
list
K)
,
UPDATE
<table
wanted
#list
,
will
add
(tuple
list
23)
;
SET
<
list
of
attribute
assignments
as
NULL
or
DEFAULT
WHERE
condition
on
tuple
value
3r
UPDATE
Drinkers
INSERT
INTO
Itable
SET
phone
=
15SS-1212
WHERE
name
=
'Fred'
;
I
subquerys)
;
pf3

Partial preview of the text

Download Cheat sheet to help students get ahead and more Cheat Sheet Database Management Systems (DBMS) in PDF only on Docsity!

Theta

Outer Join

(IMPORTANT

R

.

Ass .

RPRALs.

RS

RXS

ABC

BC D

RRALs.

A R.B R.C S

.

B

S.

C D

A R .

BR

.

C

S

.

B S

.

C

D

cross

product

1st

23 e

perform

normal

J

join

scheck r

for

tuples

that

didn't

make it

5

Padding

for

tuples

that didn't

.

AT
ALL

have

any

matches!

7 S & 23 10

Left enter

jein

My

:

Only

adds null from

R

Right

enter

join

R

:

Only

adds

hall

from

S

7896712x

Natural Orter

Join

R

S

R S

R

S

A
B

C

D

ABC B C D

only

one

copy

of

I

equating

attributes

Pad like

the

te

x >

+ 6712x

Same

D

·iii

Grouping

Aggregation Operators

VA

,

B

,

AvG()(R)

RI

: =

V

>

(R2)

what

you group

on

R
R
L

is ...

Individual

grouping

elements

ABC

ABC

.A

operators

  • >

a

3) Both

I

12

S

Y

Then

aug

C witha

ist

, group

R

by

A B

Database Modifications (SQL 111)

key

words

:

Insert-adds

tuples

INSERT INTO Itable

DELETE

FROMStable

>

2) Delete

  • deletes

tuples

VALUES (

< list of

tuples])

WHERE

DELETE

If the

set

is

not

empty E

True

Beers

DELETE

FROM

Beers

name manf

WHERE

EXISTS manf

=

marf

AND

name < name

bud Busch

exists

marks both

tuples

as the

bud li .

Busch

"True" or

returned tuples ,

which

bud Null

both

get

deleted

count(

= 3

count

(mant)

=

Z

,

does

not count

null

Functional

Dependancy

Imagine

A

,

B

,

C are all

value

of a

key

If

you

had

213

attributes

determines

value

Traveler suedob

,

then

o

=

agrees

of another attribute

you

can't have

A BC

ssul -2/2/

and

A
  • B

,

be both

t

,

"to

agree

san

dob 55n252/2/ ,

needs

t ,

  • J

I

could

have as

many

attributes

b

more right

side info

2-

y

D

in

left hand:

right

hand

=

I must be same values as

It

tuple

middle Isn

is name

ssu-phore

X

Essu,

Middle name e

Ename

,

phone,

dob

He

implore

des

can per

come h

middle name e phone

2

key

in FD is

an

Keels st

NOTy as

in

cannot

only

attribute(s)

that

be

minimal be

Ssn/mName

determine all other

attribute's

Superkey

superset

of

keys

ANY

key

is a

superkey

,

but

take Essu,

middlename

  • Ename ,

phone

,

dob

not all

superkeys

is a

key

if

you

add

any

attribute

to left side-

superkey

3

Essn ,

mName

,

do

b

e

Ename

, phone

z

A

BC

Be

AC

Essa

,

None

, phone

,

dob3e

Ename

,

phones

A

R(A

,

B

,

C)

,

where

each attribute

Basisa

relation

" FDs I

can

have

many

FDs

6

FDs

all others

idea

of Basis is a

simple

set

of FDs

,

and

can

come

up

al all

Complete

Basis

:

EA-B

,

ARC

,

BeA

,

BeC

,

CA

,

CeB

Single

right

side

Play

w

anything

is basis

no

longer

basis

Minimal

Basis :

Example 1)

What is

the

closure

of A?

EA-B

,

Bea

,

Bec

, CeB3y

same

thing

RCA

,

B

,

C)

where

3A

BC

Minimal basis

EASB

,

BeC

,

CeA

.

F = EA-B

,

Be C

,

CeA

AsB

=

EA

,

B

Yes!

Sigle

Bl

side

3) Determine

all

Attributes

Bec

=> EA

,

B

,

cannot

be messed

Yes

! From

A

you

get

At

= EA

,

B

,

CeA = EA

,

B

,

C

=

At

with