Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

pls solve all the questions using psql Consider the business trip database that keeps track of the business trips of salesman in an office. Following

image text in transcribed

pls solve all the questions using psql

Consider the business trip database that keeps track of the business trips of salesman in an office. Following are the tables: SALESMAN (SNO INTEGER, S_NAME CHAR (30), START_YEAR YEAR) TRIP (TNO INTEGER, FROM_CITY CHAR (20), TO_CITY CHAR(20), DEPARTURE_DATE DATE, RETURN DATE) DEPT (DEPTNO VARCHAR (10), DEPT_NAME CHAR(20)) EXPENSE (EID INTEGER, AMOUNT MONEY) The relationship is as follows DEPT-SALESMAN 1 TO M SALESMAN - TRIP 1 TO M TRIP - EXPENSE 1 TO 1 a) Write a function to display names of salesman from 'Home appliances' department. b) Write a PL/pgsql function to find a business trip having maximum expenses. c) Write a function to delete information of all trips to 'pune' city d) Write a function increase expense of all the trips by 50000 e) Write a function to update the departure date for given trip number (accept trip no and new departure date from user)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Select Healthcare Classification Systems And Databases

Authors: Katherine S. Rowell, Ann Cutrell

1st Edition

0615909760, 978-0615909769

More Books

Students also viewed these Databases questions

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago