From the course: Microsoft SQL Server 2022 Essential Training
Unlock this course with a free trial
Join today to access over 24,100 courses taught by industry experts.
Solution: Create tables with T-SQL commands - SQL Server Tutorial
From the course: Microsoft SQL Server 2022 Essential Training
Solution: Create tables with T-SQL commands
(upbeat music) - [Instructor] In this challenge, we were tasked with creating a table to hold details about fitness classes for a local gym. We're given a list of requirements and we just need to make sure that the table that we create has columns that are appropriately structured for the given data that we want to insert into the table. Now, we're given this sample answer that has the insert statement down below, so we can see that it'll eventually add in three rows of information into the FitnessClassSchedule. And we just need to make a table that will accommodate all of this data. All right, let me come up here to line number three, and we'll get started with a CREATE TABLE statement, and the name of the table is going to be FitnessClassSchedule. Then we'll just open a parenthese, and I'll move that closing parenthese down. And I'm going to add my semicolon at the very end right now just for good measure so that I don't…
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
-
-
-
-
-
-
-
Understand the role of T-SQL2m 40s
-
(Locked)
Use the T-SQL editor6m 49s
-
(Locked)
Create a table with T-SQL6m 33s
-
(Locked)
Solution: Create tables with T-SQL commands3m 46s
-
(Locked)
Add data to a table4m 58s
-
(Locked)
Solution: Add data with T-SQL commands3m 4s
-
(Locked)
Retrieve records with SELECT4m 3s
-
(Locked)
Solution: Query data in a database2m 7s
-
(Locked)
Filter returned results with WHERE3m 12s
-
(Locked)
Sort records2m 54s
-
(Locked)
Solution: Filter and sort data with a query4m 27s
-
(Locked)
Delete records from a table4m 31s
-
(Locked)
Update records in a table2m 3s
-
(Locked)
Solution: Remove and update records in a table6m 11s
-
(Locked)
Joining related tables4m 32s
-
(Locked)
Solution: Query information from related tables5m 33s
-
(Locked)
Remove a table from the database5m 7s
-
-
-
-
-
-