Re: [sqlite] Ultimate noob question: What do I do to reference another table?
LMcLain wrote: > Thanks for the replay Igor! > > I would heartily agree about getting a textbook. Do you have one that you > could recommend? I like "The definitive Guide to SQLite" by Michael Owens, it is excellent, except the index which sucks. It is a very good read and covers a lot of the basics of SQL, rational theory, SQLite design, usage, C-api, and other stuff. -Steve ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Ultimate noob question: What do I do to reference another table?
Thanks for the replay Igor! I would heartily agree about getting a textbook. Do you have one that you could recommend? Thanks again, Lee Igor Tandetnik wrote: > > "LMcLain" <[EMAIL PROTECTED]> wrote in > message news:[EMAIL PROTECTED] >> Yes, this is quite the noob question: I want to have one fields >> reference another table, how do I do that? >> Here's what I am trying to do. I have a bunch of fields(or columns) >> Item, UPC, Manufacturer, MSRP for example. I want to be able to >> choose the Manufacturer from a different table's list of >> manufacturers and then have that field address that record. > > Normally, you would have two tables: Manufacturers(ManufacturerId, > Manufacturer, OtherInfoAboutManufacturer) and Items(Item, > ManufacturerId, OtherInfoAboutItem). A record in Items refers to a > record in Manufacturers simply by virtue of using the same value in > ManufacturerId field. > > Given this arrangement, you can get a list of items and their > manufacturers like so: > > select Item, Manufacturer > from Items join Manufacturers > on (Items.ManufacturerId = Manufacturers.ManufacturerId); > > > With all due respect, I suggest you invest in a SQL textbook. This is > very basic, it would be explained in chapter 1. > > Igor Tandetnik > > > > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > -- View this message in context: http://www.nabble.com/Ultimate-noob-question%3A-What-do-I-do-to-reference-another-table--tp18522905p18538280.html Sent from the SQLite mailing list archive at Nabble.com. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Ultimate noob question: What do I do to reference another table?
"LMcLain" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Yes, this is quite the noob question: I want to have one fields > reference another table, how do I do that? > Here's what I am trying to do. I have a bunch of fields(or columns) > Item, UPC, Manufacturer, MSRP for example. I want to be able to > choose the Manufacturer from a different table's list of > manufacturers and then have that field address that record. Normally, you would have two tables: Manufacturers(ManufacturerId, Manufacturer, OtherInfoAboutManufacturer) and Items(Item, ManufacturerId, OtherInfoAboutItem). A record in Items refers to a record in Manufacturers simply by virtue of using the same value in ManufacturerId field. Given this arrangement, you can get a list of items and their manufacturers like so: select Item, Manufacturer from Items join Manufacturers on (Items.ManufacturerId = Manufacturers.ManufacturerId); With all due respect, I suggest you invest in a SQL textbook. This is very basic, it would be explained in chapter 1. Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Ultimate noob question: What do I do to reference another table?
you need several tables, then you can refernce them thru a view to show what is related to what. --- On Fri, 7/18/08, LMcLain <[EMAIL PROTECTED]> wrote: From: LMcLain <[EMAIL PROTECTED]> Subject: [sqlite] Ultimate noob question: What do I do to reference another table? To: sqlite-users@sqlite.org Date: Friday, July 18, 2008, 1:33 AM Hi everyone, Yes, this is quite the noob question: I want to have one fields reference another table, how do I do that? Here's what I am trying to do. I have a bunch of fields(or columns) Item, UPC, Manufacturer, MSRP for example. I want to be able to choose the Manufacturer from a different table's list of manufacturers and then have that field address that record. I hope that I am making sense, but I wouldn't be surprised if I'm not! :/ I can't figure out how to do it or even what the terminology for this process is so that I can look it up myself! Please help! Thanks, Lee -- View this message in context: http://www.nabble.com/Ultimate-noob-question%3A-What-do-I-do-to-reference-another-table--tp18522905p18522905.html Sent from the SQLite mailing list archive at Nabble.com. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Ultimate noob question: What do I do to reference another table?
Hi everyone, Yes, this is quite the noob question: I want to have one fields reference another table, how do I do that? Here's what I am trying to do. I have a bunch of fields(or columns) Item, UPC, Manufacturer, MSRP for example. I want to be able to choose the Manufacturer from a different table's list of manufacturers and then have that field address that record. I hope that I am making sense, but I wouldn't be surprised if I'm not! :/ I can't figure out how to do it or even what the terminology for this process is so that I can look it up myself! Please help! Thanks, Lee -- View this message in context: http://www.nabble.com/Ultimate-noob-question%3A-What-do-I-do-to-reference-another-table--tp18522905p18522905.html Sent from the SQLite mailing list archive at Nabble.com. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users