Home arrow BrainDump arrow Page 4 - More Advanced SQL Statements

Speeding Up the Search - BrainDump

In this third part to a series on beginning SQL, you'll learn how to use SQL statements to manipulate entire tables: to join them, alter them, and even delete them. It's all part of keeping a firm grip on your databases. Keep reading to learn more.

TABLE OF CONTENTS:
  1. More Advanced SQL Statements
  2. UNION STATEMENT
  3. And along came baby
  4. Speeding Up the Search
  5. OOPS I DID IT AGAIN
By: James Payne
Rating: starstarstarstarstar / 23
October 08, 2007

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

Databases, like programmers, can get big and bloated. When you get them to try and give you something, it takes them forever. If they get too big, they simply freeze up and then how will you get your data?

Well the solution is simple: create an index. An index cuts the time it takes to run a query by, you guessed it...indexing the data held within the database.


CREATE UNIQUE INDEX MyIndex

ON EMPLOYEE (FirstName);


The above code creates a UNIQUE INDEX called MyIndex. It indexes the data based on the FirstName column found within the EMPLOYEE table. A UNIQUE INDEX simply means that it allows no duplicate records.

For a SIMPLE INDEX (an index that allows duplicates) use the following code:

CREATE INDEX MyIndex

ON EMPLOYEE (FirstName);

If you wanted to add a sort feature you could do that as well.

 

CREATE UNIQUE INDEX MyIndex

ON EMPLOYEE (FirstName DESC);

And if you want to index more than one column, that too is possible.


CREATE UNIQUE INDEX MyIndex

ON EMPLOYEE (FirstName, LastName);



 
 
>>> More BrainDump Articles          >>> More By James Payne
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

BRAINDUMP ARTICLES

- Apple Founder Steve Jobs Dies
- Steve Jobs` Era at Apple Ends
- Google's Chrome Developer Tool Updated
- Google's Chrome 6 Browser Brings Speed to th...
- New Open Source Update Fedora 13 is Released...
- Install Linux with Knoppix
- iPad Developers Flock To SDK 3.2
- Managing a Linux Wireless Access Point
- Maintaining a Linux Wireless Access Point
- Securing a Linux Wireless Access Point
- Configuring a Linux Wireless Access Point
- Building a Linux Wireless Access Point
- Migrating Oracle to PostgreSQL with Enterpri...
- Demystifying SELinux on Kernel 2.6
- Yahoo and Microsoft Create Ad Partnership

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: