From the course: Learning Microsoft SQL Server 2022
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Solution: Update the data stored in a table - SQL Server Tutorial
From the course: Learning Microsoft SQL Server 2022
Solution: Update the data stored in a table
- [Instructor] In this final code challenge, we are tasked with updating a database of geological samples. We have two records to update based on some new lab analysis results and a new preliminary survey to enter into the data table. We can get started by selecting everything out of the geological surveys table. We'll see that this gives us a number of existing geological surveys that are in that data table already. So you can see their ID, the location where the survey took place, the date, the mineral composition of the sample. We have the survey type, or how it was collected, the depth it was collected at, as well as any additional survey notes. Now, for two of these, if I scroll down here to the very bottom, numbers 110 and 111, we can see that their mineral composition is listed as "Pending Lab Analysis." So part of this challenge says that we now have these analyses; they've been completed. So we can update these two records with the actual mineral composition as determined by…
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)
Create a SELECT statement6m 15s
-
(Locked)
Use functions to calculate values7m 16s
-
(Locked)
Join data from multiple tables4m 54s
-
(Locked)
Write an UPDATE statement4m 37s
-
(Locked)
Add data with an INSERT statement4m 51s
-
(Locked)
Create a view of the data7m 42s
-
(Locked)
Solution: Select data from a table2m 47s
-
(Locked)
Solution: Join related tables with a query3m 11s
-
(Locked)
Solution: Use functions to calculate values4m 49s
-
(Locked)
Solution: Update the data stored in a table6m 30s
-
(Locked)
-