Jump to content

Simple SQL syntax request


JansenDK

Recommended Posts

Hi all

 

So, im looking for a simple SQL syntax that does following;

 

Determines what subject an article is about. (food, health for axample)

 

I've build 2 entities, one called artikler, and one called emne.

 

http://img163.imageshack.us/img163/3321/illustration.png

 

Now, id like the foreign key from artikler, to refer to the entity emne, so that it can tell what subject that article is.

 

(NOTE, its in danish = entity emne = mad/food and sundhed/health)

FK is foreign key.

 

Any ideas for a SQL syntax?

Link to comment
https://forums.phpfreaks.com/topic/189216-simple-sql-syntax-request/
Share on other sites

Well almost nothing :) Im brand new to SQL.

 

So, what I got so far is;

 

SELECT emne

FROM artikel

 

Im guessing that thats not enough to make any code or action work.

 

Id like the foreign key to fetch the subject of the article. However I dont know how to!

 

http://img96.imageshack.us/img96/4250/illustrationo.png

 

It might be easier to see the relation between foreign key and the primary key of emne.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.