Starting from:

$24.99

Assignment 3: BIBsearch system

IntroductiontoDatabaseSystems 
1 Overview You are to use your accounts and DB2 to implement the BIBsearch system. BIBsearch consists of two application programswithsimplecommandlineinterfaces. Therequirementsfortheprogramsaregiveninthefollowingsections. A specification of the underlying schema for the database is also given and includes a schema diagram that indicates primary and foreign key constraints. Note that all submissions must use this schema. Either C or C++ must be used together with SQL and the static embedded SQL protocol to implementBIBsearch.
2 ApplicationsPrograms 2.1 Program bibauthor This application is to print a list of publication records for each publication by an author with a name supplied as a stringargumentonthecommandline. Inthecaseofarticles,thepublicationidentifiedbythepubidforthepublication in which the article appears should be added to the list of requested publications so that a record for this publication is also printed. Note that a record for any publication should appear at most once in the output. Also, the publication information records should be printed to standard output. The publications should appear according to a major sort on the year of the publication (latest first) and a minor sort on the name of the first author for the publication. In the case of publications without an author, the name of the first author should be assumed to be the zero-length string for sorting purposes. The output format for each publication record is as follows.
Pubid: pubid Type: { book | journal | proceedings | article } Title: title
In addition, for each particlar type of publication, the following information should also be printed. • For books: Authors: author1, ..., authork Publisher: publisher Year: year • For journals: Volume: volume Number: number Year: year • For proceedings: Year: year
1
• For articles: Authors: author1, ..., authork In: appearsin Pages: startpage--endpage
2.2 Program bibcontent Thisapplicationistoprintalistofpublicationrecordsforeacharticleappearinginaproceedingsorjournalidentified by a pubid supplied as a string argument on the command line. The articles should appear according to a major sort on their starting page numbers, and should be printed with an output format matching that of bibauthor.
3 AssignmentSubmission
A submission of the following items should be made by the assignment due date: 1. Source listings of each of the two application programs comprising BIBsearch. These should be submitted online in two files with names bibauthor.sqc and bibcontent.sqc.
2. A shell script named compile. Typing “./compile” should suffice to compile both application programs.
2
4 DatabaseSchema
(attribute domains and class diagram)
Attribute SQLDomain aid integer not null name char(22) not null url char(42) pubid char(10) not null aorder integer not null title char(70) not null publisher char(50) not null year integer not null volume integer not null number integer not null appearsin char(10) not null startpage integer not null endpage integer not null
AUTHOR aid
name url
PUBLICATION pubid
title
aid pubid
aorder
WROTE
year
volume number year
JOURNAL pubid
BOOK pubid
publisher year
ARTICLE pubid
appearsin startpage endpage
PROCEEDINGS pubid
(additional constraints)
There are a number of additional constraints that are always satisfied by a given bibliography. (Your programs may assume these constraints are always true.) Let Pu, B, J, Pr and A denote the set of values for attribute “pubid” in tables PUBLICATION, BOOK, JOURNAL, PROCEEDINGS and ARTICLE, respectively, and let In denote the set of values for attribute “appearsin” in table ARTICLE. Then each of the following conditions is always true: • Pu ⊆ (B∪J ∪Pr∪A); • In ⊆ (J ∪Pr); and • |Pu| = (|B|+|J|+|Pr|+|A|), where|x|denotes a count of the number of elements in x. The last constraint ensures, for example, that B and J are disjoint. Finally, note that “pubid” values occurring in table WROTE will always refer to publications that are either books or articles.
3

More products