3 ms·
Try this quiz. It's based on a quiz I saw posted on HN a while back. http://sqlfiddle.com/#!3/3973f/1 http://sqlfiddle.com/#!3/3973f/1 Edit: I'm not allowed t
by buckbova 13y ago
Try this quiz. It's based on a quiz I saw posted on HN a while back.
http://sqlfiddle.com/#!3/3973f/1 http://sqlfiddle.com/#!3/3973f/1
Edit:
I'm not allowed to reply just yet, so I'll post here.
You need to add the boss first to the employee table with a NULL bossID.
Then you add another employee that has a bossID that refers to that last added record.
- jsmeaton 13y agoAww - no test data? And when trying to add test data, I get errors due to the self-referencing foreign key. Perhaps the schema could do with a > DEFAULT (IDENT_CURRENT('dbo.Employees')) on the BossID column. Been awhile (years) since I've worked with SQL Server.