query hheeelp



Hi

need help
My english is not good so ill be short.
This is my database


create table customers
(
customerid int unsigned not null auto_increment primary key,
name char(40) not null,
address char(40) not null,
city char(20) not null,
state char(20),
zip char(10),
country char(20) not null
);

create table orders
(
orderid int unsigned not null auto_increment primary key,
customerid int unsigned not null,
amount float(6,2),
date date not null,
order_status char(10),
ship_name char(40) not null,
ship_address char(40) not null,
ship_city char(20) not null,
ship_state char(20),
ship_zip char(10),
ship_country char(20) not null
);

create table books
(
isbn char(13) not null primary key,
author char(30),
title char(60),
catid int unsigned,
price float(4,2) not null,
description varchar(255)
);

create table categories
(
catid int unsigned not null auto_increment primary key,
catname char(40) not null
);

create table order_items
(
orderid int unsigned not null,
isbn char(13) not null,
item_price float(4,2) not null,
quantity tinyint unsigned not null,
primary key (orderid, isbn)
);

The question is how to make a query to get order list of books from specific
customer.
example: John ordered LoR1 j.r.r.tolkien 20 $ The best book ever
LoR2 j.rr Tolkirn 20$ The second best
book
Php mySql Welling 25$ The good book of
php

Please help
Thanks Ivan


.



Relevant Pages

  • Re: DB structure question
    ... > Don't forget to set the primary key. ... unique_ID_book (linked to primary key in books table) ... and each is assigned a unique identifier, ... then I insert into the reviews table, the unique identifier for the user, ...
    (microsoft.public.inetserver.asp.db)
  • Re: Key field in book library
    ... > Where can I find guidance in designing a 'custom' autonumber field? ... >> As Destin has suggested an autonumber primary key would be the reasonable ... >>>prefix plus the classic 10 character) as the key field for each book. ... >>>We're using a 39 scanner code for the books and patrons. ...
    (microsoft.public.access.gettingstarted)
  • Re: Adding records to one table, while working in a related table
    ... Primary Key ... PersonID, Primary Key ... Authors are not associated with Books in the Books form. ... table Authors bound to the subform. ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Book Loan Database
    ... The problem I have is I don't know what should be set as the primary key, ... I have several copies on most of the books in inventory with the same ISBN ... ON UPDATE CASCADE, ... purchase_date DATETIME NOT NULL, ...
    (microsoft.public.access.tablesdbdesign)
  • mysql query
    ... This is my database in mysql ... customerid int unsigned not null auto_increment primary key, ... The question is how to make a query to get order list of books from specific ... Php mySql Welling 25$ The good book of ...
    (comp.databases)