Question: Solve the following question using PostgreSQL . Give an SQL schema definition for the following employee database: employee ( employee name , street, city) works
Solve the following question using PostgreSQL.
Give an SQL schema definition for the following employee database:
employee (employee name, street, city) works (employee name, company_name, salary) company (company name, city) manages (employee name, manager_name)
Choose an appropriate domain for each attribute and one appropriate primary key for each relation schema. Include foreign key constraints where needed. The table manages contains two foreign keys where both employee_name and manager_name are foreign keys referencing the relation employee. Be careful about the order you create the tables.
Afterward, populate the tables you created with data (i.e, write SQL insert statements to insert data in the tables). You need to insert at least three rows in each table. Be careful about the order you populate the tables with data.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
