From the course: Relational Databases Essential Training

Unlock the full course today

Join today to access over 24,100 courses taught by industry experts.

Solution: Create tables with DDL commands

Solution: Create tables with DDL commands

From the course: Relational Databases Essential Training

Solution: Create tables with DDL commands

(uptempo music) - [Instructor] For this code challenge, we were asked to create a table for storing information about our movie watching activities so that we can remember what movies we've seen and our thoughts about each film. Now, the table diagram that was developed included the details for a number of different columns, so we just need to translate that into the SQL code to add it into our database. And we start that by using a CREATE TABLE statement. The name of the table is MovieNight, and after that I open up a parentheses. I'm going to move the closing parentheses down to the end. I like to make sure that I don't forget it and I'll just place it down here at the very end on line 7 just to get it out of the way. And now we can just start filling in the individual columns that were identified in the diagram. So the first column was MovieID. That is going to store an integer data type, and it was also specified to be the primary key for the table. I'm also going to specify that…

Contents