Showing posts with label figure. Show all posts
Showing posts with label figure. Show all posts

Friday, February 17, 2012

Database Logic

I am trying to figure out how to set up this database.

Basically, there are products with their associated fields. Each product can belong to multiple categories, and each category also has subcategories.
So far I have the following, but not sure if this is the best way to set it up...
TABLE Products:
product_id (int)(1-many relationship to product_id in Table Product_Category)
sku (int)
description
price

TABLE Category
category_id (int)(1-many relationship to category_id in Table Product_Category)
name

TABLE SubCategory
subcategory_id (int)(1-many relationship to subcategory_id in Table Product_Category)
category_id (int)
name

TABLE Product_Category
prodcat_id (int)
product_id (int)(many-1 relationship to product_id in Table Products)
category_id (int)(many-1 relationship to category_id in Table Category)
subcategory_id (int)(many-1 relationship to subcategory_id in Table SubCategory)

Thanks,
Mick

TABLE Products:
product_id (int)(1-many relationship to product_id in Table Product_Category)
sku (int)
description
price

TABLE Categories
category_id (int)(1-many relationship to category_id in Table Product_Category)
parent (int) (1-1 relationship with Category)
name

TABLE Product_Categories
prodcat_id (int)
product_id (int)(many-1 relationship to product_id in Table Products)
category_id (int)(many-1 relationship to category_id in Table Category)

Categories table would look like:

1,0,furnature

2,1,chairs

3,1,tables

4,0,automobiles

5,4,pickups

6,4,minivans

You can then also (If you need/want)

7,6,buick

Which would then be Category automobiles, Sub-Category minivans, Sub-Sub-Category buick

Tuesday, February 14, 2012

Database last accessed

Hello All,
Is there a way to figure out/track when was the last time/date a
particular database was accessed by users? I am trying to determine
which databases haven't been used/accessed by users in a while so I can
find out if they are still needed or not. My environment is SQL 2000
SP3 with Windows 2000 as the OS. Any help will be appreciated.
Thanks,
Raziq.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!Hi,
First option will be enable Profiler , otherwise write triggers to identify
the last accessed database.
Thanks
Hari
MCDBA
"Raziq Shekha" <raziq_shekha@.anadarko.com> wrote in message
news:eiZlyPr2DHA.1700@.TK2MSFTNGP12.phx.gbl...
> Hello All,
> Is there a way to figure out/track when was the last time/date a
> particular database was accessed by users? I am trying to determine
> which databases haven't been used/accessed by users in a while so I can
> find out if they are still needed or not. My environment is SQL 2000
> SP3 with Windows 2000 as the OS. Any help will be appreciated.
> Thanks,
> Raziq.
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!

Database last accessed

Hello All,
Is there a way to figure out/track when was the last time/date a
particular database was accessed by users? I am trying to determine
which databases haven't been used/accessed by users in a while so I can
find out if they are still needed or not. My environment is SQL 2000
SP3 with Windows 2000 as the OS. Any help will be appreciated.
Thanks,
Raziq.
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!Hi,
First option will be enable Profiler , otherwise write triggers to identify
the last accessed database.
Thanks
Hari
MCDBA
"Raziq Shekha" <raziq_shekha@.anadarko.com> wrote in message
news:eiZlyPr2DHA.1700@.TK2MSFTNGP12.phx.gbl...
quote:

> Hello All,
> Is there a way to figure out/track when was the last time/date a
> particular database was accessed by users? I am trying to determine
> which databases haven't been used/accessed by users in a while so I can
> find out if they are still needed or not. My environment is SQL 2000
> SP3 with Windows 2000 as the OS. Any help will be appreciated.
> Thanks,
> Raziq.
>
> *** Sent via Developersdex http://www.examnotes.net ***
> Don't just participate in USENET...get rewarded for it!
|||I'll have to run profiler for quite some time to see if anyone is using
that database or not. Isn't there a systable/sysdatabase where this
information is recorded?
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!|||are you saying where the data collected by profiler is stored? When you run
profiler you can tell it where to save the data, or you can run and save
later.
"Raziq Shekha" <raziq_shekha@.anadarko.com> wrote in message
news:uvPkRRs2DHA.3416@.tk2msftngp13.phx.gbl...
quote:

> I'll have to run profiler for quite some time to see if anyone is using
> that database or not. Isn't there a systable/sysdatabase where this
> information is recorded?
>
> *** Sent via Developersdex http://www.examnotes.net ***
> Don't just participate in USENET...get rewarded for it!
|||No, what I am saying is that won't I have to keep the profiler running
for a few days to see if anyone had connected to a particular database?
What I am trying to find is a way to figure out when was the last time
someone had accessed this database. It could have been couple of months
ago that someone may have accessed it. It could have been last week,
and they may not access it again for another week. As far as the
profiler is concerned, I'll have to keep it running for a couple of
weeks to see if anyone logged on to a particular database while the
profiler was running. I hope this clarifies what I am trying to do.
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!