Anda di halaman 1dari 12

DATABASE

CREATION
CONCEPTS
LESSON 4

RAYMOND S. BERMUDEZ
Instructor, College of Computer Studies - MSEUF

Organizing Data
Your first step in organizing data is to

identify the individual fields


The specific value, or content, of a field

is called the field value


A set of field values is called a record

Next, you group related fields together

into tables

BY: Mr. RAYMOND S. BERMUDEZ, - Instructor, College of Computer Studies, MSEUF Lucena City

Databases and
Relationships
A collection of related tables is

called a relational database


You connect the records in the
separate tables through a common
field
A primary key is a field, or a
collection of fields, whose values
uniquely identify each record in a
table
When you include the primary key
from one table as a field in a second
table to form a relationship between
BY: Mr. RAYMOND S. BERMUDEZ, - Instructor, College of Computer Studies, MSEUF Lucena City

Databases and
Relationships

BY: Mr. RAYMOND S. BERMUDEZ, - Instructor, College of Computer Studies, MSEUF Lucena City

Relational Database
Management Systems
A database management system

(DBMS) is a software program that lets


you create databases and then
manipulate data in them
In a relational database
management system, data is
organized as a collection of tables

BY: Mr. RAYMOND S. BERMUDEZ, - Instructor, College of Computer Studies, MSEUF Lucena City

Guidelines for Designing


Databases
Identify all the fields needed to produce

the required information


Organize each piece of data into its
smallest useful part
Group related fields into tables
Determine each tables primary key
Include a common field in related
tables
Avoid data redundancy
Determine the properties of each field

BY: Mr. RAYMOND S. BERMUDEZ, - Instructor, College of Computer Studies, MSEUF Lucena City

The Name of a
Database
Transact-SQL (SQL in MS SQL Server
2008) is very flexible when it comes to
names. In fact, it is very less restrictive
than most other computer languages.
Still, there are rules you must follow
when naming a database:
A name can start with either a letter (a,
b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r,
s, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H,
I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W,
X, Y, or Z), a digit (0, 1, 2, 3, 4, 5, 6, 7,
8, or 9), an underscore (_) or a nonreadable
character.
Examples
are Lucena
_n,City
BY:
Mr. RAYMOND S. BERMUDEZ,
- Instructor, College
of Computer Studies, MSEUF

The Name of a
Database
After the first character (letter, digit,

underscore, or symbol), the name can


have combinations of underscores,
letters, digits, or symbols. Examples are
_n24 or act_52_t
A name can include spaces. Example

are c0untries st@ts, govmnt


(records), or gl0b# $urvey||

BY: Mr. RAYMOND S. BERMUDEZ, - Instructor, College of Computer Studies, MSEUF Lucena City

The Name of a
Database
RECOMMENDED
Unless stated otherwise (we will
mention the exceptions, for example
with variables, tables, etc), a name will
start with either a letter (a, b, c, d, e, f,
g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w,
x, y, z, A, B, C, D, E, F, G, H, I, J, K, L, M,
N, O, P, Q, R, S, T, U, V, W, X, Y, or Z) or
an underscore
After the first character, we will use any

combination of letters, digits, or


BY: Mr. RAYMOND S. BERMUDEZ, - Instructor, College of Computer Studies, MSEUF Lucena City
underscores

The Name of a
Database
A name will not start with two

underscores
If the name is a combination of words,
at least the second word will start in
uppercase. Examples are Countries
Statistics, Global Survey,
_RealSport, FullName, or
DriversLicenseNumber
After creating an object whose name includes space,
whenever you use that object, include its name
between [ and ]. Examples are [Countries
Statistics], [Global Survey], or [Date of Birth].
BY: Mr. RAYMOND
BERMUDEZ,
- Instructor,
College
of Computer
Studies,
MSEUF Lucena
City
Even
if youS.had
created
an
object
with
a name
that

Database Creation With


Code
CREATE DATABASE
DatabaseName
The CREATE DATABASE expression is
required. The DatabaseName factor is the
name that the new database will have.
Although SQL is not case-sensitive, you
should make it a habit to be aware of the
cases you use to name your objects. You can
also terminate it with semi-colon:

CREATE DATABASE
DatabaseName;
BY: Mr. RAYMOND S. BERMUDEZ, - Instructor, College of Computer Studies, MSEUF Lucena City

DATABASE
CREATION
CONCEPTS
LESSON 4

RAYMOND S. BERMUDEZ
Instructor, College of Computer Studies - MSEUF

Anda mungkin juga menyukai