can anyone help me to check the relation table of the database.

Recommended Answers

All 4 Replies

please post your question in full text
even i can't understand your question, so how can i help you?
please post your question again with some description of your question.

thanks

I looked at your SQL statements and it all looks fine, as far as I can tell. I did have to translate your SQL to a dialect I was more familiar with, but once I got all that fixed up, I didn't have any problems building the database and populating the tables.

There is one question about that PROMOTION table. Not sure if it's supposed to have referential integrity to anything. If so, it needs some work to get it to relate to anything.

If there's an actual question here, please elaborate.

Draw a complete ER-diagram/Model for the PIZZA delivery Database which consists of topping, Pizzatopping, Pizza, Pizza order, Customer tables.

----------------------------------------------

drop table pizza;
drop table topping;
drop table pizzatopping;
drop table pizzaorder;
drop table customer;

create table pizza
(
  pizzaID   number,
  pizzaname varchar2(30),
  basecost  number(4,2),
  primary key   (pizzaID)
);

create table topping
(
  toppingID number,
  topping   varchar2(10),
  toppingtype   varchar2(5),
  toppingcost   number(4,2),
  primary key   (toppingID)
);

create table pizzatopping
(
  pizzaID   number,
  toppingID number,
  primary key (pizzaID, toppingID)
);

create table pizzaorder
(
  orderID   number,
  customerID    number,
  pizzaID   number,
  orderdate date,
  quantity  number,
  primary key   (orderID)
);

-- INSERT THE CREATE TABLE STATEMENT HERE TO CREATE THE CUSTOMER TABLE
-- -------------------------------------------------------------------
-- NOTE: The table structure and data types must be capable of storing
--       the test data already contained in the INSERT statements for
--       the 'customer' table at the end of this script.



insert into pizza values (1,'Barnsley Bellybuster', 2.00);
insert into pizza values (2,'Doncaster Double', 1.50);
insert into pizza values (3,'Texborough Meat Munch', 2.00);
insert into pizza values (4,'Pickering Plain One', 1.50);

insert into topping values (1,'Onion','Veg', 0.50);
insert into topping values (2,'Pepper','Veg', 0.50);
insert into topping values (3,'Mushrom','Veg', 0.50);
insert into topping values (4,'Beef','meat', 0.75);
insert into topping values (5,'Chicken','meat', 0.75);
insert into topping values (6,'Pineapple','fruit', 0.45);

insert into pizzatopping values (1, 1);
insert into pizzatopping values (1, 2);
insert into pizzatopping values (1, 3);
insert into pizzatopping values (1, 4);
insert into pizzatopping values (2, 4);
insert into pizzatopping values (2, 3);
insert into pizzatopping values (3, 4);
insert into pizzatopping values (3, 1);
insert into pizzatopping values (4, 6);

insert into pizzaorder values (1,3632,1,'02-JAN-2005',1);
insert into pizzaorder values (2,2726,3,'02-JAN-2005',2);
insert into pizzaorder values (3,1124,1,'05-JAN-2005',1);
insert into pizzaorder values (4,1837,3,'05-JAN-2005',2);
insert into pizzaorder values (5,2311,2,'11-JAN-2005',1);
insert into pizzaorder values (6,1232,2,'16-JAN-2005',1);
insert into pizzaorder values (7,1324,3,'16-JAN-2005',3);
insert into pizzaorder values (8,2321,4,'16-JAN-2005',1);
insert into pizzaorder values (9,2311,4,'19-JAN-2005',1);
insert into pizzaorder values (10,1124,2,'21-JAN-2005',2);

insert into customer values (8327, 'Elizabeth Lincoln', '34 Compton Gardens, High Heaton, Newcastle upon Tyne', '0191 4092874');
insert into customer values (3632, 'Francisco Chang', '158 Biddlestone Road, Heaton, Newcastle upon Tyne', '0191 2650393');
insert into customer values (1837, 'Helen Bennett', '20 Church Avenue, High Heaton, Newcastle upon Tyne', '07709 726 374');
insert into customer values (1124, 'Janine Labrune', '68 New Ash Green, Jesmond, Newcastle upon Tyne', '0191 2081234');
insert into customer values (2827, 'Karin Josephs', '22 Warton Terrace, Heaton, Newcastle upon Tyne', '0191 2782927');
insert into customer values (2726, 'Karla Jablonski', '4 Bythesea Close, Whitley Bay, Newcastle upon Tyne', '0191 3097877');
insert into customer values (1232, 'Laurence Lebihan', '24 Ashby Road, High Heaton, Newcastle upon Tyne', '07709 773 937');
insert into customer values (2321, 'Lesley Brown', '25 Tenth Avenue, Heaton, Newcastle upon Tyne', '0191 2789229');
insert into customer values (1324, 'Maria Larsson', '32 Jesmond Dene, Jesmond, Newcastle upon Tyne', '0191 2701063');
insert into customer values (2311, 'Matti Karttunen', '27 Seventh Av., Heaton, Newcastle upon Tyne', '0191 2659284');

commit;
commented: This has nothing to do with your earlier question. -2

This has nothing to do with your earlier question. It also looks like a homework assignment.

We help out if you're stuck on something. We won't do your homework for you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.