Welcome to the SQL world

by Dean H
Summary:

SQL is a strong tool that can perform amazing calculations. However in order for it work properly the first requirement would be neat, clean, formulated SQL codes. As much as 75% of poor relational performance is caused by “bad” SQL and application code.

Here are some suggested tips: 1. Think relationally in stead of file level processing. When joins are optimized, the database will automatically search the necessary data to return the requested criteria. 2. DO NOT USE SELECT. using select* is a bad practice because it adds columns to the tables and it will case the programs to fail unless changed. 3. Use “where” to filter data in the SQL instead of bringing it all into your program. 4. keep your database statistics up-todate. It will be hard for the optimizer to optimizing anything if it is not up-todate. 5. Building appropriate indexes for the queries is critically important. It will be the next thing to check if rule 1~4 fails.

Reflection:

Since we will be using SQL soon for our 305 class, I think it is a good idea to research some tips when using SQL to optimize the tool. I have heard amazing things about SQL, but I think it all comes to the knowledge of the user. For example, excel is widely used in school and companies, but most of the users barely used 30 ~ 40% of its function/feature. Excel is truly useful when the user has a good knowledge on the available options. I would say the same thing for SQL as well, so review these tips will definitely help out the future use of SQL.

Source:

Mullins, C. S. (2010). SQL performance basics. Database Trends and Applications, 24(4), 29-29. Retrieved from http://search.proquest.com/docview/816707594?accountid=10357

Tags

1 thought on “Welcome to the SQL world”

  1. I completely agree with what you covered in your blog. As with all types of code, clean and organized code is very important and makes everyone’s lives easier. What you say about the knowledge of the user is also important but no one can really remember all the different functions and ways to implement things, especially if you know more than one language. For some people, books are a major help, but for others just messing around with code until it works is more popular. I normally prefer the latter, with some help from the internets.

Comments are closed.