DB_Intro_music

Download Report

Transcript DB_Intro_music

Database Introduction
Section 14 – Lesson 01
•
Use the student note section below for further
explanation of the slide content.
•
Use your mouse to resize the content pane and
read all of the student note section.
What’s going on inside?
14 -2
Web-based SQL
•
The SQL Command Processor window allows
you to:
–
run ad-hoc SQL statements (SQL tab)
– upload script files to create Oracle
database objects (Scripts tab)
– browse existing database object data
dictionary information (Data tab)
14 -3
Overview of Web-based SQL
•
Execute SQL statements to retrieve, modify, add, and
remove data from the database
•
Format, perform calculations on, store, and print
query results in the form of reports
•
Create script files to store SQL statements for
repetitive use in the future
•
For this lesson, simply upload, execute and view the
sample tables from the Practice Exercise.
14 -4
Logging In to Project Marvel
•
From Windows environment:
– Enter School Name
– Enter username (whatever was generated
on original account)
– Enter password (whatever was generated
on original account)
• Click on the Script tab.
• Upload the script to the script repository
• Run the script under appropriate schema
14 -5
Preparation: Create the Table
@music.sql
14 -6
ID
artist_name
1
Bob Marley
2
Brittney Spears
type
Reggae
Pop
3
N’Sync
Pop
4
Shaggy
Reggae
5
Jimmy Cliff
Reggae
6
Kid Rock
Rock
7
Third World
Reggae
8
Lenny Kravitz
Rock
9
Yellow Man
Reggae
Database
First Step: “The Query”
Client
Database
SELECT artist_name
FROM music
WHERE type = ‘reggae’;
SQL
Area
14 -7
?
music
?
Second Step: “The Cache”
Client
Database
SELECT artist_name
FROM music
music
WHERE type = ‘reggae’;
SQL
Area
14 -8
Database
Buffer
Cache
?
Third Step: “Data Disk”
SELECT artist_name
FROM music
WHERE type = ‘reggae’;
Database
Buffer
Cache
14 -9
ID
1
2
3
4
5
6
7
8
9
Artist_name
Bob Marley
Brittney Spears
N’Sync
Shaggy
Jimmy Cliff
Kid Rock
Third World
Lenny Kravitz
Yellow Man
Type
Reggae
Pop
Pop
Reggae
Reggae
Rock
Reggae
Rock
Reggae
Fourth Step: “Redo Log Buffer”
Client
Database
SELECT artist_name
FROM music
WHERE type = ‘reggae’;
music
or
CREATE table MUSIC…
SQL
Area
14 -10
Database
Buffer
Cache
Redo Log
Buffer
Summary
•
•
Steps in a database transaction.
Components of the the database system.
– Cache
– Data Disk
– Redo Log Buffer
•
Continue entering sample data into the MUSIC
table.
14 -11