Learn SQL Programming from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

SQL Tips (4 to 6)

Umasankar Natarajan
07/07/2017 0 0

SQL tips 4:
Avoid INDEX, unless you need to retrieve information quickly. Index will slower insert and update data query.

The another way is using sub query

Select MAX(salary)
FROM employee
WHERE salary IN
(Select top 2 salary from employee where salary is not null order by salary desc)

SQL tips 5:
NULL and ZLS (zero length string) both are different.

NULL means data is unknown or missing.

NULL should be checked with IS NULL or IS NOT NULL only. Comparison operator equal to (=) or not equal to (<>) should not be used.

ZLS should be checked with two single quotes  ('') together.                        

SQL tips 6:
Always use primary key with integer field and unique key with string or text field.

This is not rule, it is best practice.

0 Dislike
Follow 0

Please Enter a comment


Other Lessons for You

SQL SERVER: How To Pass Parameters To The Stored Procedure?
SQL SERVER: How To Pass Parameters To The Stored Procedure? After so many years of existence of the stored procedures, I still see developers struggling to execute the stored procedure. The most common...

History of SQL server
In 1988, Microsoft released its first version of SQL Server. It was designed for the OS/2 platform and was developed jointly by Microsoft and Sybase. During the early 1990s, Microsoft began to develop...

Cursors In SQL Server
First thing first Usage of Cursors is not encouraged in SQL Server as they are slow. You may go with While loop if you need to iterate through a recordset. Cursor is a database object to retrieve data...

What's the best way to learn SQL Server?
Just read the book, type and run the code, and work the chapter examples. If you work the book, you will be ahead of many SQL Server programmers. You’ll understand declarative set-based interaction...

SQL Server – CAST/CONVERT to string – Pad zeroes or spaces to an integer
Recently, I came across quite a common question – as part of a data migration, someone wanted to pad integers with zeroes. There are various variations to this question, namely: How do I pad zeroes...

Looking for SQL Programming Classes?

The best tutors for SQL Programming Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn SQL Programming with the Best Tutors

The best Tutors for SQL Programming Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more