DBMS PPT - 1
DBMS PPT - 1
DBMS PPT - 1
05/21/2023
Definition of a Relational Database
server
… …
05/21/2023
Data Models
Model of
system
Entity model of
in client’s
client’s model
mind
Table model
of entity model Oracle
server
Tables on disk
05/21/2023
Entity Relationship Model
EMPLOYEE DEPARTMENT
assigned to
#* number #* number
* name * name
job title composed of location
o o
• Scenario
– “. . . Assign one or more employees to a
department . . .”
– “. . . Some departments do not yet have assigned
employees . . .”
05/21/2023
Entity Relationship
Modeling Conventions
Entity Attribute
• Singular, unique name • Singular name
• Uppercase • Lowercase
• Soft box • Mandatory marked with *
• Synonym in parentheses • Optional marked with “o”
EMPLOYEE DEPARTMENT
#* number assigned to
#* number
* name * name
job title composed of location
o o
…
Primary key Foreign key Primary key
05/21/2023
Relational Database Properties
A relational database:
• Can be accessed and modified by executing
structured query language (SQL)
statements
• Contains a collection of tables with no physical
pointers
• Uses a set of operators
05/21/2023
Communicating with an RDBMS
Using SQL
server
05/21/2023
Oracle’s Relational Database Management
System
Oracle
server
05/21/2023
SQL Statements
SELECT
UPDATE
DELETE
CREATE
MERGE
ALTER
DROP Data definition language (DDL)
RENAME
TRUNCATE
COMMENT
COMMIT
ROLLBACK Transaction control
SAVEPOINT
05/21/2023
Tables Used in the Course
EMPLOYEES
DEPARTMENTS JOB_GRADES
05/21/2023
Cont..
05/21/2023
Retrieving Data Using
the SQL SELECT
Statement
05/21/2023
Capabilities of SQL SELECT
Statements
Projection Selection
Table 1 Table 1
Join
Table 1 Table 2
05/21/2023
Basic SELECT
Statement
05/21/2023
Selecting All Columns
SELECT *
FROM departments;
05/21/2023
Selecting Specific Columns
05/21/2023
Writing SQL Statements
05/21/2023
Arithmetic Expressions
05/21/2023
Using Arithmetic Operators
05/21/2023
Operator Precedence
…
SELECT last_name, salary, 12*(salary+100)
FROM employees;
2
05/21/2023
Defining a Null Value
05/21/2023
Null Values
in Arithmetic Expressions
……
05/21/2023
Defining a Column Alias
A column alias:
• 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
05/21/2023
Using Column Aliases
05/21/2023
Concatenation Operator
A 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
SELECT last_name||job_id AS "Employees"
FROM employees;
05/21/2023
Literal Character Strings
05/21/2023
Using Literal Character Strings
05/21/2023
Duplicate Rows
…
SELECT DISTINCT department_id
FROM employees; 2
…
05/21/2023
Displaying Table Structure
DESC[RIBE] tablename
05/21/2023
Displaying Table Structure
DESCRIBE employees
05/21/2023
Thank you
05/21/2023