Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask C/C++ Expert


Home >> C/C++

Response must be 250 Words

Required APA Format

Q1. A new developer, who is new to PL/SQL, has just been hired to assist in your development group. Explain the differences between scalar, record and table variables to the new developer.

Response must be 150 Words

Required APA Format

Q2. PL/SQL includes three types of variable, including scalar, record, and table variables. All three of these serve a different purpose depending on how much data you want to store. For instance, if you want to only hold a singular value, a scalar variable should be assigned. Frequently, you only want to start something like the quantity of product number 4 in stock. A scalar variable is the most suitable for this value.
However, sometimes you may need to store multiple values of different datatypes, such as a table row. "A record can store and handle multiple values or fields, each having its own name and data type, as one unit." (Casteel, 2013). Records are appropriate for storing a single row of a database or a subset of columns from a row. Suppose you want to keep track of all of the books you own. One could use a record to grab the information about a book by a specific Title or ISBN and observe the fields of the record to gain addition information such as author, publisher, and date published.

Finally, you can think of table variables as array-types in traditional programming languages. Table variables are also known as collections and are ordered groups of elements having the same datatype. Just like an array, each element is represented by a unique subscript that represent the position in the collection (PL/SQL Collections, n.d.). These can be further subdivided into three types:

• Associative arrays - handles many rows of data, but one field

• Table of records - Similar to a record, but can hold multiple rows of data

• VARRAYS and Nested Tables - database columns that hold more than one value

References
Casteel, J. (2013). Oracle 11g: PL/SQL programming. Boston, MA: Course Technology, Cengage Learning.
PL/SQL collections.(n.d.). Retrieved from http://www.tutorialspoint.com/plsql/plsql_collections.htm

Response must be 150 Words

Required APA Format

Q3. I think you have all explained the scalar, record and table variables very well so I'll try not to repeat what has already been covered.
If a new developer started I would first out what programming languages they are already know and explain the variables using the language they are most familiar with. For example, If the developer was a C programmer I would tell them that scalars are the simple building block variables like int and char (Casteel, 2013, p.40)and that records are similar to structs in that you can group primitive variables into a logical unit. Finally, table variables or collections can be though of as an array. This could be an array of primitives such as int or could be an array of complex variables like struct's. There are a number of different types of collections in PL/SQL. I don't think there is a direct equivalent in plain old C to Associative Arrays but they work in Perl land they are called Hashes. Other collections in PL/SQL include Nested tables and VARRAY's. ("Composite Data Types",2006)

References

Casteel, J. (2013). Oracle 11g: PL/SQL Programming, 2nd Edition. [VitalSource Bookshelf Online].Retrieved on the 10th of May 2016 from https://cengagebrain.vitalsource.com/#/books/9781285531571/

Oracle Inc. (2006).Working with Composite Data Types. Retrieved on the 10th of May 2016 from https://www.macro.com.ar/PortalMacro/content/conn/macro/path/Contribution%20Folders/Revision/MacroEnLosMedios/PLLes06.pdf

Response must be 150 Words

Required APA Format

Q4. Scalar variables can hold a single value and common data types are VARCHAR2, CHAR, NUMBER, DATE, and BOOLEAN. Scalar variables allow to perform calculations and data manipulation tasks. However, composite variable can hold multiple values of scalar data type or composite data type. There are two types of composite data types:

1. PL/SQL records - when you want to store values of different data types but only one occurrence at a time.

A record is a group of related data items stored in fields, each with its own
name and data type. Each record defined can have as many fields as necessary and records can be assigned initial values and can be defined as NOT NULL. We can define RECORD types and declare user-defined records in the declarative part of any block, subprogram, or package. Also, we can declare and reference nested records. One record can be the component of another record.

2. PL/SQL collections - when you want to store values of the same data type.

Collections are of three types:
- INDEX BY tables or associative arrays
- Nested table
- VARRAY

Casteel, J. (2013). Oracle 11g: PL/SQL Programming. Boston, MA: Course Technology.
Oracle Database 10g: PL/SQL Fundamentals. (n.d.). Retrieved May 11, 2016, from https://www.macro.com.ar/PortalMacro/content/conn/macro/path/Contribution Folders/Revision/MacroEnLosMedios/PLLes06.pdf
The major decision structures in coding are loops. Compare and contrast the basic, WHILE, and FOR loops.

Response must be 150 Words

Required APA Format

Q5. The major decision structures in coding are loops. Compare and contrast the basic, WHILE, and FOR loops.

Response must be 150 Words

Required APA Format

Q6. A WHILE loop has a condition at the top of the LOOP in the LOOP clause to check. Each time the loop runs then that condition is checked and if that condition is TRUE then the loop continues. If on the other hand the condition is FALSE then the loop action stops.
A FOR loop on the other hand will only run for how many times it is directed to do so by a range in the statement. The following is an example of a FOR loop. i is 1 in the first iteration and for each loop it increase by 1 so once it reaches 5 the loop ends.

BEGIN
FOR i IN 1..5 LOOP
DBMS_OUTPUT.PUT_LINE(i);
END LOOP;
END;

Reference

Casteel, J. (2013). Oracle 11g: PL/SQL Programming. Boston, MA: Course Technology.

C/C++, Programming

  • Category:- C/C++
  • Reference No.:- M91784487
  • Price:- $30

Priced at Now at $30, Verified Solution

Have any Question?


Related Questions in C/C++

There are several ways to calculate the pulse width of a

There are several ways to calculate the pulse width of a digital input signal. One method is to directly read the input pin and another method (more efficient) is to use a timer and pin change interrupt. Function startTi ...

Question 1find the minimum and maximum of a list of numbers

Question: 1. Find the Minimum and Maximum of a List of Numbers: 10 points File: find_min_max.cpp Write a program that reads some number of integers from the user and finds the minimum and maximum numbers in this list. Th ...

Project - space race part a console Project - Space Race Part A: Console Implementation

Project - Space Race Part A: Console Implementation INTRODUCTION This assignment aims to give you a real problem-solving experience, similar to what you might encounter in the workplace. You have been hired to complete a ...

Software development fundamentals assignment 1 -details amp

Software Development Fundamentals Assignment 1 - Details & Problems - In this assignment, you are required to answer the short questions, identify error in the code, give output of the code and develop three C# Console P ...

Why do researcher drop the ewaste and where does it end

Why do researcher drop the ewaste and where does it end up?

1 implement the binary search tree bst in c using the node

1. Implement the Binary Search Tree (BST) in C++, using the Node class template provided below. Please read the provided helper methods in class BST, especially for deleteValue(), make sure you get a fully understanding ...

What are the legal requirements with which websites must

What are the legal requirements with which websites must comply in order to meet the needs of persons with disabilities? Why is maximizing accessibility important to everyone?

Assign ment - genetic algorithmin this assignment you will

ASSIGN MENT - GENETIC ALGORITHM In this assignment, you will use your C programming skills to build a simple Genetic Algorithm. DESCRIPTION OF THE PROGRAM - CORE REQUIREMENTS - REQ1: Command-line arguments The user of yo ...

Assignment word matchingwhats a six-letter word that has an

Assignment: Word Matching What's a six-letter word that has an e as its first, third, and fifth letter? Can you find an anagram of pine grave. Or how about a word that starts and ends with ant (other than ant itself, of ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As