Re: simple sql questions
Date: Wed, 8 Sep 1993 14:19:07 GMT
Message-ID: <rchanceCD1H3w.9D2_at_netcom.com>
David Benua (dbenua_at_panix.com) wrote:
: In <26il6n$9lh_at_elroy.jpl.nasa.gov> jason_at_woody.uucp (Jason Yi) writes:
: >Question 1.
: >I want to do something like this:
: >select * from mytable where mycolumn='ABC*';
: > ^
: > |
: > |
: > match anything that starts with ABC
: >Is this possible?
: Yes, try select * from mytable where mycolumn like 'ABC%'
Notice the use of the keyword 'like' and the character '%' - that's the difference between what you want and what you're doing
: >When you have a foriegn key, does the child table make a copy of it's
: >parent's or does it have a pointer referencing to it's parent?
: To misquote Firesign theatre: "No, No, No, you don't understand how
: radio works!"
: Child tables don't have pointers, or copies. Neither do parent tables.
: It's the _query_ which links the tables, not the database itself. This
: is the key to relational databases.
The "child" table stores the primary key to the "parent table" as a column;
hence it's name 'foreign key'. In your query, you specify the "linkage",
i.e., parent.primary = child.foreign.
: Dave
: >Thanks in advance
: --
: David Benua Internet: dbenua_at_panix.com
: Compu$erve: 72630,1416
:
Received on Wed Sep 08 1993 - 16:19:07 CEST