Question

Consider the computer science bibliography domain described in Lab Assignment 1. Consider the schema in Figure to model this domai Each author in table Authors is identified by a unique authorID which is autogenerated. Each author has a first name, a last name and an email. The email is unique, while the first name and last name may not be unique. Each paper is identified by a unique papeD which is autogenerated. For each paper, we keep in table Papers the title, a short abstract, the year it was published, and the venue where it was published The table PapersByAuthors maintains the relationships between papers and authors of a paper, identifying authors by authorID, and unique. Each paper is published at a venue The table Venues holds data about venues. Each venue is identified by a unique venuelD which is autogenerated. The venue can be of type conference, or of type journal. Therefore, attribute type takes two possible values: conference or journal. For each venue, we keep the name and the abbreviation. Finally, every paper cites other papers. The citations are saved in table Citations, where each tuple (paperlD,citationID) means that a paper identified with paperID cites another The title, year and venue are unique for every paper erlD. The pair authorld,paperID is paper identified with citationID firstName (varchar(32)) lastName (varchar(32) email (varchar(32)) paperlD (int) citationlD (int) title (varchar(100) year (int) name (varchar(100) acronym (varchar(16)) type (char(10)) Figure 1. Schema for the computer science bibliography database 1. Write the commands for creating the schema as described in Figure 1, together with the key constraints as described above. 2. Use the information in the file populateDBLP.txt to populate the database with tuples. The file has been uploaded on Piazza under Resources.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution:

The query for creating the table is given below:

TableName: Authors

CREATE TABLE Authors(
authorID int NOT NULL,
firstName varchar(32),
lastName varchar(32),
email varchar(32)

    PRIMARY KEY (authorID),
);

TableName: Venues

CREATE TABLE Venues(
venueID int NOT NULL,
name varchar(100),
acronym varchar(16),
type char(10)

    PRIMARY KEY (venueID),

);

TableName: Papers

CREATE TABLE Papers(
authorID int NOT NULL,
title varchar(100),
year int,
venueID int,

    PRIMARY KEY (PaperID),

venueID int FOREIGN KEY REFERENCES Venues(venueID)
);

TableName: Citations

CREATE TABLE Citations(
citationID int NOT NULL,
paperID int,

paperID FOREIGN KEY REFERENCES Venues(paperID)
);

TableName: PapersByAuthors

CREATE TABLE PapersByAuthors(
authorID int NOT NULL,
paperID int

    PRIMARY KEY (authorID, paperID),

paperID int FOREIGN KEY REFERENCES Papers(paperID),

authorID int FOREIGN KEY REFERENCES Authors(authorID)
);

I hope this helps if you find any problem. Please comment below. Don't forget to give a thumbs up if you liked it. :)

Add a comment
Know the answer?
Add Answer to:
Consider the computer science bibliography domain described in Lab Assignment 1. Consider the schema in Figure...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write the following questions as queries in SQL. Use only the operators discussed in class (in...

    Write the following questions as queries in SQL. Use only the operators discussed in class (in particular, no outer joins are allowed). Please use renaming consistently! The following database schema is given: RESEARCHER(rid,name,institution,city,country) PAPER(title,journal,volume,number,year) AUTHOR(resid,title) where rid is the identifier (primary key) of RESEARCHER, name is the researcher’s name, institution is where the researcher works, and city and country the city and country where the institution is located; title is the paper identifier (primary key) of PAPER, journal is the...

  • --- Paper Review drop table paper_review cascade constraint; drop table paper_author cascade constraint; drop table paper...

    --- Paper Review drop table paper_review cascade constraint; drop table paper_author cascade constraint; drop table paper cascade constraints; drop table author cascade constraints; drop table reviewer cascade constraints; create table reviewer ( rid int, --- reviewer id rname varchar(50), --- reviewer name remail varchar(50),-- reviewer email raffiliation varchar(50),-- reviewer affiliation primary key (rid) ); insert into reviewer values(1,'Alex Golden', 'golden@umbc.com','UMBC'); insert into reviewer values(2,'Ann Stonebraker', 'ann@umd.edu','UMD'); insert into reviewer values(3,'Karen Smith', 'karen@umb.com','UMB'); insert into reviewer values(4,'Richard Wallas', 'richard@umbc.edu','UMBC'); insert into...

  • Homework Help!! 1. Draw an ERD for the following situation. Be sure to show: entity information,...

    Homework Help!! 1. Draw an ERD for the following situation. Be sure to show: entity information, attributes, identifier(s), relationships and relationship names, and cardinality Each publisher has a unique name; a mailing address and telephone number are also kept on each publisher. A publisher may publish one or more books; a book is published by exactly one publisher. A book is identified by its ISBN, and other attributes are title, price, and number of pages. Each book is written by...

  • 1. Draw an ERD for the following situation. Be sure to show: entity information, attributes, identifier(s),...

    1. Draw an ERD for the following situation. Be sure to show: entity information, attributes, identifier(s), relationships and relationship names, and cardinality Each publisher has a unique name; a mailing address and telephone number are also kept on each publisher. A publisher may publish one or more books; a book is published by exactly one publisher. A book is identified by its ISBN, and other attributes are title, price, and number of pages. Each book is written by one or...

  • please answer these queries. 1. List the artist name of the artists who do not have...

    please answer these queries. 1. List the artist name of the artists who do not have a webaddress and their leadsource is “Directmail” 2. List the names of members in the artist called 'Today'. 3. Report the total runtime in minutes FOR EACH album in the Titles table. 4.List the firstname, lastname of members who are represented by the salesperson “Lisa Williams” 5.List EACH salesperson’s firstname along with the number of Members that EACH SalesPerson represents. DROP TABLES IF EXISTS...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT