Click here to Skip to main content
15,889,992 members
Home / Discussions / Database
   

Database

 
QuestionSql_Index Pin
Member 1116162527-Dec-15 19:34
Member 1116162527-Dec-15 19:34 
AnswerRe: Sql_Index Pin
Mycroft Holmes27-Dec-15 19:38
professionalMycroft Holmes27-Dec-15 19:38 
AnswerRe: Sql_Index Pin
GuyThiebaut29-Dec-15 2:57
professionalGuyThiebaut29-Dec-15 2:57 
QuestionDatabase creation on an external HD Pin
Amr.Mohammad8725-Dec-15 7:22
Amr.Mohammad8725-Dec-15 7:22 
AnswerRe: Database creation on an external HD Pin
Eddy Vluggen28-Dec-15 23:39
professionalEddy Vluggen28-Dec-15 23:39 
QuestionCascading referential integrity. Pin
Member 1116162522-Dec-15 21:03
Member 1116162522-Dec-15 21:03 
QuestionRe: Cascading referential integrity. Pin
CHill6023-Dec-15 23:15
mveCHill6023-Dec-15 23:15 
AnswerRe: Cascading referential integrity. Pin
Eddy Vluggen24-Dec-15 1:25
professionalEddy Vluggen24-Dec-15 1:25 
Member 11161625 wrote:
Is this code is correct???
Syntactic it is correct, but it will do nothing, as you instructed it. That is the default behaviour.

If you want the "leave" days to be removed from the database when the employee is removed from the database, then you'd want a cascading delete. (ON DELETE CASCADE, not "NO ACTION"). That way you can prevent getting "orphaned" records.

If you still need the leave-data from that person and don't want to wipe the records, I'd recommend "ON DELETE SET NULL", since the key would have become invalid - but then the record isn't deleted, just the key is removed - handy if you need the leave-data for statistics or other stuff.

Last, there is also a "SET DEFAULT" option; if a manager is deleted from the database, then you might want to automatically update all affected workers to some default-manager.

Member 11161625 wrote:
Is it will work???
Depends on the specs. Press F5 and see if it does what you expect. Disclaimer; various database-engines may use different keywords and not support them all.
Bastard Programmer from Hell Suspicious | :suss:
If you can't read my code, try converting it here[^]

QuestionUnusual Ways To Make Quick Money Pin
Member 1222215021-Dec-15 20:46
Member 1222215021-Dec-15 20:46 
Questionplsql related issue Pin
Member 1191972221-Dec-15 0:34
Member 1191972221-Dec-15 0:34 
QuestionSubqueries Pin
Member 1116162519-Dec-15 17:13
Member 1116162519-Dec-15 17:13 
AnswerRe: Subqueries Pin
Mycroft Holmes20-Dec-15 11:58
professionalMycroft Holmes20-Dec-15 11:58 
QuestionRe: Subqueries Pin
Richard Andrew x6420-Dec-15 15:02
professionalRichard Andrew x6420-Dec-15 15:02 
AnswerRe: Subqueries Pin
Wonde Tadesse20-Dec-15 15:28
professionalWonde Tadesse20-Dec-15 15:28 
AnswerRe: Subqueries Pin
Mycroft Holmes20-Dec-15 19:15
professionalMycroft Holmes20-Dec-15 19:15 
QuestionSynchronising number of disconnected databases to a central DB. Pin
srinandan..14-Dec-15 17:45
srinandan..14-Dec-15 17:45 
AnswerRe: Synchronising number of disconnected databases to a central DB. Pin
Mycroft Holmes14-Dec-15 18:52
professionalMycroft Holmes14-Dec-15 18:52 
GeneralRe: Synchronising number of disconnected databases to a central DB. Pin
srinandan..14-Dec-15 22:20
srinandan..14-Dec-15 22:20 
GeneralRe: Synchronising number of disconnected databases to a central DB. Pin
Mycroft Holmes15-Dec-15 11:44
professionalMycroft Holmes15-Dec-15 11:44 
GeneralRe: Synchronising number of disconnected databases to a central DB. Pin
Eddy Vluggen15-Dec-15 11:53
professionalEddy Vluggen15-Dec-15 11:53 
QuestionSQL Server deadlocks Pin
Member 1115415113-Dec-15 6:42
Member 1115415113-Dec-15 6:42 
GeneralRe: SQL Server deadlocks Pin
Kornfeld Eliyahu Peter13-Dec-15 7:17
professionalKornfeld Eliyahu Peter13-Dec-15 7:17 
GeneralRe: SQL Server deadlocks Pin
Member 1115415113-Dec-15 19:41
Member 1115415113-Dec-15 19:41 
GeneralRe: SQL Server deadlocks Pin
Kornfeld Eliyahu Peter13-Dec-15 20:23
professionalKornfeld Eliyahu Peter13-Dec-15 20:23 
GeneralRe: SQL Server deadlocks Pin
Member 1115415113-Dec-15 20:36
Member 1115415113-Dec-15 20:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.