Studydroid is shutting down on January 1st, 2019



keywords:
Bookmark and Share



Front Back
Purpose of Models
They can be use to do the following:
Communicate
Categorize
Describe
Specify
Investigate
Evolve
Analyze
Imitate
Components of Relational Model
Collection of objects or relations that store the data

A set of operators that can act on the relations to produce other relations

Data integrity for accuracy and consistency
Define Relational Database
A relational database uses relations or two-dimentional tables to store information.
System Development Life Cycle
Strategy and Analysis
Design
Build and Document
Transition
Production
Database
organized collation of infomation
DBMS
Database Management System
Data
pieces of information
Four Main types of Databases
Hierarchical
Network
Relational
Object Relational
ER Modeling
Entity Relational Model

ER models separate the information required by a business from the activities performed within a business.
Dashed Line 

Solid Line     

Crow's foot    

Single Line  
Dashed Line
Optional element indicating "may be"

Solid Line
Mandatory element indicating "must be"

Crow's foot
Degree element indicating "one or more"

Single Line
Degree element indicating "one and only one"
UID - Unique Identifier

Primary marked with?

Secondary marked with?
Primary       #


Secondary  (#)
single ROW (or tuple)
Represents all data required for a particular field (example: employee)
Each row in a table should be identified by a primary key, which permits no duplicate rows.
The orde of rows is insignificant: specify the row order when the data is retrieved.
Column
Represents one kind of data in a table; in this example, the data is the salaries of all the employees.
In this example, the employee number column is designated s the primary key. The primary key must contain a value, and the value must be unique.
Foreign Key
Is a key column that defines how tables relate to each other. A foreign key refers to a primary key or a unique key in the same table or in another table.
Can a relational database be accessed and modified by executing structured query language??
Yes
ANSI
American National
Standards Institute
(DML) Data Manipulation Language
SQL STATEMENTS:
SELECT
INSERT
UPDATE
DELETE
MERGE
(DDL) Data Definition Language
SQL STATEMENT:
CREATE
ALTER
DROP
RENAME
TRUNCATE
COMMENT
(DCL) Data Control Language
SQL STATEMENT:
GRANT
REVOKE
Transaction Control
SQL STATEMENT:
COMMIT
ROLLBACK
SAVEPOINT
Oracle Database 10g
is the database for grid computing.
SELECT
identifies the columns to be displayed.
*
selects all columns
DISTINCT
suppresses duplicates
column/expression
selects the named columns or the expression
alias
gives selected columns different headings
FROM  table
specifies the table containing the columns
Selecting specific columns
SELECT deparment_id, location_id

FROM   departments;
SQL Statements are:
**not case sensitive (unless indicated)
**can be entered on one or many lines
**keywords cannot be split across lines or abbreviated
**clauses are usually placed on separate lines for readability and ease of editing
**indenting should be used to make code more readable
**keywords are entered in uppercase; all other words, such as table names and columns are entered in lowercase
COLUMN HEADING DEFAULTS

SELECT  last_name, hire_date, salary

FROM    employees;
Headings are Centered
Headings are Uppercase

Character and Date column headings are left-aligned
Numbers are right-aligned
Default Heading display: Uppercase
ARITHMETIC OPERATORS
SELECT last_name, salary,

salary + 300

FROM employees;
OPERATOR PRECEDENCE
(12*salary) + 100

**calculations within parenthesis are calculated first
DEFINE NULL VALUE
it's value that is unvailable, unassigned, unknown, or inapplicable

null is not the same as a zero or a blank space
COLUMN ALIASES
*Renames a column heading
*is useful with calculations
immediately follows the column name (There can also be the optional AS keyword between the column name and alias)
*requires double quotation marks if it contains spaces or special characters or if it is case-sensitive
COLUMN ALIASES EXAMPLE
SELECT last_name AS name,
commission_pct comm
FROM employees;

SELECT last_name "Name",
salary*12 "Annual Salary"
FROM employees;
CONCATENATION OPERATOR
**links columns or character strings to other columns
**is represented by two vertical bars(||)
**creates a resultant column that is a character expression
CONCATENATION EXAMPLE
SELECT last_name||job_id AS "Employees"
FROM    employees;

**this examples virtuall links all the data from broth tables into one table called Employees
LITERAL CHARACTER STRINGS
Date and character literals must be enclosed by single quotation marks ('  '); number literals need not be so enclosed.
LITERAL CHARACTER STRINGS
               EXAMPLE
SELECT last_name ||' is a '||job_id
           AS "Employee Details"
FROM   employees;
DUPLICATE ROWS

USE DISTINCT KEYWORD TO ELIMINATE DUPLICATE ROWS
SELECT DISTINCT department_id

FROM  employees;
DESCRIBE COMMAND TO DISPLAY THE STRUCTURE OF A TABLE
DESC tablename

Can be typed as:

DESC or DESCRIBE
NUMBER(p,s)
Number value having a maximum number of digits p, with s digits to the right of the decimal point.
VARCHAR2(s)
Variable-length character value of maximum size s
DATE
Date and time value between January 1, 4712 B.C., and December 31, 9999 A.D.
CHAR (s)
Fixed-length character value of size s
The following SELECT statement executes successfully TRUE or FALSE:
     SELECT *
     FROM job_grades;


   FALSE
The following SELECT statement executes successfully TRUE or FALSE:
   
    SELECT last_name, job_id, 
    salary AS Sal
    FROM   employees;
TRUE
iSQL*Plus commands access the database TRUE or FALSE
FALSE
x of y cards Next >|