Not sure if this is the right place to put this message but, I am creating a stock control system for pc componenets, and need some help normalising the data, so that i can then implement the database.
The attibutes which need normalising are:
ProductID
Component
Price
Stock_level
Minimum_level
Reorder_amount
SupplierID
Supplier_name
Address1
Address2
Address3
Postcode
County
Email
TelNo
OrderCode
Quantity
Date_of_Order
Price
Quantity
Date
Total
If anybody could show me how to normalise this to third normal form, and show first and second Normal form, i would be very grateful.Hello,
is this a kind of homework ?
Think about the objects in the table ... there are
products, suppliers, addresses, orders ... these are the main objects.
Therefore you need a product, supplierer, address and order table.
The question is the relations between each object ??
Are there many prices for one product ??
Are there many adresses for one supplier and so on and so on
The other question ist ... what do you want with the second normal form ? Never heard, that somebody use this to create a physical database model ?!?!?!!?
Regards
Manfred Peter
(Alligator Company GmbH)
http://www.alligatorsql.comsql
Showing posts with label creating. Show all posts
Showing posts with label creating. Show all posts
Monday, March 26, 2012
Normalisation Help
Labels:
componenets,
control,
creating,
database,
message,
microsoft,
mysql,
normalisation,
normalising,
oracle,
server,
sql,
stock,
system
Monday, March 19, 2012
Nonclustered Index
Creating a nonclustered index on a large table that
is currently being updated.
Questions:
1. What will happen to the updates?
2. Will SQL Server use the new index after creation
while the system is still running?
Any advice will be greatly appreciated.
Thanks!!!
fragbFrom memory, creating a clustered index requires an exclusive lock on the table. As soon as that is
acquired, the other operations will be blocked during the duration of the index creation. Yes, the
index will be used (when the optimize find it useful) after creation, no re-start is necessary.
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as ugroup=microsoft.public.sqlserver
"fragb" <fmagbulos@.yahoo.com> wrote in message news:f61601c38304$44ea27d0$a601280a@.phx.gbl...
> Creating a nonclustered index on a large table that
> is currently being updated.
> Questions:
> 1. What will happen to the updates?
> 2. Will SQL Server use the new index after creation
> while the system is still running?
> Any advice will be greatly appreciated.
> Thanks!!!
> fragb|||Hi,
Before the Query Optimizer uses an index, the Query
Optimizer evaluates the index to see if it is selective
enough.
A query is considered highly selective if it returns a
very limited number of rows. A query is considered to have
low selectivity if it returns a high percentage of rows.
Thanx.|||To add to Tibor's response: the same is also true for nonclustered
indexes.
Gert-Jan
fragb wrote:
> Creating a nonclustered index on a large table that
> is currently being updated.
> Questions:
> 1. What will happen to the updates?
> 2. Will SQL Server use the new index after creation
> while the system is still running?
> Any advice will be greatly appreciated.
> Thanks!!!
> fragb
is currently being updated.
Questions:
1. What will happen to the updates?
2. Will SQL Server use the new index after creation
while the system is still running?
Any advice will be greatly appreciated.
Thanks!!!
fragbFrom memory, creating a clustered index requires an exclusive lock on the table. As soon as that is
acquired, the other operations will be blocked during the duration of the index creation. Yes, the
index will be used (when the optimize find it useful) after creation, no re-start is necessary.
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as ugroup=microsoft.public.sqlserver
"fragb" <fmagbulos@.yahoo.com> wrote in message news:f61601c38304$44ea27d0$a601280a@.phx.gbl...
> Creating a nonclustered index on a large table that
> is currently being updated.
> Questions:
> 1. What will happen to the updates?
> 2. Will SQL Server use the new index after creation
> while the system is still running?
> Any advice will be greatly appreciated.
> Thanks!!!
> fragb|||Hi,
Before the Query Optimizer uses an index, the Query
Optimizer evaluates the index to see if it is selective
enough.
A query is considered highly selective if it returns a
very limited number of rows. A query is considered to have
low selectivity if it returns a high percentage of rows.
Thanx.|||To add to Tibor's response: the same is also true for nonclustered
indexes.
Gert-Jan
fragb wrote:
> Creating a nonclustered index on a large table that
> is currently being updated.
> Questions:
> 1. What will happen to the updates?
> 2. Will SQL Server use the new index after creation
> while the system is still running?
> Any advice will be greatly appreciated.
> Thanks!!!
> fragb
Saturday, February 25, 2012
nocheck when creating a constraint
i was looking at a database creation script and i have a bunch of
constraints being created with a nocheck on them. i think i know what
the nocheck does (don't check for data issues). i'm not sure why the
original coder would define them like this since there is no data to
begin with when the tables are built. am i missing something? does
this hurt the database table?
ALTER TABLE [dbo].[mytable] WITH NOCHECK ADD
CONSTRAINT [PK_mytable] PRIMARY KEY ([mytable_id]) ON [PRIMARY]That seems to be a stupid thing to do. You won't gain anything, and possibly just have a non-trusted
constraint which can lead to worse performance (non-trusted will limit some of the optimizations
that can be done).
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Derek" <gepetto_2000@.yahoo.com> wrote in message
news:1178199834.825140.114810@.y5g2000hsa.googlegroups.com...
> i was looking at a database creation script and i have a bunch of
> constraints being created with a nocheck on them. i think i know what
> the nocheck does (don't check for data issues). i'm not sure why the
> original coder would define them like this since there is no data to
> begin with when the tables are built. am i missing something? does
> this hurt the database table?
>
> ALTER TABLE [dbo].[mytable] WITH NOCHECK ADD
> CONSTRAINT [PK_mytable] PRIMARY KEY ([mytable_id]) ON [PRIMARY]
>|||Derek,
See this blog from SQL Server MVP Hugo Kornelis.
Can you trust your constraints?
http://sqlblog.com/blogs/hugo_kornelis/archive/2007/03/29/can-you-trust-your-constraints.aspx
AMB
"Derek" wrote:
> i was looking at a database creation script and i have a bunch of
> constraints being created with a nocheck on them. i think i know what
> the nocheck does (don't check for data issues). i'm not sure why the
> original coder would define them like this since there is no data to
> begin with when the tables are built. am i missing something? does
> this hurt the database table?
>
> ALTER TABLE [dbo].[mytable] WITH NOCHECK ADD
> CONSTRAINT [PK_mytable] PRIMARY KEY ([mytable_id]) ON [PRIMARY]
>
constraints being created with a nocheck on them. i think i know what
the nocheck does (don't check for data issues). i'm not sure why the
original coder would define them like this since there is no data to
begin with when the tables are built. am i missing something? does
this hurt the database table?
ALTER TABLE [dbo].[mytable] WITH NOCHECK ADD
CONSTRAINT [PK_mytable] PRIMARY KEY ([mytable_id]) ON [PRIMARY]That seems to be a stupid thing to do. You won't gain anything, and possibly just have a non-trusted
constraint which can lead to worse performance (non-trusted will limit some of the optimizations
that can be done).
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Derek" <gepetto_2000@.yahoo.com> wrote in message
news:1178199834.825140.114810@.y5g2000hsa.googlegroups.com...
> i was looking at a database creation script and i have a bunch of
> constraints being created with a nocheck on them. i think i know what
> the nocheck does (don't check for data issues). i'm not sure why the
> original coder would define them like this since there is no data to
> begin with when the tables are built. am i missing something? does
> this hurt the database table?
>
> ALTER TABLE [dbo].[mytable] WITH NOCHECK ADD
> CONSTRAINT [PK_mytable] PRIMARY KEY ([mytable_id]) ON [PRIMARY]
>|||Derek,
See this blog from SQL Server MVP Hugo Kornelis.
Can you trust your constraints?
http://sqlblog.com/blogs/hugo_kornelis/archive/2007/03/29/can-you-trust-your-constraints.aspx
AMB
"Derek" wrote:
> i was looking at a database creation script and i have a bunch of
> constraints being created with a nocheck on them. i think i know what
> the nocheck does (don't check for data issues). i'm not sure why the
> original coder would define them like this since there is no data to
> begin with when the tables are built. am i missing something? does
> this hurt the database table?
>
> ALTER TABLE [dbo].[mytable] WITH NOCHECK ADD
> CONSTRAINT [PK_mytable] PRIMARY KEY ([mytable_id]) ON [PRIMARY]
>
nocheck when creating a constraint
i was looking at a database creation script and i have a bunch of
constraints being created with a nocheck on them. i think i know what
the nocheck does (don't check for data issues). i'm not sure why the
original coder would define them like this since there is no data to
begin with when the tables are built. am i missing something? does
this hurt the database table?
ALTER TABLE [dbo].[mytable] WITH NOCHECK ADD
CONSTRAINT [PK_mytable] PRIMARY KEY ([mytable_id]) ON [PRIMAR
Y]That seems to be a stupid thing to do. You won't gain anything, and possibly
just have a non-trusted
constraint which can lead to worse performance (non-trusted will limit some
of the optimizations
that can be done).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Derek" <gepetto_2000@.yahoo.com> wrote in message
news:1178199834.825140.114810@.y5g2000hsa.googlegroups.com...
> i was looking at a database creation script and i have a bunch of
> constraints being created with a nocheck on them. i think i know what
> the nocheck does (don't check for data issues). i'm not sure why the
> original coder would define them like this since there is no data to
> begin with when the tables are built. am i missing something? does
> this hurt the database table?
>
> ALTER TABLE [dbo].[mytable] WITH NOCHECK ADD
> CONSTRAINT [PK_mytable] PRIMARY KEY ([mytable_id]) ON [P
RIMARY]
>|||Derek,
See this blog from SQL Server MVP Hugo Kornelis.
Can you trust your constraints?
http://sqlblog.com/blogs/hugo_korne.../>
raints.aspx
AMB
"Derek" wrote:
> i was looking at a database creation script and i have a bunch of
> constraints being created with a nocheck on them. i think i know what
> the nocheck does (don't check for data issues). i'm not sure why the
> original coder would define them like this since there is no data to
> begin with when the tables are built. am i missing something? does
> this hurt the database table?
>
> ALTER TABLE [dbo].[mytable] WITH NOCHECK ADD
> CONSTRAINT [PK_mytable] PRIMARY KEY ([mytable_id]) ON [
PRIMARY]
>
constraints being created with a nocheck on them. i think i know what
the nocheck does (don't check for data issues). i'm not sure why the
original coder would define them like this since there is no data to
begin with when the tables are built. am i missing something? does
this hurt the database table?
ALTER TABLE [dbo].[mytable] WITH NOCHECK ADD
CONSTRAINT [PK_mytable] PRIMARY KEY ([mytable_id]) ON [PRIMAR
Y]That seems to be a stupid thing to do. You won't gain anything, and possibly
just have a non-trusted
constraint which can lead to worse performance (non-trusted will limit some
of the optimizations
that can be done).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Derek" <gepetto_2000@.yahoo.com> wrote in message
news:1178199834.825140.114810@.y5g2000hsa.googlegroups.com...
> i was looking at a database creation script and i have a bunch of
> constraints being created with a nocheck on them. i think i know what
> the nocheck does (don't check for data issues). i'm not sure why the
> original coder would define them like this since there is no data to
> begin with when the tables are built. am i missing something? does
> this hurt the database table?
>
> ALTER TABLE [dbo].[mytable] WITH NOCHECK ADD
> CONSTRAINT [PK_mytable] PRIMARY KEY ([mytable_id]) ON [P
RIMARY]
>|||Derek,
See this blog from SQL Server MVP Hugo Kornelis.
Can you trust your constraints?
http://sqlblog.com/blogs/hugo_korne.../>
raints.aspx
AMB
"Derek" wrote:
> i was looking at a database creation script and i have a bunch of
> constraints being created with a nocheck on them. i think i know what
> the nocheck does (don't check for data issues). i'm not sure why the
> original coder would define them like this since there is no data to
> begin with when the tables are built. am i missing something? does
> this hurt the database table?
>
> ALTER TABLE [dbo].[mytable] WITH NOCHECK ADD
> CONSTRAINT [PK_mytable] PRIMARY KEY ([mytable_id]) ON [
PRIMARY]
>
Subscribe to:
Posts (Atom)