196 Part I EXAM PREPARATION TIPFaster Data Access
196 Part I EXAM PREPARATION TIPFaster Data Access If retrieving data seems to take forever, a good idea may be to implement an indexing strategy. Chapter 10 discusses indexes, including index implementation. EXAM This query selects the au_id and au_fname columns from the Authors table residing in the Pubs database. Notice that the column names au_id and au_fname were delimited with a comma. The example was just a basic query, which could have been made much more complex. You may want to filter the data, perhaps to select all authors with first names having the letter P, or only those authors living in California. This example could have even been more basic if you used an asterisk in the column selection sub-statement, which would select all columns from the Authors table. Also, notice that the columns in the resultset, in the lower pane of the analyzer, were organized in the way they were specified in the column select list; that is, au_id was first displayed and then au_fname. Changing Column Headers Part of delivering a sound application in a business environment is development that provides a user-friendly interface for accessing the database. By default, the column headers that are displayed in the resultset are the same as the columns specified in the column select list, such as au_id and au_fname. But why not change this column header to a more understandable title? You can alias a column header without problem and in doing so increase the readability of the data. You can change the name of a resultset column by specifying the keyword AS, this being the traditional SQL-92 ANSI standard. Changing the column name with an equals sign (=) or implied assignment is also an alternative syntax choice. IN THE FIELD SQL-92 SYNTAX SQL-92 ANSI standard coding mechanism is the method of choice when you are presented with syntax alternatives. SQL-92 standards are universally accepted by most SQL data engines. Column names should be changed in cases where they are not user friendly. A good example is au_id. You could change this into a more readable column such as Author s ID. Even though T-SQL is Microsoft s implementation of SQL and does allow for a variety of syntax choices, the method usually selected by experienced developers
For reliable and cheap web hosting services please check javaweb hosting website.