Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 16-10-2009
Member
 
Join Date: Aug 2009
Posts: 155
Simple conceptual model in SQL

I want to realize a conceptual data model for a mini-database allowing me to follow the orders of pizzas CARRIED by customers.

So I have the following entities:

CUSTOMER (customer_id; client_name)
PIZZA (code_pizza; name_pizza)
as these pizzas are typically available in 3 sizes...
SIZE (code_size; size)

The price of a pizza will be listed in the table resulting from the relationship between pizza and size (since the price depends on both these data)
EXIST (code_pizza; code_size; price_pizza)

But if I want to follow the money spent by customers during their shopping ... how do I do. For now, I thought creating a new entity CONTROL (number_command; date) connected to one side at a customer table on the other pizza at the table? Should we link it as the table size? or because the table Pizza is already connected to the table size with a relationship that gives a price-what is it enough??

It would be easier with a schema ...

CUSTOMER (customer_id; client_name) --- pass --- CONTROL (number_command; date) includes --- (number_command; code_pizza ? --- PIZZA (code_pizza; name_pizza )---- exist (code_pizza; code_size; price_pizza) -- --- SIZE (code_size; size)
Reply With Quote
  #2  
Old 16-10-2009
Member
 
Join Date: Nov 2005
Posts: 1,323
Re: Simple conceptual model in SQL

You can make a table ORDER (num_command, customer_id, code_pizza, code_size, date), you can add this table in order while recording related to the order type total_price ...

But in your table if you have pizza that the name indicated in the table and size that you have the number of size (1, 2 or 3) it is not necessary to make two table for that

I advise you to make 1 customer table with all the coordinates of the client command and a table with a number of key foreign customer, and having all data directly in the command table
Reply With Quote
  #3  
Old 16-10-2009
Member
 
Join Date: May 2008
Posts: 2,293
Re: Simple conceptual model in SQL

We must distinguish in this table command order number (fixed value) and an Order id (auto increment), it will be several pizza on one order for one customer.

Disagree with absolute55, it is better to have a table Pizza and a table size eventually. If we want to respect minimum standards (3NF) and avoid duplication of information.

Moreover, it will be easier to generate any additional combobox to select the pizza and size
Reply With Quote
  #4  
Old 16-10-2009
Member
 
Join Date: Apr 2008
Posts: 2,001
Re: Simple conceptual model in SQL

Hi, I arrived a little late, but since I'm not super agree with the answers provided, I propose my own:

Your Feature "command" must be connected to the entity "customer" with a single constraint, and the entity "price" (entity "EXIST" in your model, but fame more explicitly for the hand) by a simple constraint again.

Indeed, what matters in the command is not the only type of pizza ordered. But also the price. with the latter, not only you have the basic information for your year (follow the money spent by customers) but more importantly, you also have the relationship with the pizza and its size as you infer from the price. So while traveling.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags:



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Simple conceptual model in SQL"
Thread Thread Starter Forum Replies Last Post
Differences in AT&T phone model and unlocked/unbranded model of HTC titan Pratyus Portable Devices 8 05-12-2011 09:20 PM
Simple To-Do App TanakL Windows Software 6 16-09-2010 12:07 AM
china mobile phone model: "INCOMP Model:W902A" gerardmodeste Portable Devices 1 04-01-2010 09:10 AM
Halo 3: ODST conceptual images Russell Video Games 2 29-12-2008 06:46 PM
Simple QoS Policy On 877 Blakeexz Networking & Security 2 25-10-2008 04:44 PM


All times are GMT +5.5. The time now is 04:54 PM.