for the BASICS of the join read on here:
http://www.w3schools.com/sql/sql_join.asp
to give you a graphical way to play with sql on your webserver i suggest the phpMyAdmin thingy:
http://www.phpmyadmin.net/
the simplist way to join to tables with with a comma ',' in the FROM section
during a ',' join every combination of every row is made
table ( A )
A1 A2
-- --
a 1
b 2
table ( B )
B1 B2
-- --
c 1
d 2
SQL:
SELECT * FROM A, B
table ( RESULT )
A1 A2 B1 B2
-- -- -- --
a 1 c 3
b 2 c 3
a 1 d 4
b 2 d 4
If you don't want every combination then you must ask for specific ones in the WHERE clause
SQL:
SELECT * FROM A, B WHERE A1='a'
table ( RESULT )
A1 A2 B1 B2
-- -- -- --
a 1 c 3
a 1 d 4
ok now you want all the characters owned by a user: enter zalath's example
SELECT
c.character
FROM
users u,
characters c
WHERE
u.user = "Rick"
and
c.userId = u.userId
the ',' join makes every combination of users and characters, pulls out the ones where the character userId = the user userId. and then takes only the ones where the users.user is Rick
example:
Rick and ednark are users, Rick plays longFist and GeneralAxe, ednark plays littleElf
lets follow through a bunch of sql queries to see what we get
table Users ( u )
u.user u.userId
------ --------
Rick 1
ednark 2
table Characters ( c )
c.userId c.character
-------- -----------
1 longfist
1 GeneralAxe
2 littleElf
SQL:
SELECT * FROM USERS as u, CHARACTERS as c
table ( RESULTS )
u.user u.userId c.userId c.character
------ -------- -------- -----------
Rick 1 1 longfist
Rick 1 1 GeneralAxe
Rick 1 2 littleElf
ednark 2 1 longfist
ednark 2 1 GeneralAxe
ednark 2 2 littleElf
SQL:
SELECT * FROM USERS as u, CHARACTERS as c WHERE u.user="Rick"
table ( RESULTS )
u.user u.userId c.userId c.character
------ -------- -------- -------------
Rick 1 1 longfist
Rick 1 1 GeneralAxe
Rick 1 2 littleElf
SQL:
SELECT * FROM USERS as u, CHARACTERS as c WHERE u.user="Rick" and u.userId=c.userId
table ( RESULTS )
u.user u.userId c.userId c.character
------ -------- -------- -------------
Rick 1 1 longfist
Rick 1 1 GeneralAxe
and viola! you got your info... hope this helps you understand