From the course: Database Foundations: Data Structures

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Solution: Alter a table's design

Solution: Alter a table's design

(upbeat bright music) - [Instructor] In this challenge, we're given a table that maintains a record of creative projects at a graphic design agency. But this table has a fatal flaw and it's that it doesn't have a primary key. And so our task is to add a surrogate key to this table that'll automatically add a value for every record that's added into the table. So we can get started just by running the select statement. We're just going to select all of the original columns that we have from the design projects table. I'll test my code here to see what we're starting with. So we have a column called PROJECTNAME, CLIENTNAME. We have a CONTACTEMAIL, PROJECTSTARTDATE, PROJECTENDDATE, and the BUDGET. And so you can see there is no primary key for this table. It's a potential that we could have two projects with the same client name, and in fact we actually do, we could also have two projects with the same name if they're the same type of activity, like they have two different rebranding…

Contents