Question

Write a query that returns the titles of all books published by Alfred A. Knopf.

  1. Write a query that returns the titles of all books published by Alfred A. Knopf.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

We assume that the table name in the database is books and assume there are these two columns namely title and author in this table. Now the query to return the title of all the books published by Alfred A.Knopf are (assuming you are using one of the well-known databases mentioned below):

SQL query:

SELECT title FROM books WHERE author = "Alfred A.Knopf";

MySQL query:

SELECT title FROM books WHERE author = "Alfred A.Knopf";

MongoDB query:

db.books.find({"author":"Alfred A.Knopf"},{"title" : 1}).pretty();

PostgreSQL query:

SELECT title FROM books WHERE author = "Alfred A.Knopf";

(all above queries select the values from title column in the books table for which the author column has value, Alfred A. Knopf)

assume the table is as given below:

id title author Book_name 1 Alfred A.Knopf 1 Book_name_2 Alfred A.Knopf 2 Book_name_3 Alfred A.Knopf 4 Book_name_4 Alfred A.K

Output (MySQL):

Alfred A.Knopf; select title from books where author

title Book_name 1 Book_name_2 Book_name_3 Book_name_4 Book_name_5 Book_name_6

Add a comment
Know the answer?
Add Answer to:
Write a query that returns the titles of all books published by Alfred A. Knopf.
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
  • create table books (title text primary key,pubdate text,publisher text,publishercity text,scope text); create table publishers (publisherName text,founded...

    create table books (title text primary key,pubdate text,publisher text,publishercity text,scope text); create table publishers (publisherName text,founded date,founderName text[],headquarters text); insert into books values ('the gremlins', 1943, 'random house', 'new york', 'children'), ('sometime never: a fable for supermen', 1948, 'charles scribner''s sons', 'new york', 'adult'), ('james and the giant peach', 1961, 'alfred a. knopf', 'new york', 'children'), ('charlie and the chocolate factory', 1964, 'alfred a. knopf', 'new york', 'children') insert into publishers(publisherName, founded, founderName, headquarters) values ('random house', 'Jan 1, 1927',...

  • trouble with formatting titles :( Your friend is in charge of recording titles of books in...

    trouble with formatting titles :( Your friend is in charge of recording titles of books in the library they work in. Since they know you're in EECS 183, they've asked you to write a function that turns a lowercase string into Title Case format. This way, they can use the function to correctly format the titles without having to worry about capitalizing anything themselves. The function you will implement is stringToTitleCase, which takes a lowercase string str as input and...

  • question 1 Write query that returns invoice_id and invoice_total for invoice dates that are between and...

    question 1 Write query that returns invoice_id and invoice_total for invoice dates that are between and including June 1 2018 and August 1 2018. Use between clause in you

  • Database, must be typed for Ms Access, Write a query to display the book number, title,...

    Database, must be typed for Ms Access, Write a query to display the book number, title, and cost for all books that cost $59.95 sorted by book number?

  • Java Exceptions Suppose a library is processing an input file containing the titles of books in...

    Java Exceptions Suppose a library is processing an input file containing the titles of books in order to remove duplicates. Write a program that reads all of the titles from an input file called bookTitles.inp and writes them to an output file called uniqueTitles.out. When complete, the output file should contain all unique titles found in the input file. Create the input file using Notepad or another text editor, with one title per line. Make sure you have a number...

  • WRITE A SQL QUERY SQL SERVER Write a SELECT statement that returns one column from the...

    WRITE A SQL QUERY SQL SERVER Write a SELECT statement that returns one column from the Customers table named FullName that joins the LastName and FirstName columns. --       Format this column with the last name, a comma, a space, and the first name like this: --       Doe, John --       Sort the result set by last name in ascending sequence. --       Return only the contacts whose last name begins with a letter from M to Z. --  ...

  • Write a sql query that returns Which states have more than one customer? List the states and the ...

    write a sql query that returns Which states have more than one customer? List the states and the number of customers for those states. The list must not include the states that do not have more than one customer. CUSTOMER_T CustomerName, Street, City, State, Zip,

  • write a sql query that returns Which states have more than one customer? List the states...

    write a sql query that returns Which states have more than one customer? List the states and the number of customers for those states. The list must not include the states that do not have more than one customer. CUSTOMER_T CustomerName, Street, City, State, Zip,

  • Write a C program to create a list of books details. The details of a book...

    Write a C program to create a list of books details. The details of a book include title, author, publisher, publishing year, no. of pages , price Perform the following with respect to the list of books created Display all the details of books written by a given author. Sort the details of books in the increasing order of price. Display the details of books published by a given publisher in a given year. Sort the list of books in...

  • Write a query to display author ID, author first, last name, and the number of subjects...

    Write a query to display author ID, author first, last name, and the number of subjects (book subject count) for authors who have published books in more than one subject area (book subject). CHECKOUT PATRON PK Pat ID FK1 Book Num FK2 Pat ID Check Out Date Check Due Date Check In Date Pat FName Pat LName Pat Type BOOK AUTHOR PK Au ID Book Title Book Year Book Cost Book Subject Au FName Au LName Au BirthYear FK1 Pat...

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