Duration: 16:36 min
Summary:In this video, we will discuss data types. Data types are very important when it comes to creating tables and working with variables. As you are designing a database and creating the tables, one of the important decisions you need to make is: what data types you need to use for specific columns? Would an ‘int’ be the correct choice? Or since the table will contain a small number of records, a ‘tinyint’ will be enough?
You might be thinking that since memory is available, it does not really matter. I would select the largest data type available and get it over with. But, as you will see later, this might have an impact on the database index and might affect performance.
Today, we will start discussing these data types. We will talk about: bigint, int, smallint, tinyint, and bit. But before, we start the discussion, we will look at some existing tables and see where the data types fit. Finally, we will see how to declare variables using the ‘declare’ keyword.
Technologies and Resources: T-SQL, SQL Server 2012 Express, AdventureWorks 2012.