edited by
5,580 views
32 votes
32 votes

A university placement center maintains a relational database of companies that interview students on campus and make job offers to those successful in the interview. The schema of the database is given below:
$$\begin{array}{|ll|}\hline \text{COMPANY(}\underline{\text{cname}}\text{, clocation)} & \text{STUDENT(}\underline{\text{srollno}}\text{, sname, sdegree)} \\
\text{INTERVIEW(}\underline{\text{cname, srollno}}, \text{idate)} & \text{OFFER(}\underline{\text{cname, srollno}}\text{, osalary)} \\\hline   \end{array}$$
The COMPANY relation gives the name and location of the company. The STUDENT relation gives the student’s roll number, name and the degree program for which the student is registered in the university. The INTERVIEW relation gives the date on which a student is interviewed by a company. The OFFER relation gives the salary offered to a student who is successful in a company’s interview. The key for each relation is indicated by the underlined attributes

  1. Write a relational algebra expressions (using only the operators $\bowtie, \sigma, \pi, \cup, -$ ) for the following queries.
    1. List the $rollnumbers$ and $names$ of students who attended at least one interview but did not receive $any$ job offer.
    2. List the $rollnumbers$ and $names$ of students who went for interviews and received job offers from $every$ company with which they interviewed.
  2. Write an SQL query to list, for each degree program in which more than $five$ students were offered jobs, the name of the degree and the average offered salary of students in this degree program.
edited by

5 Answers

Related questions

33 votes
33 votes
2 answers
1
Kathleen asked Sep 15, 2014
5,712 views
The following table refers to search items for a key in $B$-trees and $B^+$ trees.$$\begin{array}{|ll|ll|} \hline & \textbf {B-tree} & & \textbf {B}^+\text{-tree} \\\hl...