From the course: PostgreSQL Essential Training

Unlock the full course today

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

Solution: Execute a command on the Postgres server

Solution: Execute a command on the Postgres server - PostgreSQL Tutorial

From the course: PostgreSQL Essential Training

Solution: Execute a command on the Postgres server

(upbeat music) - [Instructor] I hope you were able to add in a pair of tables to the Kinetico database. Here's how I go about it. Now, in creating our tables with relationships between them it usually makes it a little bit easier to think about the columns that'll relate to one another. Figure out which table has the foreign key and which one has the primary key. Then create the table with the primary key values first. In the case of this challenge, that means that we should create the department's table first. So in order to do that, we're going to go into the Kinetico database and find our schemas collection. Here we have the human resources schema. I'll right click on that, point to create and choose table. All right, so we're going to create a new table for departments. Then we'll go over here to the columns section and we're going to add in a couple of columns. I asked for three individual columns for this challenge…

Contents