From the course: Microsoft SQL Server 2022 Essential Training
Unlock this course with a free trial
Join today to access over 23,400 courses taught by industry experts.
SQL Server data type options - SQL Server Tutorial
From the course: Microsoft SQL Server 2022 Essential Training
SQL Server data type options
- [Instructor] Now that we know why we need to choose appropriate data types, you're probably wondering what your data type options are in SQL Server, and what makes them different. So let's get more specific. The two main categories are whether you need to store text data or if you need to store numbers. Let's tackle numbers first. First, we have several data types that do not store fractions. They can represent hold numbers only. The smallest number that we can store is called a bit, and it's literally just a 0 or a 1. This might not seem like it's going to be very useful at first, but it's actually a common data type to choose. The bit can be used to define true or false, or on or off, or yes or no. Basically, anything that you would use a checkbox to represent in a user interface, is probably connected to a bit data type. No surprise here, the bit data type takes one computer bit to store for each record. In…
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
-
-
-
-
-
-
Choose appropriate data types2m 46s
-
(Locked)
SQL Server data type options7m 19s
-
(Locked)
Automatically assign record identities4m 54s
-
(Locked)
Primary key fields4m 35s
-
(Locked)
Establish a default value5m 1s
-
(Locked)
Check constraints5m 10s
-
(Locked)
Unique constraints6m 23s
-
(Locked)
Foreign keys4m 16s
-
(Locked)
Create a foreign key column5m 16s
-
(Locked)
Create relationships between tables5m 6s
-
-
-
-
-
-
-