Showing posts with label iam. Show all posts
Showing posts with label iam. Show all posts

Monday, March 19, 2012

Doubt in Index

Hi EverB,

I have created a table say T1 with 5 columns (col1.....col5).
I have created an index on col4 and col5.

iam executing a select query say.

select col1,col2,col3 from t1 where col1 =0;

In the above query i hav not used the columns for which i hav created the index.My ques is-

Does the index really works when u execute the above query?

Any answer please.......
It wuld be better if u culd suggest some sites for this.

Thanks and Regds,
Arunno, for that query, the index is ignored

a good tutorial is Optimizing your MySQL Application (http://www.sitepoint.com/print/optimizing-mysql-application) even if you're using something other than mysql

Sunday, February 26, 2012

don't allow duplicates problem

I have MSDE with the server tools from sql server 2000 enterprise edition. I
am having a problem with one of my tables. The table is set up with two
fields Class and Student. I want there to be only one student of the same
name in each class. If i use the primary key it will just allow only one
student of the same name in the entire table and wouldn't look at the class
that the student is taking. Is there an easy way around this?
I found a solution, I created a dual primary key. I highlighted both items
and then turned on the primary key and it does exactly what I wanted it to
except the maximum size is 900bytes for a primary key so I had to adjust the
length of the fields a bit.
"Benjamin" wrote:

> I have MSDE with the server tools from sql server 2000 enterprise edition. I
> am having a problem with one of my tables. The table is set up with two
> fields Class and Student. I want there to be only one student of the same
> name in each class. If i use the primary key it will just allow only one
> student of the same name in the entire table and wouldn't look at the class
> that the student is taking. Is there an easy way around this?