Hello,
I'm really new to this SQL things, I've been worked on it long
time ago. Now I have to use it again and I need some advice. I have 1
database which contain 4 different tables. Each table I set SSN as a
primary key (it's int(9)). It look something like this:
+--------+-----------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------+-----------------+------+-----+---------+-------+
| name | varchar(40) | | | | |
| ssn | int(9) unsigned | | PRI | 0 | |
| credit | int(2) unsigned | YES | | NULL | |
| status | char(1) | YES | | NULL | |
+--------+-----------------+------+-----+---------+-------+
+----------+-----------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+-----------------+------+-----+---------+-------+
| ssn | int(9) unsigned | | PRI | 0 | |
| room_num | varchar(15) | | | | |
+----------+-----------------+------+-----+---------+-------+
+-----------+-----------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+-----------------+------+-----+---------+-------+
| ssn | int(9) unsigned | | PRI | 0 | |
| tech_name | varchar(30) | | | | |
+-----------+-----------------+------+-----+---------+-------+
+-------------+-----------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+-----------------+------+-----+---------+-------+
| ssn | int(9) unsigned | | PRI | 0 | |
| curr_status | text | YES | | NULL | |
+-------------+-----------------+------+-----+---------+-------+
Now, how can I join all this tables together? I want to be able to do
something like, for example: when I search for curtain SSN # then it will
show name, curr_status and room_num. Or display all the information. How
can I do it? Please help me getting start here. I already print out the
MySQL document but it didn't really help me much.
TIA
pe'
------------------------------
UNIX System Admin.
Distributed Computing Services
Lake Superior State University
650 W. Easterday Ave.
Sault Ste. Marie. MI
49783 USA.
------------------------------