472,777 Members | 2,596 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,777 software developers and data experts.

Indexes and views

Hi!
1-I read in MS Access help that Indexes are automatically made when we
declare a primary key and they are used for fast searching and sorting
purpose. But i am still confused that how can i use Indexes,where i can
see the in my table? and if i want to make my own indexes, should i use
nique attribute column such as vehicle registration number etc?
2-Another thing i wanna ask is; in MS access when we make a query, Is
it a view also?
What is the difference between query and view in MS access.
I wrote 4 queries and they are stored and whenever i want, i can use
these queries(can we say them views also?).
3-Another confusion is about mapping derived attributes such as
GST(general sales tax) which is a fixed value in MS Acces table.Is it a
good approach to use derived attributes in access?Is it allowed? What
are the alternatives? Should i use such values directly in Query?
I need the urgent response from you guys.
Thank you
Umair Cheema

Sep 22 '06 #1
2 2540
<um**********@gmail.comwrote in message
news:11**********************@d34g2000cwd.googlegr oups.com...
Hi!
1-I read in MS Access help that Indexes are automatically made when we
declare a primary key and they are used for fast searching and sorting
purpose. But i am still confused that how can i use Indexes,where i can
see the in my table?
You can see the indexes used when you bring up the table in design view.
While in table design view, from the menu go

View->indexes

(if the indexes form is already displayed, then the above will actually
"hide" the index form).
and if i want to make my own indexes, should i use
nique attribute column such as vehicle registration number etc?
Well, using a unique attribute column is totally YOUR CHOICE. I mean, if you
want to increase search speed for a persons last name, the setting the index
to unique don't make much sense, as then the database would not allow more
then one person with the same last name? So, should you use unique?...well,
that is entirely up to you, and will be a case by case answer. There is no
"one" answer to this, but only use the appropriate index for what you need.
So, you can have several indexes on a table, and we often do. For generate
one-to-many relationships, we would not use the vehicle registration number,
but likely use a autonumber field (we do this, because we want our
relationships in eh database to continue to function and work EVEN WHEN you
don't have a vehicle registration number.).
2-Another thing i wanna ask is; in MS access when we make a query, Is
it a view also?
In database terminology, yes, you can consider a "select query" a view.
However, since we can also store update queries, and delete queries, and
append queers, then we don't call ALL SAVED QUIRES a view. But, for all
discussion purposes, you can call a save query that is a SELECT QUERY is the
same idea as a view. As mentioned, since in ms-access we can save ADDITIONAL
types of quires in the query builder, we don't call them views. So, sure,
you can most certainly think of a select query as a view.
What is the difference between query and view in MS access.
Well, as mentioned, none if you save a select query..but, since "other"
types of quires can be saved, then logic dictates that

all saved select quires are views
but
not all saved queries are select queries,
Therefore, all quires are not a view!!
I wrote 4 queries and they are stored and whenever i want, i can use
these queries(can we say them views also?).
Yes, you can use a query in virtually ANY place that you would have
previously used a table name. So, reports, forms, combo boxes etc can use
that "view" or what we called saved query in ms-access. For the most part,
you likely should use the term saved query when talking to ms-access people.
The term "view" is usually used when taking about oracle, or sql-server.
3-Another confusion is about mapping derived attributes such as
GST(general sales tax) which is a fixed value in MS Acces table.Is it a
good approach to use derived attributes in access?Is it allowed? What
are the alternatives? Should i use such values directly in Query?
It really is your choice. In most of my access applications, I have a table
like

GstSTartDate GstRate
01/01/1991 7.00
07/01/2006 6.00

That above thus allows me to fetch the correct gst rate based on today's
date, or perhaps the invoice date.

Start-up code then sets a global variable that can be used in forms, or even
sql

Set gblRstGstRates = CurrentDb.OpenRecordset("select * from tblGstRates
order by Gdate DESC")

gblRstGstRates.FindFirst "[Gdate] <= " & qudate(Date)
gblGstRate = gblRstGstRates!GstRate / 100
And, then I have sql querys, and forms

Public Function fGst() As Currency

fGst = gblGstRate

End Function
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com
Sep 22 '06 #2

Thank You it really helped me a lot.

Sep 22 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Igor | last post by:
Is there a way to force optimizer to use indexes without hints? (some server setting or index type...) I'll give an example to clarify : I have a table with fields Customer_Code char(10) not...
2
by: Demetris | last post by:
Hello! Is there a way to find out, using an SQL statement, which tables in a DB2 database have no indexes created on them? My environment is DB2 UDB V7.2 Fixpak 6 on AIX 4.3.3 Thank you
10
by: Troels Arvin | last post by:
Hello, At http://en.wikipedia.org/wiki/Comparison_of_relational_database_management_systems it's stated that DB2 doesn't have bitmap indexes. This seemed strange to me, so I tried looking in...
5
by: UnixSlaxer | last post by:
Hello, Is there any other way to determine the size of the current indexes and materialized views for a certain database than running DB2-Control-Center, selecting the database, and checking the...
2
by: UnixSlaxer | last post by:
Hello, I am using DB2-UDB 8.2, when running the design advisor, It exists tells me that "catalog simulation requires that the server be at level V8.0 or newer", although the DB2 version is 8.2...
5
by: bughunter | last post by:
For example - very large table with a lot indexes and updates work very slow. I'd like found unused or rarely used indexes. How? Yes, for static I found all sql in packages and, after analyse,...
14
by: Jeff | last post by:
This is the first time that I remember ever having too many indexes on a table, but it has happened. I have en employees table and store in many places, on tables, the id of the employee that...
10
by: lesperancer | last post by:
you start with a small application in access97, then you have more modules and more... and you reach the point where tables like 'item' and 'employee' reach the limit and you know there's more...
22
by: Zamdrist | last post by:
I am tasked with maintaining a large database still on SQL Server 7.0. Performance is an issue not surprisingly and I've targeted two rather large tables to see what I can do with the indexes. ...
0
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.