I can make these TABLES , no Problem , but how to relate them with the users who have not yet signed in (u can still shop and add to Cart, on most websites before CHECKOUT e.g amazon.com) ?
Well, I still say you'd be better off in the long run consolidating your reguser and tempuser tables. Even if some of the fields are only used by one or the other state (isRegistered being true or false), it's better than two tables. Mostly because of the need to relate a primary key in this table (or these tables) to the orders
This is a dilemma faced by many DB designers. There are various ugly solutions.
You could do
CREATE TABLE orders (
orderid INT AUTO_INCREMENT PRIMARY KEY,
reguserid INT NULL REFERENCES regusers(userid),
tempuserid INT NULL REFERENCES tempusers(tempid),
... etc. ...
And then ensure that you never have both reguserid and tempuserid non-null in the same record.
It works, but it complicates your later work.
In order to display an order, you typically end up doing something like this:
SELECT IFNULL(regusers.username,tempusers.username) AS name,
IFNULL(regusers.email,tempusers.email) AS emailaddress,
LEFT JOIN regusers ON orders.reguserid = regusers.userid
LEFT JOIN tempusers ON orders.tempuserid = tempusers.tempid
Truly and honestly, most sites opt for the solution I gave you.
It may increase the record size of you users table a little bit, but it's way worth it in the long run.