Database Forum / General DB Topics / General DB Topics / October 2004
renaming rows subject to foreign key constraints
|
|
Thread rating:  |
Michael Hartley - 18 Oct 2004 10:18 GMT what will happen to the foreign key constraint, according to the sql standard, when I issue the following commands :
CREATE TABLE GURBO ( AT1 char(10) );
CREATE TABLE ZURBO ( AT2 char(10) references GURBO(AT1) );
ALTER TABLE GURBO RENAME AT1 AS MURBO;
What would happen if I renamed AT2 in ZURBO instead???
Yours, Mike H...
Robert Klemme - 18 Oct 2004 11:31 GMT > what will happen to the foreign key constraint, according to the sql > standard, when I issue the following commands : [quoted text clipped - 12 lines] > > Yours, Mike H... What would happen if people here assumed this to be a kind of homework question?
robert
Alan - 18 Oct 2004 14:39 GMT > what will happen to the foreign key constraint, according to the sql > standard, when I issue the following commands : [quoted text clipped - 12 lines] > > Yours, Mike H... 1. You could try it yourself and see. 2. You could look it up in your textbook. 3. You could give us your professor's email address and we could submit the answer directly for you.
Alfred Newmane - 18 Oct 2004 16:41 GMT > what will happen to the foreign key constraint, according to the sql > standard, when I issue the following commands : [quoted text clipped - 10 lines] > > What would happen if I renamed AT2 in ZURBO instead??? Assuming you're using Oracle, it shouldn't allow you to change GURBO.AT1 (also AT1 should be a (primary) key. There is no reason ZURBO.AT2 can't be renamed, unless maybe it was a key, can't remember for sure, it's been a while since I did Oracle, and I don't have access to one right now.
[Some people ay this looks liek a home work question, though it first struck me as question of curiosity, as not everyone at home has access to an Oracle database. Sorry if I'm wrong.]
Lemming - 18 Oct 2004 20:36 GMT >> what will happen to the foreign key constraint, according to the sql >> standard, when I issue the following commands : [quoted text clipped - 20 lines] >struck me as question of curiosity, as not everyone at home has access >to an Oracle database. Sorry if I'm wrong.] Given the way the question is phrased, it's almost certainly homework as it uses a format popular with teachers/lecturers/etc:
According to the specification for <such-and-such>, What happens if <something>? How about if <something else>?
All it was missing was the reminder to quote the appropriate sections of the specification in the answer.
Lemming
 Signature Curiosity *may* have killed Schrodinger's cat.
Alfred Newmane - 19 Oct 2004 01:43 GMT >>> what will happen to the foreign key constraint, according to the sql >>> standard, when I issue the following commands : [quoted text clipped - 30 lines] > All it was missing was the reminder to quote the appropriate sections > of the specification in the answer. Thank Lemming. It's always a possibility. And even if it is a homework question, getting feed back can sometimes help one learn, though theres no way to tell weather or not the OP was trying to take an easy way out by just getting answers and running.
Gene Wirchenko - 19 Oct 2004 03:16 GMT [snip]
>Thank Lemming. It's always a possibility. And even if it is a homework >question, getting feed back can sometimes help one learn, though theres >no way to tell weather or not the OP was trying to take an easy way out >by just getting answers and running. I think it is a pretty safe bet that when the poster does not post what he has tried so far, that it is a lazy, ah, student. If it is not a lazy, ah, student, then that person still should post sufficient detail for the case at hand.
Sincerely,
Gene Wirchenko
Computerese Irregular Verb Conjugation: I have preferences. You have biases. He/She has prejudices.
Michael Hartley - 25 Oct 2004 07:12 GMT > >> what will happen to the foreign key constraint, according to the sql > >> standard, when I issue the following commands : [snip]
> >[Some people ay this looks liek a home work question, though it first > >struck me as question of curiosity, as not everyone at home has access > >to an Oracle database. Sorry if I'm wrong.]
> Given the way the question is phrased, it's almost certainly homework > as it uses a format popular with teachers/lecturers/etc: [quoted text clipped - 7 lines] > > Lemming Thanks to all those who replied, even to those who assumed it was a homework question, but especially to Alfred. In fact, I am an instructor, only recently assigned to teach databases, and I posted the question for the benefit of a student who was asking me that question. I did not put the question into a homework assignment! I don't know the answer myself.
As for the comments that it uses a format popular with lecturers, I have to say "of course". What else do you expect from a lecturer?
As for the comments suggesting I try it myself - I am not interested so much in what a particular DBMS implements, since many don't follow the standard. In fact, I told the student "you can try it yourself" but cautioned that this would only illustrate the behaviour of a particular DBMS, not the behaviour (if any) specified by the standard.
As for the comments that the person asking the question must be lazy not to have tried to find the answer elsewhere - true. I didn't want to spend half an hour wading through piles of sql technical documentation when a quick query to google groups should unearth a helpful person who can give the answer from memory in two minutes.
As for the suggestion to "provide your professor's email address", well, I don't have a professor. My student's "professor", that is yours truly, is an associate professor. My email address may be found from the University's website. Look up : University Nottingham Malaysia along with my name on google.
Now will someone please answer the question?
Yours, Mike H...
Robert Klemme - 25 Oct 2004 09:46 GMT > > >> what will happen to the foreign key constraint, according to the sql > > >> standard, when I issue the following commands : [quoted text clipped - 48 lines] > > Yours, Mike H... Well, you're even *paid* to know these issues and for a teacher of database classes it's certainly a good thing to have a copy of the standard at hand. I'm sure you can even buy a PDF version which you can easily search through. I personally can't answer this from memory in two minutes but I think you could try a bit harder.
Kind regards
robert
Alfred Z. Newmane - 26 Oct 2004 10:04 GMT > Well, you're even *paid* to know these issues and for a teacher of > database classes it's certainly a good thing to have a copy of the [quoted text clipped - 5 lines] > > robert While finding outside sources and knowing how to do just that is a good skill to have, it still may be of great benefit to post answers here, as it may also help others who will later search the archives, as a topic must have some decent coverage before it really becomes easily searchable. The biggest mistake I see a lot of people make is assuming a given topic has been covered suffiently in the past and that one may /always/ find the answer else where. This is not always the case, and the more a topic is covered in a news groups, the great the chance for a successful search in the future, a la Google Groups, among others.
Good night.
--CELKO-- - 19 Oct 2004 03:24 GMT >> what will happen to the foreign key constraint, according to the SQL standard, when I issue the following commands :<<
You get an error message about your DDL.
|
|
|