473,795 Members | 3,002 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.custo mer#=orders.cus tomer#
AND orders.order#=o rderitems.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(bookautho r.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.orde r#
left JOIN customers c
ON o.customer#=c.c ustomer#
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.c ustomer#
ORDER BY ('Computers')

Oct 4 '06 #1
0 2921

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

Similar topics

44
4288
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 must be many know the answer here. thanks
3
6473
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 COULD be wrong... :) I've tried the access group...twice...and all I get is "Access doesn't like ".", which I know, or that my query names are too long, as there's a limit to the length of the SQL statement(s). But this works when I don't try to...
20
2381
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 (Employees), and the other is an Address File (Addresses) linked by SSN. I've set Addresses as a Lookup Table - If the user starts typing in the SSN it should pull up the Employees records. I'm getting stuck in the Data Entry form. When I type in...
42
2416
by: Christopher C. Stacy | last post by:
Some people say sizeof(type) and other say sizeof(variable). Why?
102
5722
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 can't tell where a bracket is missing.... a few weeks have past, I requested a feature for the delphi ide/editor "automatic identation of code in begin/end statements etc" and today when I woke up I suddenly released a very simple solution for this...
6
1719
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 pretty quick returned the data to the screens in about 2 - 3 seconds. Now its going about 5 - 10 seconds. How can I beef it up for better performance.
10
3484
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 somewhere that each folder under the "web site" is compiled in separate assembly. I however, did not find that the "web site" creation in vs.net 2005 created any AssemblyInfo.cs file.
14
1753
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; typedef struct function_menu { unsigned short num_items;
16
2910
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
1165
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 existing web site. At the moment the rest of the site is developed in PHP but the hosts have said they will provide python support for free, although they haven't given any more details than that, so I'm not sure exactly what that means. All...
0
10439
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10215
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10165
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9043
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7541
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6783
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5437
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3727
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.