Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

How to solve a Relation Schema

I have this relation schema: Employee(employee_Name, Street, City). Works(employee_Name, company_Name, Salary). Company(company_Name, City). Manages(employee_Name, manager_Name). I am using SQLitestudio, these are the codes i tried: 1-CREATE TABLE Employee ( employee_Name VARCHAR (20) PRIMARY KEY UNIQUE NOT NULL, Street STRING (50), City VARCHAR (20) ); 2-CREATE TABLE Works ( employee_Name VARCHAR (20), company_Name STRING, Salary DECIMAL ); 3-CREATE TABLE Company ( company_Name STRING, City VARCHAR (20) ); 4-CREATE TABLE Manages ( employee_Name VARCHAR (20), manager_Name VARCHAR (25) );

How can I do these following queries??? i. Find the names of all employees in the database who live in the same cities as the companies for which they work. ii. Find the names of all employees who earn more than the average salary of all employees of their company. Assume that all people work for at most one company. iii. Find the names of all employees in the database who do not work for 'First Bank Corporation'. Assume that all people work for exactly one company.

Comments