Topic: Databse Prompt: Transform as necessary and then write the XML elements to the appropriate tables in the database.Build SQL chunks for the following queries: What are the titles and prices of all books written by "Galos, Mike"? List the titles and the prices. What is the most recent year of publication of all books written by "O'Brien, Tim". What is the average price of all books in the "Fantasy" genre. Find the number of books in each genre. List the title and author of all books that cost less than the average price of books. XML Syntax:       Gambardella, Matthew       XML Developer's Guide       Computer       44.95       2000-10-01                   Ralls, Kim       Midnight Rain       Fantasy       5.95       2000-12-16                   Corets, Eva       Maeve Ascendant       Fantasy       5.95       2000-11-17                   Corets, Eva       Oberon's Legacy       Fantasy       5.95       2001-03-10                   Corets, Eva       The Sundered Grail       Fantasy       5.95       2001-09-10                   Randall, Cynthia       Lover Birds       Romance       4.95       2000-09-02                   Galos, Mike       Visual Studio       Computer       69.95       2008-09-01                   Thurman, Paula       Splish Splash       Romance       4.95       2000-11-02                   Knorr, Stefan       Creepy Crawlies       Horror       4.95       2000-12-06                   Kress, Peter       Paradox Lost       Science Fiction       6.95       2000-11-02                   Galos, Mike       Visual Basic for Beginners       Computer       29.95       2004-05-20                   O'Brien, Tim       Microsoft .NET: The Programming Bible       Computer       36.95       2000-12-09                   O'Brien, Tim       MSXML3: A Comprehensive Guide       Computer          36.00       2005-12-01                   O'Brien, Tim       MSXML3: A Comprehensive Guide       2       Computer          36.00       2009-10-01                     Galos, Mike       Visual Studio 7: A Comprehensive Guide       Computer       49.95       2001-04-16                   Corets, Eva       Oberon's Revenge       Fantasy       7.95       2004-06-01

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
icon
Concept explainers
Question

Topic: Databse

Prompt:

  1. Transform as necessary and then write the XML elements to the appropriate tables in the database.Build SQL chunks for the following queries:
    1. What are the titles and prices of all books written by "Galos, Mike"? List the titles and the prices.
    2. What is the most recent year of publication of all books written by "O'Brien, Tim".
    3. What is the average price of all books in the "Fantasy" genre.
    4. Find the number of books in each genre.
    5. List the title and author of all books that cost less than the average price of books.

XML Syntax:

<book id="bk101">

      <author>Gambardella, Matthew</author>

      <title>XML Developer's Guide</title>

      <genre>Computer</genre>

      <price>44.95</price>

      <publish_date>2000-10-01</publish_date>

      <description></description>

   </book>

   <book id="bk102">

      <author>Ralls, Kim</author>

      <title>Midnight Rain</title>

      <genre>Fantasy</genre>

      <price>5.95</price>

      <publish_date>2000-12-16</publish_date>

      <description></description>

   </book>

   <book id="bk103">

      <author>Corets, Eva</author>

      <title>Maeve Ascendant</title>

      <genre>Fantasy</genre>

      <price>5.95</price>

      <publish_date>2000-11-17</publish_date>

      <description></description>

   </book>

   <book id="bk104">

      <author>Corets, Eva</author>

      <title>Oberon's Legacy</title>

      <genre>Fantasy</genre>

      <price>5.95</price>

      <publish_date>2001-03-10</publish_date>

      <description></description>

   </book>

   <book id="bk105">

      <author>Corets, Eva</author>

      <title>The Sundered Grail</title>

      <genre>Fantasy</genre>

      <price>5.95</price>

      <publish_date>2001-09-10</publish_date>

      <description></description>

   </book>

   <book id="bk106">

      <author>Randall, Cynthia</author>

      <title>Lover Birds</title>

      <genre>Romance</genre>

      <price>4.95</price>

      <publish_date>2000-09-02</publish_date>

      <description></description>

   </book>

   <book id="bk148">

      <author>Galos, Mike</author>

      <title>Visual Studio</title>

      <genre>Computer</genre>

      <price>69.95</price>

      <publish_date>2008-09-01</publish_date>

      <description></description>

   </book>

   <book id="bk107">

      <author>Thurman, Paula</author>

      <title>Splish Splash</title>

      <genre>Romance</genre>

      <price>4.95</price>

      <publish_date>2000-11-02</publish_date>

      <description></description>

   </book>

   <book id="bk108">

      <author>Knorr, Stefan</author>

      <title>Creepy Crawlies</title>

      <genre>Horror</genre>

      <price>4.95</price>

      <publish_date>2000-12-06</publish_date>

      <description></description>

   </book>

   <book id="bk109">

      <author>Kress, Peter</author>

      <title>Paradox Lost</title>

      <genre>Science Fiction</genre>

      <price>6.95</price>

      <publish_date>2000-11-02</publish_date>

      <description></description>

   </book>

   <book id="bk118">

      <author>Galos, Mike</author>

      <title>Visual Basic for Beginners</title>

      <genre>Computer</genre>

      <price>29.95</price>

      <publish_date>2004-05-20</publish_date>

      <description></description>

   </book>

   <book id="bk110">

      <author>O'Brien, Tim</author>

      <title>Microsoft .NET: The Programming Bible</title>

      <genre>Computer</genre>

      <price>36.95</price>

      <publish_date>2000-12-09</publish_date>

      <description></description>

   </book>

   <book id="bk111">

      <author>O'Brien, Tim</author>

      <title>MSXML3: A Comprehensive Guide</title>

      <genre>Computer</genre>   

      <price>36.00</price>

      <publish_date>2005-12-01</publish_date>

      <description></description>

   </book>

   <book id="bk211">

      <author>O'Brien, Tim</author>

      <title>MSXML3: A Comprehensive Guide</title>

      <edition>2</edition>

      <genre>Computer</genre>   

      <price>36.00</price>

      <publish_date>2009-10-01</publish_date>

      <description></description>

   </book>

 

   <book id="bk112">

      <author>Galos, Mike</author>

      <title>Visual Studio 7: A Comprehensive Guide</title>

      <genre>Computer</genre>

      <price>49.95</price>

      <publish_date>2001-04-16</publish_date>

      <description></description>

   </book>

   <book id="bk174">

      <author>Corets, Eva</author>

      <title>Oberon's Revenge</title>

      <genre>Fantasy</genre>

      <price>7.95</price>

      <publish_date>2004-06-01</publish_date>

      <description></description>

   </book>

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 5 images

Blurred answer
Knowledge Booster
Query Syntax
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education