CS 348: Assignment 3 (Winter 2021) (SQL代写,北美程序代写,加拿大程序代写,University of Waterloo代写,CS348代写)

For this assignment, you must use your Linux accounts and DB2 to imple- ment a BIBSEARCH information system

联系我们
微信: biyeprodaixie 欢迎联系咨询

本次CS代写的主要涉及如下领域: SQL代写,北美程序代写,加拿大程序代写,University of Waterloo代写,CS348代写

 

 

 

 

 

 

 

 

 

 

 

Assigned on Feb. 12 and due by 5pm EDT on Mar. 5

CS 348: Assignment 3 (Winter 2021)

 

 

Overview

For this assignment, you must use your Linux accounts and DB2 to imple- ment a BIBSEARCH information system. The relational schema for BIBSEARCH must be operate on the bibliography database introduced in Module 3 and formally defined in file Assignment3Schema that you need to download.1 Recall that the file contains additional commands to recreate a bibliography database and includes sample data that correspond to the examples below. When testing your code, you should replace the sample data with appropri- ate alternative selections of your own test data; it is not sufficient to test your applications on the sample data provided.

BIBSEARCH consists of two application programs with simple command line interfaces. The requirements for the programs are given below. Finally, C together with SQL and the static embedded SQL protocol must be used to implement both application programs.

 

Application Programs

(program bibauthor)

This application is to print a list of publication reports for each publication by an author with a single author id supplied on the command line. In the case of articles, the journal or proceedings identified by the pubid for the publication in which the article appears should be added to the list of publication reports.

Note that a report for any publication should appear at most once in the output. Also, all reporting should be directed to standard output.


The publication reports should appear according to a major sort on the year of the publication (most recent first) and a minor sort on the title of

1The schema is the same as in Module3-BibSchemaV2-DDL, but with more data.

 

 

 

 

 

 

the publication, with the exception that articles must appear before the collections they appear in.

The first three lines of the output format for each publication report is as follows.

Pubid:     <pubid>

Type:      { BOOK | JOURNAL | PROCEEDINGS | ARTICLE }

Title:    <title>

For each particular type of publication, additional lines with the following information are to be added to a publication report.

  • For books:

Author:     <name>1

...

Author: <name>k Publisher:   <publisher> Year:    <year>

Author names should be ordered alphabetically.

  • For journals:

Volume: <volume> Number: <number> Year: <year>

  • For proceedings:

Year:  <year>

  • For articles:

Author:     <name>1

...

Author:     <name>k In:   <appears in>

Pages:    <startpage>--<endpage>

Author names should be ordered alphabetically.

Information about individual publication should be separated by a blank line.

 

 

 

 

 

 

For example, when executed on the sample data in Assignment3Schema, asking for author 1 (Sue) should produce the following output:

$ bibauthor 1

Pubid:    4 Type: ARTICLE

Title: Query Languages Author: John

Author: Sue In: 2

Pages: 30--41

 

Pubid: 2

Type: PROCEEDINGS

Title: Principles of DB Systems Year: 1995

 

Pubid: 1 Type: BOOK

Title:  Mathematical  Logic Author: Sue

Publisher: AMS Year: 1990

 

$

 

(program bibcontent)

This  application  is  to  print  the  publication’s  record  in  the  format  for  the bibauthor program followed by a list of publication reports for each article appearing in a proceedings or journal identified by a pubid supplied the command line (i.e., a form of a table of contents). The articles should appear according to a major sort on their starting page numbers, and should be printed with an output format matching the ARTICLE report format for the bibauthor program.

 

 

 

 

 

 

For example, when executed on the sample data (Assignment3Schema.txt for Assignment 3), asking for publication 3 should produce the following output:

$ bibcontent 3

Pubid:     3 Type: JOURNAL

Title: Trans. on Databases Volume: 35

Number: 1

Year: 1990

 

Table of Contents:

 

Pubid:    6 Type: ARTICLE

Title: Relational Model Author: John

In: 3

Pages: 3--9

 

Pubid:    5 Type: ARTICLE

Title: SQL Author: John In: 3

Pages: 10--15

 

$

 

Both applications should print a single line containing ”Error” (without any further elaboration) whenever the user asks for a non-existent author and or a publication, respectively, and terminate. There MUST NOT be any addi- tional (e.g., debugging) output beyond what is stated in the specifications and shown examples.

 

 

 

 

 

 

Assignment Submission

Assignment submissions should be three plain text files uploaded to MarkUS. The file names and contents are as follows:

 

Two files named bibauthor.sqc and bibcontent.sqc containing the source code for each of the two application programs; and

 

A shell script named compile that must cleanly produce two executa- bles, namely, bibauthor and bibcontent. You can assume that the files util.c and util.h (that can be downloaded from the Module 5 subdirectory) will be present in the directory in which your source code is being compiled. (Sample source for your shell script can also be dowloaded from that Assignment subdirectory.)