473,406 Members | 2,633 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Question 9 is the only one correct rest keep coming up syntax errors.help

USING:ORACLE 9i

For each of the following tasks, determine (a) the SQL statement needed to
perform the stated task using the traditional approach and (b) the SQL
statement needed to perform the stated task the JOIN keyword.

1. A list that displays the title of each book & the name and phone number of
the person at the publisher's office whom you would need to contact to record
each book.

SELECT title, name, customer
FROM books NATURAL JOIN publisher
WHERE books.pubid = publisher.pubid
AND c.books = record

2. Determine which orders have not yet shipped & the name of the customer
that placed each order. Sort results by dates on the orders was placed.

SELECT lastname, firstname, order#
FROM customers c, JOIN orders, o
WHERE c.customer# = o.customer#(+)
ORDER BY c.customer#;

3. List the customer number & names of all individuals have purchased books
in the Fitness Category.

SELECT title, firstname, lastname
FROM customers,JOIN orders, orderitems, books
WHERE customers.customer#=orders.customer#
AND orders.order#=orderitems.order#
AND orderitems.isbn=books.isbn
ORDER BY title = (‘Fitness’)
4. Determine book Jake Lucas has purchased.

SELECT lastname, firstname, order#
FROM customers c OUTER JOIN orders o
WHERE lastname = 'Lucas' and firstname = 'Jake'
ON c.customer# = o.customers#
ORDER BY c.customers# = (‘Jake Lucas’)

5. Determine profit of each book sold to Jake Lucas. Sort results by date of
order. If more than 1 book was ordered, have results sorted by profit amount
in descending order.

SELECT lastname, firstname, order#
FROM customers, JOIN orders, orderitems, books
WHERE "Profit"
COUNT() and GROUP BY
ORDER BY "Profit" desc;

6. Which book was written by an author with the last name Adams ?

SELECT title, authorid
FROM books, JOIN bookauthor
WHERE author upper(bookauthor.lastname) = ' ADAMS '
7. What gift will a customer who orders the book Shortest Poems receive?

SELECT title, customer, gift
FROM books, JOIN promotion ('Shortest Poem')
ON retail BETWEEN minretail AND maxretail

8. Identify the author(s) of books ordered by Becca Nelson
SELECT lastname, firstname, title, customers authorid
FROM books,JOIN customers, bookauthor
WHERE customers
ORDER BY ('Becca Nelson')

9. Display list of all books in BOOKS table. If a book has been ordered by a
customer, also list the corresponding order number(s) & state which the
customer resides.

SELECT title, o.order#, state
FROM books b LEFT JOIN orderitems i
ON b.isbn=i.isbn
left JOIN orders o
ON o.order#=i.order#
left JOIN customers c
ON o.customer#=c.customer#
ORDER BY title;

10. Produce a list of all customers live in the state of Florida & ordered
books about computers.

SELECT lastname, firstname, state, books, order#
FROM state s,JOIN customers c, orders o (' Florida ')
WHERE c. customer# AND s. customer# = o. customer#
ON o.customer#=c.customer#
ORDER BY ('Computers')

Oct 4 '06 #1
0 2904

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

44
by: lester | last post by:
a pre-beginner's question: what is the pros and cons of .net, compared to ++ I am wondering what can I get if I continue to learn C# after I have learned C --> C++ --> C# ?? I think there...
3
by: Tcs | last post by:
My backend is DB2 on our AS/400. While I do HAVE DB2 PE for my PC, I haven't loaded it yet. I'm still using MS Access. And no, I don't believe this is an Access question. (But who knows? I...
20
by: Jack Schitt | last post by:
I thought I was starting to get a handle on Access, until I tried doing something useful...now I'm stuck. I have a DB with two tables - to keep it simple I'll say that one is an Employee File...
42
by: Christopher C. Stacy | last post by:
Some people say sizeof(type) and other say sizeof(variable). Why?
102
by: Skybuck Flying | last post by:
Sometime ago on the comp.lang.c, I saw a teacher's post asking why C compilers produce so many error messages as soon as a closing bracket is missing. The response was simply because the compiler...
6
by: Mike | last post by:
Lets just say my app is done HOO HOO. Now, I'm accessing the database via a web service and one thing i noticed that my app is running real slow. When I first started working on the app is ran...
10
by: jojobar | last post by:
Hello, I am trying to use vs.net 2005 to migrate a project originally in vs.net 2003. I started with creation of a "web site", and then created folders for each component of the site. I read...
14
by: Bill Reid | last post by:
OK, let's say that have a function menu structure declaration like this (since I basically do): typedef struct function_item { char *descrip; void(*function)(void); } t_function_item; ...
16
by: Chad | last post by:
Given the following #include <stdio.h> int main(void) { char line; long arg1, arg2; while(fgets(line, BUFSIZ, stdin) != NULL){
1
by: SimonPalmer | last post by:
Apologies in advance if this is either a) the wrong board or b) been answered a million times elsewhere, but... I have been given an assignment to get a python module up and running behind an...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.