first of all, these are my first steps into SQL world so please dont shoot me.
I have looked around to find answers to the following questions but had no luck so far:
When querying a table with a foreign key, will its linked data also be shown?
if not, how could i adjust that query to show its matching row of the other table?
I am trying to make a forum (just for fun and learning) and have a database like the following (really simple)
i hope you can understand and give me some hints/tips on how to go on with my project. At this moment im doubting whether to use Foreign Keys and just query everything.
Im using C# ASP.NET 3.5, if you need to know anything more i will answer as soon as i can.
I have looked around to find answers to the following questions but had no luck so far:
When querying a table with a foreign key, will its linked data also be shown?
if not, how could i adjust that query to show its matching row of the other table?
I am trying to make a forum (just for fun and learning) and have a database like the following (really simple)
table Subforum
(PK) ID int
Title varchar(150)
Description varchar(150)
table Topics
(PK) ID int
(FK -> (table Subforum) ID) Subforum_ID int
title varchar(150)
table Posts
(PK) ID int
(FK -> (table Topics) ID) Topic_ID int
Title varchar(150)
Body varchar(MAX)
(FK -> (table Users) ID) User_ID int
table Users
(PK) ID int
Username varchar(50)
Password varchar(MAX)
(PK) ID int
Title varchar(150)
Description varchar(150)
table Topics
(PK) ID int
(FK -> (table Subforum) ID) Subforum_ID int
title varchar(150)
table Posts
(PK) ID int
(FK -> (table Topics) ID) Topic_ID int
Title varchar(150)
Body varchar(MAX)
(FK -> (table Users) ID) User_ID int
table Users
(PK) ID int
Username varchar(50)
Password varchar(MAX)
Im using C# ASP.NET 3.5, if you need to know anything more i will answer as soon as i can.
Comment