UNIVERSITY OF ENGINEERING
AND TECHNOLOGY
(Mardan)
IDS Assignment # 4
Submittet to Sir Zafar Ali
Name Obaid Ullah
Subject ; IDS (Theory)
Semester ; 4th
Section ; “B”
Roll # ; 35
DEPARMENT OF COMPUTER SOFTWARE ENGINEERING
UNIVERSITY OF ENGINNERING AND TECHNOLOGY
(MARDAN)
Relational Schema consisting of 4 relation is given below.
AUTHOR(author_id, first_name, last name)
AUTHOR_PUB(author_id, pub_id, author_position)
BOOK(book_id, book_title, month, year, editor)
PUB(pub_id, title, book_id)
pub_id in AUTHOR_PUB is a foreign key referencing PUB
book_ id in PUB is a foreign key referencing BOOK
editor in BOOK is a foreign key referencing AUTHOR(author_id)
The relational algebraic expressions for the following:
[Link] names of author who are not editor
AUTHORS ← author_id(Author)
EDITORS ← author_idAuthor editor authorid(Book)
NON-EDITORS ← Author - Editors
T ←(NonEditor * Author)
RESULT ← frist_name, last_nameT
[Link] the names of all authors who are book editors.
T ← Authors editor author_id(Book)
RESULT_Editors ← frist_name, last_nameT
[Link] the names of all authors who have at least one publication in the database.
If the database is intended to store author data if the author has at least a publication in
the database then we can simply do this by projecting the names of authors from the
AUTHOR table.
In contrary, if our database is intended to store authors without having any publication in
the database then we do as.
T ← (Author * Author_Publication )
RESULT_Authore_With Pub ← frist_name, last_nameT
[Link] authors authored a pub that was published in July?
T1 ← book_id month ’July’(Book)
T2 ← pub_id ( T1 * Pub)
JULY_PUB_AUTH ← author_idT2 * (AUTHOR_PUB)
Auth_July ← JULY_PUB_AUTH * AUTHOR
RESULT ← author_id, frist_name, last_nameAuth_July
[Link] the publications of author whose author_id = 5.
Author ← pub_id author_id 5 Auth_pub
Auth_5 ← book_id Author * pub
Author_Book ← Auth_5 * BOOK
RESULT ← book_id, book_title(Author_Book)