Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help with Q1, Q2 and Q3. ASAP if you can!! Thank you in advance. Part 1 Consider the simplified Employee Stock Ownership Database below

Please help with Q1, Q2 and Q3. ASAP if you can!! Thank you in advance.

image text in transcribed

Part 1 Consider the simplified Employee Stock Ownership Database below (primary keys are in bold): Person(ssn, companyid, salary, managerid) This is an employee table. companyid is a foreign key which points to Company. We assume one employee can only work at one company. managerid is a foreign key which points to another Person record. Company(companyid, companyname, location) Holding(ssn, companyid, sharenum) Holding table describes an employee(ssn) owns sharenum stocks of companyid. Construct SQL for the following queries: Q1: Find the ssn of the persons who work at Google(companyid = 601) and hold more than 500 sharenum of stock from Facebook(companyid = 700). Q2: Find the ssn of the persons who own all the different kinds of stocks his/her manager owns. (Note: Each companyid represents a different kind of stock, we do not care about the sharenum of stocks). Q3: Find the son of the persons who own at least three different kinds of stocks. Part 1 Consider the simplified Employee Stock Ownership Database below (primary keys are in bold): Person(ssn, companyid, salary, managerid) This is an employee table. companyid is a foreign key which points to Company. We assume one employee can only work at one company. managerid is a foreign key which points to another Person record. Company(companyid, companyname, location) Holding(ssn, companyid, sharenum) Holding table describes an employee(ssn) owns sharenum stocks of companyid. Construct SQL for the following queries: Q1: Find the ssn of the persons who work at Google(companyid = 601) and hold more than 500 sharenum of stock from Facebook(companyid = 700). Q2: Find the ssn of the persons who own all the different kinds of stocks his/her manager owns. (Note: Each companyid represents a different kind of stock, we do not care about the sharenum of stocks). Q3: Find the son of the persons who own at least three different kinds of stocks

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions