My Boss Beats Me

May 22, 2006

I thought I'm pretty good with sql. Was presented with a little
challenge the other day, a colleague asked me to create a parent to
child relationship for a table without changing db schema. The table
looks like this
pkID parentID altPKfield
1 null abc
2 1 def

It's obvious parent to child relationship via pkID and parentID columns
would do a perfect job, however, he specifically asked not to use pkID
but altPKfield instead.

My first thought was to create a sort of 'ghost column' for 'alt parent
field', then, it goes like using a UDF to get pkID value, use temp
table or table variable, it worked but took quite a bit of time.

The next day, the colleague told me our boss has another solution, that
is, he joins this same table twice to geneate a fourth column of
another pkID, and it works perfect and it's very elegant compared to my
approach.

Question here is, would you know/use his approach without learning this
techque? Second question is, would there be any downside on using
this alternative approach of creating a parent to child relationship
for the same table not using PK column?


Thanks.

View 6 Replies


ADVERTISEMENT

Using Employee/Boss Self Referencing Table

Feb 28, 2008

I have an Employee table that has
EmployeeID (PK)
SupervisorID (which is really just another EmployeeID)
..random junk...


Now that part makes sense, everyone gets one and only one boss.

Their boss can change, and therefore the SupervisorID would be updated.

Now I have an EmployeeEvals table that has quarterly evaluation data.

I want to relate these two tables.

Eval table has
EvalID (PK)
ReviewedEmployeeID (the one being evaluated)
SupervisorID (the one doing the evaluation)

Now I need to link this back to the employee table (at least I think I do).

So I would want to relate it by the ReviewedEmployeeID going back to EmployeeID in the employee table and I also want the SupervisorID to do the same...

But of course that won't work because that would seem to indicate that a single record on the Employees table (say EmployeeID 55) should have a matching (or could) record in the Eval table that would look like
EvalID: 12345
ReviewedEmployeeID: 55
SupervisorID: 55

which of course wouldn't happen as an employee wouldn't evaluate themself.

How do I handle the relationships for this properly?

Do I just not link the SupervisorID back to anything?

View 2 Replies View Related

It Proclaims Of The Commandant In Boss Fidel Castro To The Town Of Cuba.

Aug 1, 2006

With reason of the enormous effort carried out to visit the Argentineancity of Córdoba, to participate in the Meeting of MERCOSUR, in theclosing of the Summit of the Towns in the historical University ofCórdoba and in the visit to Altagracia, the city where Che lived inits childhood and together to this to attend immediately thecommemoration of the 53 anniversary from the assault to the barracksMoncada and Carlos Manuel of Grasses, July 26, 1953 in the counties ofGranma and Holguín, days and nights of continuous work withoutsleeping hardly gave place that my health that has resisted all thetests, underwent to an extreme stress and it was smashed.This provoked me an intestinal sharp crisis with sustained spill ofblood that forced me to face a surgical complicated operation. All thedetails of this accident of health consist in the x-rays, endoscopiesand filmed materials. The operation forces me to remain several weeksof rest, far from my responsibilities and positions.As our country it is threatened in circumstances like this by theGovernment from the United States, I have made the following decision:1) I delegate with provisional character my functions as FirstSecretary of the Central Committee of Communist Party of Cuba in theSecond Secretary, partner Raúl Castro Ruz.2) I delegate with provisional character my functions as Major in Bossof the Revolutionary heroic Armed Forces in the mentioned partner,General of Army Raúl Castro Ruz.3) I delegate with provisional character my functions as President ofthe Council of State and of the Government of the Republic of Cuba inthe First Vice-president, partner Raúl Castro Ruz.4) I delegate with provisional character my functions as maininstigator of the National and International Program of Public Healthin the Member of the Political Desk and Secretary of Public Health,partner José Ramón Balaguer Goatherd.5) I delegate with provisional character my functions as maininstigator of the National and International Program of Education inthe partners José Ramón Machado Ventura and Esteban Lazo Hernández,Members of the Political Desk.6) I delegate with provisional character my functions as maininstigator of the National Program of the Energy Revolution in Cuba andof collaboration with other countries in this environment in thepartner Carlos Lage Dávila, Member of the Political Desk and Secretaryof the Executive Committee of the Council of Secretaries.The corresponding funds for these three programs, Health, Education andEnergy, they will continue being negotiated and prioritized, like Ihave come making it personally, for the partners Carlos Lage Dávila,Secretary of the Executive Committee of the Council of Secretaries,Francisco Soberón Valdés, Secretary President of the Central Bank ofCuba, and Felipe Pérez Roque, Secretary of External Relationships whothey accompanied me in these managements and they will constitute acommission for that objective.Our Communist glorious Party, supported by the organizations of massesand the whole town, has the mission of assuming the task commended inthis it Proclaims.The meeting Summit of the Movement of Not Aligned Countries, to becarried out among the days 11 and 16 of September, will receive thebiggest attention in the State and the Cuban Nation to take place withthe maximum of brightness in the agreed date.The 80 anniversary of my birthday that so generously thousands ofpersonalities agreed to celebrate the next one August 13, I request toall to postpone it for December 2 of the present year, on the 50anniversary of the Landing of Granma.I request to the Central Committee of Party and the National Assemblyof the Popular Power the firmest support to this it Proclaims.I don't house the smallest doubt that our town and our Revolution willfight until the last drop of blood to defend these and other ideas andmeasures that are necessary to safeguard this historical process.The imperialism will never be able to squash Cuba.The Battle of Ideas will continue ahead.Alive the Homeland!Alive the Revolution!Alive the Socialism!Until Victoria Always!Fidel Castro RuzMajor in Boss First Secretary of Party and President of the StateAdviceAnd of Secretaries of the Republic of Cuba. July 31, 2006 6:22 p.m

View 1 Replies View Related

RAID 5 Beats RAID 10

May 1, 2006

RAID 5 beats RAID 10Can I get some feedback on these results? We were having some seriousIO issues according to PerfMon so I really pushed for RAID 10. Theresults are not what I expected.I have 2 identical servers.Hardware:PowerEdge 28502 dual core dual core Xeon 2800 MHz4GB RAMController Cards: Perc4/DC (2 arrays), Perc4e/Di (1 array)PowerVault 220SEach Array consisted of 6-300 GB drives.Server 1 = Raid 103, 6-disk arraysServer 2 = Raid 5 (~838 GB each)3, 6-disk arrays (~1360 GB each)TestWinner% FasterSQL Server - UpdateRAID 513Heavy ETLRAID 516SQLIO - Rand WriteRAID 1040SQLIO - Rand ReadRAID 1030SQLIO - Seq WriteRAID 515SQLIO - Seq ReadRAID 5MixedDisktt - Seq WriteRAID 518Disktt - Seq ReadRAID 52000Disktt - Rand ReadRAID 562Pass Mark - mixedRAID 10VariesPass Mark -Simulate SQL ServerRAID 51%I have much more detail than this if anyone is interested.

View 13 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved