Hi guys, sorry this is obviously a coursework help thread - I might as well come out with it! Really struggling with SQL here, have a deadline in a few hours and towards the end of this coursework I have stumbled across a pretty big problem with foreign keys. When I try to call a foreign key, say cart_id from table Item, it just comes up blank. What have I done wrong? Any help would be SERIOUSLY appreciated as I'm going nuts here.....
It's been a while but let's see if I still have the magic touch. Try adding "CONSTRAINT FK Cart_ID" in your create table code. That tells the DB that "Cart_ID" is the foreign key for that table. Also throw in a "CONSTRAINT PK 'whatever'". This will give your table a Primary key as well. Also, depending on what software you are using, Oracle, M$ SQL Server Mgnt. Studio, or Access, have different ways you need access data from tables. Ensure that you are referencing the table correctly, etc, etc. I won't go on about all that since I'm sure you know that already. Good luck!
Thanks Alex...transpires FK's aren't as useful as they should be in the MySQL version that our uni runs....explaining my loss of understanding, but also meaning my repeated efforts were futile. Great! Thanks again though. Rep+