Database Tutorial

Course Tutorial Site

Site Admin

CIT 325 : Final Project

without comments

Final: Oracle Assignment

Objectives

The final lab teaches you how to work Oracle object types and subtypes, and how to structure solutions to problems in modules. You will learn the following:

  • Learn how to create and run modules as independent units.
  • Learn how to create and run integration testing with independent program units.
  • Learn how to package a solution in a Bash shell.

Business Scenario

Application programming solutions often require the ability to use object types and object subtypes. This lab explores Oracle’s implementation of objects in the database.

Oracle’s choice of implementing object types and subtypes was pioneering and expanded their product from a purely relational database management system (RDBMS) to a object-relational database management system (ORDBMS). There was one slight element that makes using methods of subtypes difficult in SQL. SQL relies on knowing all types before hand, which is formally Interface Definition Language (IDL).

IDL is key to remote method invocation in Java. It is also the foundations for scalable application development between different servers. IDL requires all components have a copy of all possible method signatures. These are often called “stubs” because they provide the method signature without the implementation, like PL/SQL packages define functions and procedures.

The SQL engine needs a get_name() method in the base_t object type because subtypes will include it. SQL can only find the subtype get_name() method when a stub for it is available in the generalized base_t class.

Help Section

The help section shows you how to create a base type and subtype. It demonstrates overriding member functions and procedures, and how to implement generalized invocation in the to_string member function.

Students may want or need supplemental articles that let them review tips and techniques. The following is a function that checks for valid dates inside strings. You should run this type of check after you rule out a number and alphanumeric string.

The following articles discuss Bash processing:

There are five elements to this lab. It requires you to create:

  • A base_t object type and type body in a base_t.sql file written in an individual SQL script files, which includes a QUIT; statement.
  • A set of seven subtypes of the base_t object type written in individual SQL script files, which creates the respective object type, object type body, and includes a QUIT; statement.
  • A set of four subtypes of the elf_t object type written in individual SQL script files, which creates the respective object type, object type body, and includes a QUIT; statement.
  • A set of four SQL files; one to create a tolkien table, one to confirm valid object types, one to contain inserts into the tolkien table, and one to confirm the inserted object instances.
  • A Bash shell script that runs all the independent SQL script files.

It is important that you develop each piece sequentially. You should also test each piece of the code as you develop them.

Final Project Description

  1. [80 points] Create the 12 qualified object types:

    • The base_t object type and body without a dependency on another object type.
    • The dwarf_t, elf_t, goblin_t, hobbit_t, maia_t, man_t, and orc_t object types and bodies with a dependency on the base_t object type.
    • The noldor_t, silvan_t, sindar_t, and teleri_t object types and bodies with a dependency on the elf_t object type.

    and, position:

    • The DROP and CREATE SQL commands that create the tolkien table and tolkien_s sequence in the create_tolkien.sql file.
    • The object type validation and dependency diagnostic script in the type_validation.sql file.
    • The INSERT statements to populate 21 rows in the tolkien table in the insert_instances.sql file.
    • The diagnostic query that verifies the inserts in the query_instances.sql file.

    The sections cover the detailed tasks of the lab:

  1. [20 points] Automate the process by adding all of your files as elements in the cmd array of the Bash shell script.

    You automate the procedure by creating the create_final.sh script, configure.

Written by michaelmclaughlin

July 3rd, 2017 at 6:13 pm

Posted in