Fill in the Blanks
0478 Unit Section 9: Databases - DATATYPES - FIELDS - SQLOnline version
DATATYPE - FIELDS - SQL
A
database
is
a
collection
of
data
that
allows
people
to
information
in
a
way
that
meets
their
needs
.
The
can
include
text
,
,
pictures
;
anything
that
can
be
in
a
computer
.
A
single
-
table
contains
only
table
.
Why
are
databases
useful
?
Databases
problems
occurring
because
:
»
if
any
or
additions
are
made
it
only
has
to
be
done
once
?
data
is
»
the
same
data
is
used
by
»
data
is
only
once
in
relational
databases
which
means
no
data
.
What
are
databases
used
for
?
To
information
about
people
,
for
instance
:
»
patients
in
a
»
at
a
school
.
To
store
information
about
things
,
for
instance
:
»
to
be
sold
»
books
in
a
.
To
store
information
about
,
for
instance
:
»
bookings
»
results
of
.
Fields
and
records
?
the
building
for
any
database
Inside
a
database
,
data
is
in
tables
,
which
consists
of
many
records
.
Each
consists
of
several
fields
.
The
number
of
records
in
a
will
vary
as
new
records
can
be
added
and
deleted
from
a
table
as
required
.
The
number
of
in
a
table
is
fixed
so
each
record
contains
the
same
number
of
fields
.
An
easy
way
to
remember
this
is
:
each
record
is
a
in
the
table
and
each
field
is
a
in
the
table
.
A
table
contains
data
about
type
of
item
or
person
or
event
,
and
will
be
given
a
name
,
for
example
:
»
a
table
of
called
PATIENT
»
a
table
of
books
called
»
a
table
of
doctor
?
s
called
APPOINTMENT
.
Each
within
a
contains
about
a
single
item
,
person
or
event
,
for
example
:
»
Winnie
Sing
(
a
patient
)
»
IGCSE
Computer
(
a
book
)
»
15
:
45
on
2020
(
an
appointment
)
.
As
every
record
contains
the
same
number
of
,
each
field
in
a
record
contains
a
specific
piece
of
about
the
item
,
person
or
event
stored
in
that
record
.
Each
field
will
have
a
meaningful
name
to
the
data
in
it
,
For
a
hospital
patient
the
could
include
:
?
The
patient
?
s
first
field
called
FirstName
?
The
patient
?
s
family
name
field
called
?
The
patient
?
s
of
admission
field
called
DateOfAdmission
?
The
name
of
the
?
s
consultant
field
called
Consultant
?
The
patient
?
s
ward
field
called
WardNumber
?
The
patient
?
s
bed
number
field
called
,
etc
.
There
are
six
basic
data
that
you
need
to
be
able
to
use
in
a
:
»
text
/
»
character
»
»
integer
»
real
»
date
/
.
What
is
a
data
type
?
Each
will
require
a
data
type
to
be
selected
.
A
data
type
how
the
data
is
stored
,
displayed
and
the
that
can
be
performed
on
the
stored
value
.
For
example
,
a
field
with
an
integer
data
type
is
stored
and
displayed
as
a
number
and
the
value
stored
can
be
used
in
.
As
each
within
a
table
contains
data
about
a
item
,
person
,
or
event
,
it
is
important
to
be
able
to
uniquely
this
item
.
In
order
to
reliably
identify
an
item
from
the
data
stored
about
it
in
a
record
there
needs
to
be
a
field
that
identifies
the
item
.
This
is
called
the
primary
key
.
A
that
is
a
primary
key
must
contain
data
values
that
are
never
in
the
table
.
The
primary
key
can
be
a
field
that
is
already
used
,
provided
it
is
,
for
example
the
ISBN
in
the
book
.
The
PATIENT
table
would
need
an
extra
field
for
each
record
as
all
of
the
existing
fields
could
contain
repeated
data
.
To
create
a
primary
key
,
we
could
add
a
new
to
each
record
,
for
example
a
unique
could
be
added
to
each
patient
?
s
record
.
Structured
Language
(
SQL
)
is
the
standard
query
language
for
writing
scripts
to
obtain
useful
from
a
database
.
We
will
be
using
SQL
to
obtain
information
from
single
-
databases
.
For
example
,
somebody
needing
to
visit
a
patient
would
only
require
the
number
and
the
bed
of
that
in
order
to
find
where
they
are
in
the
hospital
.
Whereas
a
consultant
could
need
a
list
of
the
of
all
the
that
they
care
for
.
SELECT
Fetches
specified
(
columns
)
from
a
;
queries
always
with
SELECT
.
FROM
the
table
to
use
.
WHERE
Includes
only
(
rows
)
in
a
query
that
a
given
.
ORDER
BY
the
results
from
a
by
a
given
column
either
or
numerically
.
SUM
Returns
the
of
all
the
in
a
field
(
column
)
.
Used
with
SELECT
.
COUNT
Counts
the
of
records
(
rows
)
where
the
field
(
column
)
matches
a
condition
.
Used
with
SELECT
.
Only
the
SELECT
and
FROM
commands
are
in
an
SQL
script
.
All
other
commands
are
.
A
SELECT
statement
takes
the
form
:
SELECT
Field1
,
Field2
,
Field3
,
etc
.
?
this
specifies
the
individual
(
columns
)
to
be
.
SELECT
*
?
this
specifies
that
fields
(
columns
)
are
to
be
shown
.
A
FROM
statement
takes
the
form
:
FROM
?
this
specifies
the
to
use
.
A
WHERE
statement
takes
the
form
:
WHERE
?
this
specifies
the
condition
to
.
An
ORDER
BY
statement
takes
the
form
:
ORDER
BY
Field1
,
Field2
,
etc
.
?
this
specifies
a
sort
in
ascending
or
alphabetical
order
starting
with
the
first
field
.
ORDER
BY
Field1
,
Field2
DESC
?
this
specifies
a
sort
in
descending
or
reverse
order
starting
with
the
field
.
A
SUM
statement
takes
the
form
:
SELECT
SUM
(
Field
)
?
this
specifies
the
(
column
)
for
the
.
The
field
should
be
integer
or
.
A
COUNT
statement
takes
the
form
:
SELECT
COUNT
(
Field
)
?
this
the
field
(
column
)
to
count
if
the
given
is
.
|