Write a program within embedded sql to associative relation, Database Management System

Write a program within embedded SQL to associative the total trip expenses of the salesman named ‘John' for the relations.

EXEC SQL BEGIN DECLARE SECTION;
long total_expenses;
EXEC SQL END DECLARE SECTION;
EXEC SQL
SELECT SUM(AMOUNT) INTO :total_expenses FROM EXPENSE WHERE TRIPID
IN (SELECT TRIP_ID FROM TRIP
WHERE SSN = (SELECT SSN FROM SALEPERSON WHERE NAME = ‘John'));
printf("\nThe total trip expenses of the salesman John is: %ld", total_expenses);

Posted Date: 5/10/2013 4:07:28 AM | Location : United States







Related Discussions:- Write a program within embedded sql to associative relation, Assignment Help, Ask Question on Write a program within embedded sql to associative relation, Get Answer, Expert's Help, Write a program within embedded sql to associative relation Discussions

Write discussion on Write a program within embedded sql to associative relation
Your posts are moderated
Related Questions

explain equi-join using illustration

Critically explained the benefits and limitations of different database technologies with proper examples

What are the reasons of bucket overflow? Explain any two methods for solving this problem. Ans:  It is general for file structures to be divided into equal-length partitions, k

What is the main advantage of the object model? What are its different components? The object model focuses on the logical data structures. Each object model comprises of many

Explain view in RDBMS? View - A view is a relation (virtual rather than base) and could be used in query expressions, which is, queries can be written by using the view as a re

What is the role of ORDER By Clause? ORDER BY clause: The ORDER BY clause permits you to sort the records in your result set. The ORDER BY clause can just be used in select s

List the data structures implemented by the storage manager. The storage manager executes the following data structure a) Data files b) Data dictionary c) indices

What is property - properties of a database ? It is an integrated collection of logically related records. It consolidates separate files into a common pool of data records and

What it creates while a primary key is combined with a foreign key? It creates Parent-Child relation ship between the tables that connect them while a primary key is combined w