Showing posts with label article. Show all posts
Showing posts with label article. Show all posts

Wednesday, March 28, 2012

Normalization Questions

Hai everybody recently i came across this article and i have tried to answer all the follwoing questions. But i am not sure its correct or not..so you peoples can comment on the follwoing questions.

2)

Employee (ssn, Name, Salary, Address, ListOfSkills)

Yes,

No.Ans: No. as list of skills would be repeated.


3)

Department (Did, Dname, ssn)

Yes,

No.Ans: No. ssn and did should be moved to a seperate table.

4)

Vehicle (LicensePlate,Brand,

Model, PurchasePrice, Year, OwnerSSN, OwnerName

Yes,

NoAns: No.

5)

Employee (ssn, Name, Salary, did) (obs.:

employee can only belong to one department)

Yes,

No.Ans: Yes.


6)

Customer (Cust_Id, Name, Salesperson, Region) where Salesperson

determines Region.

Yes,

No.Ans: No.Salesperson and region should be moved to a seperate table.


7)

Component (ItemNo, ComponentNo, ItemName, Quantity) where ItemNo

->ItemName


Yes,

No.Ans: No.As itemname is a subset of itemno and not a subset of both itemno and componentno.

Not homework, right? :)

Hai everybody recently i came across this article and i have tried to answer all the follwoing questions. But i am not sure its correct or not..so you peoples can comment on the follwoing questions.


2) Employee (ssn, Name, Salary, Address, ListOfSkills)

Yes, No. Ans: No. as list of skills would be repeated.

louis: exactly. Any column that is plural likely represents multiple things...

3) Department (Did, Dname, ssn)

Yes, No. Ans: No. ssn and did should be moved to a seperate table.

Louis: Well, Did is fine, but I would expect that ssn violates fourth normal form. If the SSN represents something where there is only one of them (like the manager,) then this is fine. If it represents a member of a department, then you definitely have problems because the department name and members of the department relate differently to the Did key of the Department table.

4) Vehicle (LicensePlate, Brand, Model, PurchasePrice, Year, OwnerSSN, OwnerName

Yes, No Ans: No.

Louis: if you are only allowing a single owner of the vehicle AND you only track the most recent purchase information, then yes. Else no. You always need to consider cardinality between attribute and key.

5) Employee (ssn, Name, Salary, did) (obs.: employee can only belong to one department)

Yes, No. Ans: Yes.

Louis: agree. One employee, one name, one salary, one department, all data corresponds to the employee. That is fine.


6) Customer (Cust_Id, Name, Salesperson, Region) where Salesperson determines Region.

Yes, No. Ans: No.Salesperson and region should be moved to a seperate table.

Louis: Good question. Was this the salesperson of the customer, and the Region of the customer? Or is this the region that the salesperson works, regardless of the location of the customer? That makes a big different.


7) Component (ItemNo, ComponentNo, ItemName, Quantity) where ItemNo -> ItemName

Yes, No. Ans: No.As itemname is a subset of itemno and not a subset of both itemno and componentno.

Louis. No, like you said, this violates second normal form

|||Thanks louis, definetly its not homework. I am very much interested in design, that's why i posted.sql

Friday, March 9, 2012

NON equijoins

Hi there.

I just wanted to see if anyone has come across any patterns to deal with NON equijoins.

Based on this article - http://sqljunkies.com/WebLog/tpagel/archive/2005/08/31/16585.aspx - there seems to be 2 approaches:

1) encapsulate the logic in a stored procedure or

2) generate a joined dataset with potentially alot of unwanted rows which then need to be filtered out.

Are there any other patterns people have discovered?

Thanks.

Hi,

I had the same issue we found the solution ourselves. Look at the third thread in this question

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=367775&SiteID=1

Basically you can modify the sql in Advanced tab. Hope this helps

non domain log shipping

According to KB article 314515 in regards to having log
shipping set up outside of a domain:
Q3: Do I have to start SQL Server related services under a
domain account as opposed to a local Windows NT account?
A3: It is possible to configure SQL Server services to
start under a local Windows NT account, unless SQL Server
is configured to run as a virtual server in conjunction
with Microsoft Cluster Service. You can use Windows NT
pass-through security for this purpose. Follow these steps
to configure pass-through security:
Create a Windows NT account on the primary, secondary and
monitor computers with the same name and passwords.
Configure SQL Server related services to start under these
Windows NT accounts on all computers.
So what if one of the computers is in a domain and one
isnt. The logins are set up like this:
Source
domain\administrator
Destination
local\administrator
Same passwords on both but Im still having problems.What problem are you having?
Rand
This posting is provided "as is" with no warranties and confers no rights.