Purchase Solution

Create a query that would convert the order year into a decade and count the orders

Not what you're looking for?

Ask Custom Question

Using the database attached to Lecture 2, let's say you are interested (let's say as the business owner) to see how old the books are that people order (going by their publication date).

First, you'd need to create a query that would convert the order year into a decade and count the orders:

SELECT books.title, CInt(Left([publication_year],3))*10 AS DECADE, order_lines.quantity
FROM books INNER JOIN order_lines ON books.isbn = order_lines.isbn;

...The function "CInt() converts text values into integers (year is stored as a text value).

Anyhow, for participation credit, cut and paste the above SQL into a query in the Lecture 2 database. Name the query BOOK_DECADE.

Then, create the cross tab query following these steps:
in the queries TAB click: New
then Cross Tab query wizard
then OK
In "View", click "Queries" and then Select query BOOK_DECADE and click NEXT
Add the TITLE to "Selected Field and click NEXT
Highlight DECADE and click NEXT
UNCLICK "Yes, include row sums"
Click Quantity under "Fields:" and click "Sum" under "Functions:" and click NEXT
Then click FINISH

When you are done, cut and paste the SQL (for this query) and paste into a word document.

Purchase this Solution

Purchase this Solution


Free BrainMass Quizzes
Javscript Basics

Quiz on basics of javascript programming language.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.