From the course: Database Foundations: Data Structures
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Challenge: Add a primary key to a table
From the course: Database Foundations: Data Structures
Challenge: Add a primary key to a table
(upbeat music) - [Instructor] It's time for another challenge. I'd like you to build on the employee's table that you started in the last challenge and now add on a new column for the table's primary key. None of the columns that are already present will work as a natural key, so you'll need to generate a new serial number for each row. Make use of the RDBMS IDENTITY functionality to automatically create and assign numbers to each employee. To complete this challenge, you'll need to recall the SQL command for adding additional columns to an existing table. We went over it in the previous course, but it may have been a while since you've last used it. The command ALTER TABLE ADD will get you started. I estimate that this challenge will take 10 minutes or less to complete. Good luck.
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.