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
SQL
SQL stands for Structured Query Language, is a form of communication that uses queries structured in a specific format to store, manage & retrieve data from a relational database.
Queries
A query is a type of computer programming language that is used to retrieve data from a database. Databases are useful in a variety of ways. They enable the retrieval of records or parts of records, as well as the performance of various calculations prior to displaying the results. A search query is one type of query that many people perform several times per day. A search query is executed every time you use a search engine to find something. When you press the Enter key, the keywords are sent to the search engine, where they are processed by an algorithm that retrieves related results from the search index. Your query's results are displayed on a search engine results page, or SER.
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:
<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>

Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 5 images









