Home
Username:
Password:
Database Optimization Tutorials

Data Types & Quality / Examples in SQL




Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com’s entire library of video tutorials.


Learn More

Subtitles of the Movie

Let's take just a moment to show examples of where we read all the field information inside the SQL. Now, keep in mind that I can look at this from the diagram from within the table structure itself and then if I need more definition, the Help menu and the books online will really help me understand all the data type. It's important to really understand what we mean by an integer and a small integer, between money and small money when you're actually setting up the design of your table itself. First, I'm in the Database Diagrams. Of course, we just do a right click to be able to create a new diagram. I've chosen a few tables in this particular example to point out how we can tell all the data and all their definitions. You will notice that it connects the primary to the foreign. However, I really can't tell exactly what it is unless the proper naming convention was used. In this case, it's easy enough to see that I have TerritoryID to TerritoryID. If this is not visible however, simply go over to the lines connecting them and you'll see that it defines the relationship itself. Notice that it's telling me the type of data that's involved and whether or not it allows nulls. Now, this is the view that allows me to do this. If I right click on the background, you'll see that you always get a selection of tasks that you can look at. Here's where we'll find the Relationship Labels. I can simply click on it and it turns the Relationships on so I can understand where the connection is being made. And go right on the table and do the same thing. It allows me to go to the Table View which allows me to choose Standard. Standard is what gives me the full information about the fields themselves. Now, keep in mind if you're just on Column Names, it closes it up and doesn't show you the type of data. Of course, any time we go into the tables themselves, for each individual table, we can see the type of columns and the definition of the data itself. In this case, the query tells me that's an integer, a small integer, a tiny integer. Notice though it doesn't give me the information as readily on the primary key itself. Now, sometimes, when we're looking at this data, we're not always sure what the definition of the term is. Here's where you always wanna turn to your books online or turn to your Help menu itself. For instance, we go into the Help menu inside of SQL. I've done a search on data types. You'll notice that in the data types, it's showing the word that I selected and it's giving me specifics on each of these items. It's telling me what an integer is, what a small integer is, a tiny integer and I can even get more information from microsoft.com by clicking on the link. It takes awhile to learn all the different data types and we really don't try to memorize these as much as we know where to go for the information itself. When you're looking at your database, always analyze it based on what these field values are. If they can be made shorter, do so. Now, keep in mind that along with all the different types of the fields that are there, we can also get a full explanation of all the other terminology that's used within the syntax. This is not of course just in SQL. Every program will give you the same tools, just a different name.

Tutorial Information

Course: Database Optimization
Author: Lauri Sowa-Matson
SKU: 34078
ISBN: 1-935320-94-7
Release Date: 2010-01-06
Duration: 8 hrs / 111 lessons
Work Files: Yes
Captions: Available on CD and Online University
Compatibility: Vista/XP/2000, OS X, Linux
QuickTime 7, Flash 8

VTC Sign up & Benefits

  • Unlimited Access
  • 98,729 Video Tutorials (23,265 free)
  • Video Available as Flash or QuickTime
  • Over 1026 Courses
  • $30 for One Month Access
  • Multi-User Discounts Available