Question

Given the following schema books(id,title,pub_year,pages,isbn), what is the SQL statement needed to find all the books...

Given the following schema books(id,title,pub_year,pages,isbn), what is the SQL statement needed to find all the books published in the year 2002?

a)SELECT pub_year = 2002 in books;

b) SELECT ALL in books WHERE pub_year = 2002;

C) SELECT * FROM books WHERE (pub_year,2002);

D) SELECT * FROM books WHERE pub_year = 2002;

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

Answer

Answer:
--------
D) SELECT * FROM books WHERE pub_year = 2002;

Explanation:
------------
SELECT * -> get all the information
FROM books  ->  about books
WHERE pub_year = 2002 -> which are published in 2002
Add a comment
Know the answer?
Add Answer to:
Given the following schema books(id,title,pub_year,pages,isbn), what is the SQL statement needed to find all the books...
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
  • Given the following table structure, write the SQL code to display all the first and last...

    Given the following table structure, write the SQL code to display all the first and last names of the individuals that have a last name that begins with the letter 'M! CREATE TABLE Persons Personi int LastName varchar(80). FirstName varchar(80). Address varchar(125). State char(2) Given the following table structure, write the SQL code to display all the first and last names of the individuals that have a last name that does not contain the letter 'S: CREATE TABLE Persons PersonlDint,...

  • what sql statements does the following from a table like this? ex 2.4 course Id Name...

    what sql statements does the following from a table like this? ex 2.4 course Id Name semester semester Grade 2.4 OL Jenent at creates the TRANSCRIPT table. Using the TRANSCRIPT table, write an SQL statement that a. Deregisters the student with Id - 123456789 from the course CS305 for the fall of 2001 b. Changes to an A the grade assigned to the student with Id - 123456789 for the course CS305 taken in the fall of 2000 C. Returns...

  • For all problems, use the following schema: Musician(id, first_name, last_name, instrument, band_id) Band(id, name, years_together) Show(id,...

    For all problems, use the following schema: Musician(id, first_name, last_name, instrument, band_id) Band(id, name, years_together) Show(id, venue_id, date) Played_in(band_id, show_id) Venue(id, name, address) Album(id, name, year, band_id, genre_id) Genre(id, name, description) Song(id, name, album_id) Primary keys are in bold, foreign keys are in italics. For each problem, write a query once using relational algebra, and again using SQL. 12. Find the names of all bands that have a member who plays "Guitar", OR have a member that plays "Keyboard". 13....

  • Please refer to the following business scenarios: (i) Using SELECT statements of SQL, find the employee...

    Please refer to the following business scenarios: (i) Using SELECT statements of SQL, find the employee id, first name, last name, job title and email of all employees working in Asia (i.e. all countries coming from the region     ‘Asia’). This query must be implemented as a nested query! (ii) Using SELECT statements of SQL, find the employee id, first name, last name, job title and supervisor id of employees who had worked for more than 3 years and completed...

  • Database Management ID Price 1 Author Richie Karen 10 2 4 Year 1955 1958 1959 Title...

    Database Management ID Price 1 Author Richie Karen 10 2 4 Year 1955 1958 1959 Title с JAVA Script Java C++ prolog Perl 20 10 5 6 Schwartz Ross Maria 1959 1972 20 10 7 Wall 1987 20 The above relation has information about different books. The table information is already saved as txt format in Moodle under the name Quiz2Data.txt. Using MySql on your computer do: Create a database Create a table with name book, then load Quiz2Data.txt (check...

  • Specify relational calculus expression for the following descriptions on the Library database schema shown in Figure...

    Specify relational calculus expression for the following descriptions on the Library database schema shown in Figure 4.6. a) Retrieve Publishers’ name and phone number whose books where borrowed from Baltimore Branch. b) List the book title, book id and branch name with less than 10 copies c) List customer card number, customer name, branch name and book title for books which are currently on loan. BOOK Book id Title Publisher_name BOOK_AUTHORS Book idAuthor name PUBLISHER Name Address Phone BOOK COPIES...

  • Consider the following relation tables (fields with underline is primary keys): Author(Name, Country) Book(ISBN, Title, Publisher,...

    Consider the following relation tables (fields with underline is primary keys): Author(Name, Country) Book(ISBN, Title, Publisher, Subject) Writes(Name, ISBN) Write the relational algebra for the following query: a. (2 points) Give the titles of all books with "Art" subject Solution: b. (2 points) Give the name of all authors who publish with "Harding" Solution: (2 points) Give the name of all authors who have written books with "Science" subject Solution: c. d. (3 points) Give the titles of all books...

  • Which of the following queries contains a non-equality join? a. SELECT title, authorid FROM books, bookauthor...

    Which of the following queries contains a non-equality join? a. SELECT title, authorid FROM books, bookauthor WHERE books.isbn = bookauthor.isbn AND retail > 20; b. SELECT title, name FROM books JOIN publisher USING (pubid); c. SELECT title, gift FROM books, promotion WHERE retail >= minretail AND retail <= maxretail; d. none of the above

  • Question 10 (1 point) 10. If the following SQL statement is executed, what should be the...

    Question 10 (1 point) 10. If the following SQL statement is executed, what should be the query result? select ID, Name from Student where Hometown "San Antonio" D) Gina Lauren C) 1002 Gina 1004 Lauren B) Null A) San Antonio Question 7 (1 point) Saved Using the Student table, as shown below, to answer question 7 to 10 Name ID Grade Hometown Eric 1001 A Dallas Gina 1002 B San Antonio Eric 1003 Seattle Lauren 1004 A San Antonio Kathy...

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
Active Questions
ADVERTISEMENT