Showing posts with label everybody. Show all posts
Showing posts with label everybody. 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 23, 2012

Non-static data in head of report

Hi everybody,
I'm quite new to reporting services, respectively I were not able zu work
with them for a while, therefore I forget most of the stuff I knew. Here's
my problem:
We have lots of reports made in Microsoft Access, that we now have to
convert for the use in the reporting services (2000). Basically in all
Access reports we use dynamic data in the page header, like a name from an
employee which comes from the database. This seems to be impossible in the
reporting services. We get an error message when compiling the report.
Does anyone know if this possible or a good workaround? I cannot believe
that this isn't possible, it's essential.
Thx in advance
MichaelWe use something like this:
In the hidden text of the body put this
=Code.GetBaseName( First(Fields!BaseState.Value, "DataSet1"))
In the footer/header text use this.
=Code.GetBaseName(Nothing)
Add this to the code pane
' Functions to provide data fields for report header
' Input:
' a data value
' Output:
' data value for report header
' Purpose:
' Provide data values for the report header
' Save data value in a static local variable
' for the last page header, the input variable will be empty
' so return the saved value
' Note:
' The ReportItems passed in must be at the top of the Body of the report
' so they will be accessible on the first page of the report
' The functions are Shared so theStatic variable will work
' The Static variable will retain its value while the report viewer is open,
' even if the parameter values are modified and the report re-run
' so always save the value except when the current value is not available
' All this is necessary because Reporting Services does not allow data
fields in the page header
' and on a Purchase Order with many details, the second page has no detail
fields
' so the hidden data fields cannot not be put in the detail area
public shared function GetBaseName (byval InputValue as string) as string
static SavedValue as string
if InputValue <> "" then
SavedValue = InputValue
return InputValue
else
return SavedValue
end if
end function
Steve MunLeeuw
"Michael Bender" <technik@.salescom.de> wrote in message
news:ecmd6i$c5b$01$1@.news.t-online.com...
> Hi everybody,
> I'm quite new to reporting services, respectively I were not able zu work
> with them for a while, therefore I forget most of the stuff I knew. Here's
> my problem:
> We have lots of reports made in Microsoft Access, that we now have to
> convert for the use in the reporting services (2000). Basically in all
> Access reports we use dynamic data in the page header, like a name from an
> employee which comes from the database. This seems to be impossible in the
> reporting services. We get an error message when compiling the report.
> Does anyone know if this possible or a good workaround? I cannot believe
> that this isn't possible, it's essential.
> Thx in advance
> Michael
>|||Thanks very much, Steve.
"Steve MunLeeuw" <smunson@.clearwire.net> schrieb im Newsbeitrag
news:eDqZMIHyGHA.1936@.TK2MSFTNGP06.phx.gbl...
> We use something like this:
> In the hidden text of the body put this
> =Code.GetBaseName( First(Fields!BaseState.Value, "DataSet1"))
> In the footer/header text use this.
> =Code.GetBaseName(Nothing)
> Add this to the code pane
> ' Functions to provide data fields for report header
> ' Input:
> ' a data value
> ' Output:
> ' data value for report header
> ' Purpose:
> ' Provide data values for the report header
> ' Save data value in a static local variable
> ' for the last page header, the input variable will be empty
> ' so return the saved value
> ' Note:
> ' The ReportItems passed in must be at the top of the Body of the report
> ' so they will be accessible on the first page of the report
> ' The functions are Shared so theStatic variable will work
> ' The Static variable will retain its value while the report viewer is
> open,
> ' even if the parameter values are modified and the report re-run
> ' so always save the value except when the current value is not available
> ' All this is necessary because Reporting Services does not allow data
> fields in the page header
> ' and on a Purchase Order with many details, the second page has no detail
> fields
> ' so the hidden data fields cannot not be put in the detail area
> public shared function GetBaseName (byval InputValue as string) as string
> static SavedValue as string
> if InputValue <> "" then
> SavedValue = InputValue
> return InputValue
> else
> return SavedValue
> end if
> end function
>
> Steve MunLeeuw
> "Michael Bender" <technik@.salescom.de> wrote in message
> news:ecmd6i$c5b$01$1@.news.t-online.com...
>> Hi everybody,
>> I'm quite new to reporting services, respectively I were not able zu work
>> with them for a while, therefore I forget most of the stuff I knew.
>> Here's my problem:
>> We have lots of reports made in Microsoft Access, that we now have to
>> convert for the use in the reporting services (2000). Basically in all
>> Access reports we use dynamic data in the page header, like a name from
>> an employee which comes from the database. This seems to be impossible in
>> the reporting services. We get an error message when compiling the
>> report.
>> Does anyone know if this possible or a good workaround? I cannot believe
>> that this isn't possible, it's essential.
>> Thx in advance
>> Michael
>