in Databases
1,373 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
in Databases
1.4k views

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

1 comment

answer c must be like =>

{t|∃u∈(book)(t[account_no]=u[account_no])∧⌐∃s∈borrowed by(t[account_no]=s[accoount_no}])
0
0
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