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
Define Deadlock recovery measures                   To recover from deadlock, the cycle in the wait-for-graph should be broken. The common technique of doing this is to rollbac

Convert the following ER - diagram (Entity Relationship Diagram) into a relational database (the primary keys are underlined): 2160_Convert the following ER - diagram into a

What are stand-alone procedures? Procedures that are not part of a package are called as stand-alone because they independently defined. A good example of a stand-alone procedu

What is advantage of two-way association? Two-way association advantages are following: a) Independent of the classes. b) Useful for existing predefined classes that are

Define raid? Briefly explain it? A range of disk organization methods, collectively called redundant arrays of independent disks (RAID) o   Improvement of reliability throug

What is Cardinality Ratio? Cardinality Ratios - The cardinality ratios for relationship kinds specifies the maximum number of relationship instances in which an entity can pa

Determine the minimal set of functional dependencies for the following data. This table is part of the OHSU database of extracurricular activities and tracks the DMICE band's co


Discuss The difference between drop table R and delete from R.  DROP TABLE command deletes all the records with the table definition. This command will automatically committed