Interaction with the database via
SQLPlus
Note that dummy data was used in some of the examples.
-
Data Selection - In this example several select statements are run on the database. This is the simplest form of interaction with the database.
-
Data Modification - This example peforms insert, update, and delete operations on the data. It includes using nested SELECT statements in the INSERT and DELETE statements, as well as using Oracle's date strings.
-
Transactions - This shows the use of transactions to undo or permanently save changes to the database. SELECT statements are interspersed with updates and deletes to show the consequences of data modification statements, commits, and rollbacks.
-
PL/SQL - This shows a PL/SQL command which deletes every character from the database that is not featured in an episode.
-
Procedures - This is a stored procedure which, when passed an episode, series title, and creator, will delete that episode from the database.
-
Views - This creates two views, one called 'employedActors' which selects actors that have played some character, and 'picardEpisodes', which selects episodes that have featured Jean-Luc Picard.
-
Triggers - This is an example of a PL/SQL script which creates a trigger and then runs a series of data modification statements to show how the trigger does and does not affect the data. The trigger increases the quality rating of episodes newly inserted that feature Jean-Luc Picard.