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

Assignment Help:

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);


Related Discussions:- Write a program within embedded sql to associative relation

What is explicit update, What is Explicit update In explicit update,...

What is Explicit update In explicit update, each derived attribute is defined with respect to one, or more fundamental base object(s). The object designer determines that de

Explain the data access protocol, (a) Explain the three types of potentia...

(a) Explain the three types of potential mistake which could occur if concurrency control is not properly enforced in the database system. Support your answer with appropriate ex

What is class diagram, Class Diagram A class diagram is required to su...

Class Diagram A class diagram is required to support functional necessity of system. In a static design view, class diagram is used to model vocabulary of the system, simple c

Physical model of traffic data management, After the completion of the logi...

After the completion of the logical model the physical model is to be made. The oracle 10 G will be used as a database server and all the tables with their column are created and i

Write short notes on relational constraints, Write short notes on relationa...

Write short notes on relational constraints? Relational Constraints are: 1. NOT NULL 2. Unique 3. Primary key 4. Foreign key 5. Table check

What are the failures of controlling events between objects, What are the f...

What are the failures of Controlling Events Between Objects  Failure Unintentional termination of system. Several possible causes: failure of system hardware, o

What are the basic objects of the data dictionary, What are the basic objec...

What are the basic objects of the data dictionary? Tables Domains Data elements Structures Foreign Keys

Dependency preservation, Dependency Preservation It is obvious that the...

Dependency Preservation It is obvious that the decomposition must be lossless so that we do not lose any information from the relation that is decomposed. Dependency preservati

When it is better to use files than a dbms, When It is better to use files ...

When It is better to use files than a DBMS? It is better to use files than a DBMS when Multiple users wish to access the data.

What are the time stamps associated with each data item, What are the time ...

What are the time stamps associated with each data item? W-timestamp (Q) denotes the largest time stamp if any transaction that implemented WRITE (Q) successfully. R-timesta

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd