32
CSC 240 (Blum) 1 Introduction to Oracle

Introduction to Oracle

  • Upload
    shen

  • View
    21

  • Download
    0

Embed Size (px)

DESCRIPTION

Introduction to Oracle. Start/Programs/Oracle – OraHome 90/ Application Development/SQL Plus. Alternatively, go to the F drive, Oracle folder, ora90 subfolder, bin subfolder and double click on the sqlplusw exe file. - PowerPoint PPT Presentation

Citation preview

Page 1: Introduction to Oracle

CSC 240 (Blum) 1

Introduction to Oracle

Page 2: Introduction to Oracle

CSC 240 (Blum) 2

Start/Programs/Oracle – OraHome 90/ Application Development/SQL Plus

Page 3: Introduction to Oracle

CSC 240 (Blum) 3

Alternatively, go to the F drive, Oracle folder, ora90 subfolder, bin subfolder and double click on the sqlplusw exe file.

Page 4: Introduction to Oracle

CSC 240 (Blum) 4

Logon, your username should be your last name followed by your first initial. Your password is your first name followed by underscore and pw. For example, James Smith would have a username smithj and a password james_pw. The host string is: cscora2.lasalle.edu

Page 5: Introduction to Oracle

CSC 240 (Blum) 5

After successful log in

Page 6: Introduction to Oracle

CSC 240 (Blum) 6

You can enter SQL commands at the SQL prompt

These line numbers were supplied automatically. The line will execute (or attempt execution) after the semicolon and the Enter key are struck.

Page 7: Introduction to Oracle

CSC 240 (Blum) 7

Uses DDL to create a table consisting of four fields.

Page 8: Introduction to Oracle

CSC 240 (Blum) 8

Confirmation of table creation

Page 9: Introduction to Oracle

CSC 240 (Blum) 9

D’Oh forgot to establish ArtistID as the primary key, can drop this table and start again.

Page 10: Introduction to Oracle

CSC 240 (Blum) 10

Recreate Artist table with primary key established.

Page 11: Introduction to Oracle

CSC 240 (Blum) 11

Use DDL to create a WorkOfArt table.

Page 12: Introduction to Oracle

CSC 240 (Blum) 12

Use the INSERT command to enter data into the Artist table.

Page 13: Introduction to Oracle

CSC 240 (Blum) 13

Use the INSERT command to enter data into the Artist table.

Page 14: Introduction to Oracle

CSC 240 (Blum) 14

Query the Artist table

Page 15: Introduction to Oracle

CSC 240 (Blum) 15

Query the WorkOfArt table.

Page 16: Introduction to Oracle

CSC 240 (Blum) 16

Perform a query that joins the Artist table and WorkOfArt table.

Page 17: Introduction to Oracle

CSC 240 (Blum) 17

Exit Oracle

Page 18: Introduction to Oracle

CSC 240 (Blum) 18

Start Oracle again and do a select query on the tab table which shows a user’s tables

I had also created a Names table, you should only have Artist and WorkOfArt.

Page 19: Introduction to Oracle

CSC 240 (Blum) 19

Add another row of data and close (not exit)

Page 20: Introduction to Oracle

CSC 240 (Blum) 20

Start Oracle again and run Select query on the Artist table.

Where’s Paul Gauguin?

Page 21: Introduction to Oracle

CSC 240 (Blum) 21

Insert Paul Gauguin again and this type follow that with COMMIT, then close.

Page 22: Introduction to Oracle

CSC 240 (Blum) 22

Start Oracle again and do a select query on Artist

This time Paul Gauguin stayed because the insert transaction was committed.

Page 23: Introduction to Oracle

CSC 240 (Blum) 23

Insert another row, rollback, then do a select query on the Artist table

Jackson Pollok does not appear because that entry transaction was rolled back.

Page 24: Introduction to Oracle

CSC 240 (Blum) 24

Add two rows, rollback and do a select

query

Both new rows disappear, rollback gets rid of things up to the last commit.

Page 25: Introduction to Oracle

CSC 240 (Blum) 25

Create a table, rollback, do a select query on the tab table

Temp appears despite rollback, creates cannot be rolled back.

Page 26: Introduction to Oracle

CSC 240 (Blum) 26

Repeat the query joining the Artist and WorkOfArt tables, but use a RIGHT JOIN.

Page 27: Introduction to Oracle

CSC 240 (Blum) 27

Use Notepad to create an .sql file with SQL commands

Page 28: Introduction to Oracle

CSC 240 (Blum) 28

Go to Windows Explorer, select Tools/Folder Options

Page 29: Introduction to Oracle

CSC 240 (Blum) 29

Select the View tab, choose not to hide file extensions

Page 30: Introduction to Oracle

CSC 240 (Blum) 30

If your file has an additional .txt, rename it

Page 31: Introduction to Oracle

CSC 240 (Blum) 31

Use the keyword START followed by the path of the sql file you created

Page 32: Introduction to Oracle

CSC 240 (Blum) 32

Do not forget to commit the transaction