1,393 views
0 votes
0 votes
BOOK(acc_no.,year,title)

USER(card_no.,names,address)

SUPPLIER(s_name,address)

BORROWED BY (acc_no.card_no,date of issue)

SUPPLIED BY(acc_no,date of supply,price ,s_name)

in above given relation find out the acc_no of all the book which are present in the library

in

(a)relational algebra form

(b) in sql form

(c)in tuple calculas form

2 Answers

0 votes
0 votes

Books will be in library which are not issued by anyone. So

(b) Sql query 

Select b.acc_no

From book b

Where b.acc_no NOT IN ( select c.acc_no

From borrowed_by c)

(a) πacc_no( book ) - πacc_no​( borrowed_by)

(c) {t| ∃t∈(book)∧∃b∈(book) (∃c∈(borrowed_by) ( b[acc_no]≠c[acc_no] ∧ t[acc_no]=b[acc_no]))}

That's what I know.hoping its correct.

edited by
0 votes
0 votes
In Sql :

select b.acc_no

from  books b

left join Borrowed_by by

on b.acc.no=by.acc_no

where b.acc_no ISNULL;

Related questions

1 votes
1 votes
1 answer
3
khushtak asked Jan 20, 2016
843 views
Can anyone suggest me how to learn about sql and relational algebra and calculus for gate?as i feel this is an important topic and one 2 marks ques will be asked. I can u...
0 votes
0 votes
1 answer
4
gauravalgo asked Jul 3, 2015
1,069 views
employee(person-name,street,city)works(person-name,company-name,salary)company(company-name,city)manages(person-name,manager-name) Find all employees who earn more than e...