Hi I'm new to sql and just needed a little help.
Say I have the following tables:
PrsDetails
ID Name Age Gen St. Co.
1 sdl 15 M VA US
2 slkd 14 F TX US
3 slkdd 17 F VA US
3 sldks 15 M UP IN
...
StDet
StateAbv State Reg Co
VA Virginia SE US
TX Texas SC US
UP Uttar Pradesh N IN
...
CoDet
CountryAbv Country Continent
US United States North America
IN India Asia
CH China Asia
...
How would I get a new table for all people from Texas that looks like:
ID Name Age Gen State Reg Country Continent
2 slkd 14 F Texas SC US North America
...
Basically, what I'm doing now is:
CREATE TABLE PeopleFromTexas (
ID int,
Name varChar(10),
Age int,
Gen varChar(1),
State varChar(30),
Reg varChar(4),
Country varChar(70)
Continent varChar(60)
);
INSERT INTO PeopleFromTexas
SELECT
PrsDetails.ID,
PrsDetails.Name,
PrsDetails.Age,
PrsDetails.Gen,
StDet.State,
StDet.Reg,
CoDet.Country,
CoDet.Continent
FROM
PrsDetails,
StDet,
CoDet
WHERE
State = 'Texas'
But this is not working, and I'm not exactly sure how to go about doing this.