Problem

Exercise 5.6 Answer the following questions:(d)sidsnameratingagesidsnameratingage18jones33...

Exercise 5.6 Answer the following questions:

(d)

sid

sname

rating

age

sid

sname

rating

age

18

jones

3

30.0

null

null

null

null

41

jonah

6

56.0

null

null

null

null

(e)

sid

sname

rating

age

sid

sname

rating

age

null

null

null

null

22

ahab

7

44.0

null

null

null

null

63

moby

null

15.0

(f)

sid

sname

rating

age

sid

sname

rating

age

18

jones

3

30.0

null

null

null

null

41

jonah

6

56.0

null

null

null

null

null

null

null

null

22

ahab

7

44.0

null

null

null

null

63

moby

null

15.0

  1. Explain the term impedance mismatch in the context of embedding SQL commands in a host language such as C.
  2. How can the value of a host language variable be passed to an embedded SQL command?
  3. Explain the WHENEVER command’s use in error and exception handling.
  4. Explain the need for cursors.
  5. Give an example of a situation that calls for the use of embedded SQL; that is, interactive use of SQL commands is not enough, and some host language capabilities are needed.
  6. Write a C program with embedded SQL commands to address your example in the previous answer.
  7. Write a C program with embedded SQL commands to find the standard deviation of sailors’ ages.
  8. Extend the previous program to find all sailors whose age is within one standard deviation of the average age of all sailors.
  9. Explain how you would write a C program to compute the transitive closure of a graph, represented as an SQL relation Edges(from, to), using embedded SQL commands. (You need not write the program, just explain the main points to be dealt with.)
  10. Explain the following terms with respect to cursors: updatability, sensitivity, and scrollability.
  11. Define a cursor on the Sailors relation that is updatable, scrollable, and returns answers sorted by age. Which fields of Sailors can such a cursor not update? Why?
  12. Give an example of a situation that calls for dynamic SQL; that is, even embedded SQL is not sufficient.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 5