I would like to know how to create a table, and query, that allows me to store multiple values in one field, and to link that field to another table.
I have a database with 2 tables:
* indicates primary field
ok say the first table had the following values:
Now i want one query that returns only the records with "March" as the month_Of_Birth, and store the number_joined value of each return record ('1','3') into the field "people".
The another query that returns all the records from the first table, that have their primary key stored in the people field of the second table.
I am *very* new to SQL, so please excuse me for lack of lingo
well, this is for a school project, and the requirements are that our database has 2 tables linked to each other. And the idea i have to link the table would require a field that contains multiple values.
Unfortunately , there are no foriegn keys in Mysql in order for u to link the column number_joined in the first table with Queries in the second table,
but what u can do is to insure databse intergity manually through insert statments (whenever u insert a value in Queries , check that it exists in number_joined ) , and when u do a select , do it like this :
select f.Surnames , f.FirstNames , f.FirstNames , s.people from first_table f, second_table s where f.number_joined=s.Queries