From the course: Microsoft SQL Server 2019 Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Understand data types - SQL Server Tutorial
From the course: Microsoft SQL Server 2019 Essential Training
Understand data types
- [Instructor] Having a good solid understanding of SQL Server's data types will make it easier for you to select the best option for your data storage needs when constructing your database's tables. I've touched on the topic briefly, but we need to explore this concept in more detail. First, let's make sure that we're all on the same page as to why we need to properly define the types of data that each column will store. One of the main reasons is to be efficient with storage space. If, for example, you need to store a number that represents an employee's age in years, you can pretty confidently assume that under no conceivable situation will that number ever need to be more than 255. SQL Server will allow you to store that value using a data type called tinyint, and it'll take a total of one byte of storage space on your disk to do so for every employee. If you incorrectly type the same age column as a regular int, or an integer data type, that same data storage will quadruple and…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Understand data types6m 46s
-
Table column properties4m 7s
-
(Locked)
Primary key fields3m 46s
-
(Locked)
Establish a default value4m
-
(Locked)
Check constraints4m 7s
-
(Locked)
Unique constraints5m 39s
-
(Locked)
Foreign keys3m 59s
-
(Locked)
Create a foreign key column3m 30s
-
(Locked)
Create relationships between tables4m 19s
-
(Locked)
-
-
-
-
-
-
-