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

Define join and outer join, Define Join and Outer Join and differentiate be...

Define Join and Outer Join and differentiate between them.      Ans: Join - It generates all the combinations of tuples from two relations which satisfy a join condition.  Oute

Develop a simple database of student records, In this programming assignmen...

In this programming assignment, you will develop a simple database of student records. Here are the requirements: 1) A student record contains a name and a number. We assume tha

Differences among the candidate keys and the primary key, Discuss the diffe...

Discuss the differences among the candidate keys and the primary key of a relation. Give instance to describe your answer? A candidate key is one that can be used as primary ke

Define 1 nf normal form, 1 NF Normal Form The domain of attribute must...

1 NF Normal Form The domain of attribute must add only atomic (simple, indivisible) values First normal form (Minimal Form or 1NF) is a normal form need in database normalizat

Relational database, Consider the following relational database: STUDENT (n...

Consider the following relational database: STUDENT (name, student#, class, major) COURSE (course name, course#, credit hours, department) SECTION (section identifier, course#, sem

Query processor in database management system, Query Processor The qu...

Query Processor The query language processor is responsible for taking query language statements or shifting them from the English-like syntax of the query language to a form

What is multilevel index, Multilevel Index The Multilevel Index is a m...

Multilevel Index The Multilevel Index is a modification of the secondary level index system. In this system we might be use even more number of levels in case the table is eve

State the rearranging the execution order for efficiency, Define the step -...

Define the step - Rearranging the Execution Order for Efficiency As we know that algorithm and data structure are closely related to one another, but data structure is conside

What is disadvantages of dbms, What is Disadvantages Of DBMS ? 1. Cos...

What is Disadvantages Of DBMS ? 1. Cost of Software and Hardware and Migration - A important disadvantage of the DBMS system is cost. 2. Reduced Response and Throughpu

Write a query to find name from the relational algebra, Consider the relati...

Consider the relations City (city_name, state) Hotel (name, address) City_hotel (hotel_name, city_name, owner) Answer the following queries in relational algebra (i) Find

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