Question

Give the relational algebra, tuple calculus, and SQL expressions for each using the below schema: SPERSON(EmpID,...

Give the relational algebra, tuple calculus, and SQL expressions for each using the below schema:

SPERSON(EmpID, Name, Dept)

TRIP(TripID, EmpID, ToCity, StartDate, EndDate)

EXPENSE(ExpID, TripID, AccountID, Amount)

a) List the names and employee ID of a salesperson.

b) List employee ID and employee names that took a trip(s) to Charleston city.

c) List the names of all employees who have spent more than $500 on their trip.

d) List employees' names and their IDs that have never taken a trip.

e) List the names of all salespersons that have at least been on one trip.

please type your answers in text!

Homework Answers

Answer #1

(Ans. a)select name,empid from sperson,trip,expense where sperson.empid=trip.empid and trip.tripid=expense.tripid

(Ans b)select name,empid from sperson,trip,expense where sperson.empid=trip.empid and trip.tripid=expense.tripid and tocity="Charleston city"

(Ans c)select name from sperson,trip,expense where sperson.empid=trip.empid and trip.tripid=expense.tripid and amount>500

(Ans d) select name,empid from sperson,trip where sperson.empid != trip.empid

(Ans e)select name from sperson,trip where sperson.empid=trip.empid and tripid is not Null

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Specify the following queries in SQL on the COMPANY database. Show the result of each query....
Specify the following queries in SQL on the COMPANY database. Show the result of each query. Retrieve the names of all employees in department 5 who work more than 10 hours per week on the ‘ProductX’ project. List the names of all employees who have a dependent with the same first name as themselves. Find the names of all employees who are directly supervised by ‘Franklin Wong’. Specify the following updates using the SQL update commands. Show the state of...
1. Consider the following tables in a relational database. Provide the appropriate "SELECT" SQL statement necessary...
1. Consider the following tables in a relational database. Provide the appropriate "SELECT" SQL statement necessary to answer the queries that follow. Primary keys are underlined and foreign key fields have an asterisk at the end of the field. CUSTOMERS (CUST-NO, C-NAME, C-ADDRESS, BALANCE) SALESPERSONS (SP-NO, S-NAME, DATE-EMPLOYED, SALARY) SALES (INVOICE-NO, DATE, CUST-NO*, SP-NO*) a) List the salesperson name and salary for all sales to customers whose balance outstanding is greater than 20000. b) List the names and addresses of...
The relational schema for the Academics database is as follows: DEPARTMENT(deptnum, descrip, instname, deptname, state, postcode)...
The relational schema for the Academics database is as follows: DEPARTMENT(deptnum, descrip, instname, deptname, state, postcode) ACADEMIC(acnum, deptnum*, famname, givename, initials, title) PAPER(panum, title) AUTHOR(panum*, acnum*) FIELD(fieldnum, id, title) INTEREST(fieldnum*, acnum*, descrip) Some notes on the Academics database: An academic department belongs to one institution (instname) and often has many academics. An academic only works for one department. Research papers (PAPER) are often authored by several academics, and of course an academic often writes several papers (AUTHOR). A research field...
using mysql lyrics.database. i will provide the lyrics schema database info below 1. List the first...
using mysql lyrics.database. i will provide the lyrics schema database info below 1. List the first name, last name, and region of members who do not have an email. 2. List the first name, last name, and region of members who do not have an email and they either have a homephone ending with a 2 or a 3. 3. List the number of track titles that begin with the letter 's' and the average length of these tracks in...