| | |
SQL query help
Please support our Database Design advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: May 2007
Posts: 1
Reputation:
Solved Threads: 0
LibraryDB is a database system that keeps track of information concerning the books and their circulation in an imaginary library.
Disclaimer: The data that populates the database are artificially constructed and by no means correspond to actual real-world data.
The schema for the LibraryDB database is given below.
List the full names of publishers who have not published books on ``Databases".
Thank you..
Disclaimer: The data that populates the database are artificially constructed and by no means correspond to actual real-world data.
The schema for the LibraryDB database is given below.
borrow(transactionID, personID*, borrowdate, duedate, returndate)The primary keys are underlined. The foreign keys are denoted by asterisks (*). Description of the schema
author(authorID, firstname, middlename, lastname)
book_copy(bookID, bookdescID*)
book(bookdescID, title, subtitle, edition, voltitle, volnumber, language, place, year, isbn, dewey, subjectID*)
borrow_copy(transactionID*, bookID*)
person(personID, firstname, middlename, lastname, address, city, postcode, phonenumber, emailaddress, studentno, idcardno)
publisher(publisherID, publisherfullname)
written_by(bookdescID*, authorID*, role)
published_by(bookdescID*, publisherID*, role)
subject(subjectID, subjecttype)
- person -- keeps track of the people who borrow books from the library. The attributes contain personal and contact information.
- author -- keeps track of personal information about authors.
- publisher -- keeps track of the publisher information. To make simple, most of the attributes have been truncated in the sample database.
- subject -- this relation keeps information about the subjects on which the library collection have books (such as Mathematics, Database, etc)
- book -- contains information about the books that are available in the library. Every book can have one or more physical copies in the collection. Each book can have one or more authors and it is published by one or more publishers.
- book_copy -- keeps track of the physical copies of the books in the library collection.
- borrow -- keeps track of the check-ins and check-outs of the books. Every transaction is done by one person, however may involve with one or more book copies. If there is no return date, it means the book has been checked out but not returned.
- written_by -- associates books with authors. A book may be associated with several authors and an author may be associated with several books. There is also an attribute 'role' that specifies the role of the author for the book (author/ editor/ translator/ etc).
- published_by -- associates publishers with books. There is an attribute 'role' here too.
- borrow_copy -- associates physical copies of books with a transaction. Members are allowed to borrow several books in a single transaction.
List the full names of publishers who have not published books on ``Databases".
- Write your query using NOT IN clause.
- Write your query using NOT EXISTS clause.
Thank you..
Try it yourself and post the code and tell us what probem are you facing.
•
•
•
•
LibraryDB is a database system that keeps track of information concerning the books and their circulation in an imaginary library.
Disclaimer: The data that populates the database are artificially constructed and by no means correspond to actual real-world data.
The schema for the LibraryDB database is given below.borrow(transactionID, personID*, borrowdate, duedate, returndate)The primary keys are underlined. The foreign keys are denoted by asterisks (*). Description of the schema
author(authorID, firstname, middlename, lastname)
book_copy(bookID, bookdescID*)
book(bookdescID, title, subtitle, edition, voltitle, volnumber, language, place, year, isbn, dewey, subjectID*)
borrow_copy(transactionID*, bookID*)
person(personID, firstname, middlename, lastname, address, city, postcode, phonenumber, emailaddress, studentno, idcardno)
publisher(publisherID, publisherfullname)
written_by(bookdescID*, authorID*, role)
published_by(bookdescID*, publisherID*, role)
subject(subjectID, subjecttype)
I am not sure about how to do this question below
- person -- keeps track of the people who borrow books from the library. The attributes contain personal and contact information.
- author -- keeps track of personal information about authors.
- publisher -- keeps track of the publisher information. To make simple, most of the attributes have been truncated in the sample database.
- subject -- this relation keeps information about the subjects on which the library collection have books (such as Mathematics, Database, etc)
- book -- contains information about the books that are available in the library. Every book can have one or more physical copies in the collection. Each book can have one or more authors and it is published by one or more publishers.
- book_copy -- keeps track of the physical copies of the books in the library collection.
- borrow -- keeps track of the check-ins and check-outs of the books. Every transaction is done by one person, however may involve with one or more book copies. If there is no return date, it means the book has been checked out but not returned.
- written_by -- associates books with authors. A book may be associated with several authors and an author may be associated with several books. There is also an attribute 'role' that specifies the role of the author for the book (author/ editor/ translator/ etc).
- published_by -- associates publishers with books. There is an attribute 'role' here too.
- borrow_copy -- associates physical copies of books with a transaction. Members are allowed to borrow several books in a single transaction.
List the full names of publishers who have not published books on ``Databases".can someone please tell me how to do this one..
- Write your query using NOT IN clause.
- Write your query using NOT EXISTS clause.
Thank you..
There is just two ways to live your life.
One is as though nothing is a miracle.
The other is as if everything is.
One is as though nothing is a miracle.
The other is as if everything is.
![]() |
Similar Threads
- sql query problem with MS Access and C# (C#)
- Urgent Help with SQL Query (MySQL)
- C# VS 2005 - SQL Query Parameters to an ODBC DataSource (C#)
- sql query updating problem (Visual Basic 4 / 5 / 6)
- Javascript array from sql query (JSP)
- Please help me out with MySQL query (MySQL)
- PHP/SQL query help (PHP)
- Retreiving variables from a sql query into a form (PHP)
Other Threads in the Database Design Forum
- Previous Thread: Database Design for storing versions
- Next Thread: database Design Idea
| Thread Tools | Search this Thread |
Tag cloud for Database Design






