Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Suppose that there are three tables, Person, WorkFor, and Company, in a database. o The Person table stores information about the ID, name, street,

Suppose that there are three tables, Person, WorkFor, and Company, in a database. o The Person table stores

Suppose that there are three tables, Person, WorkFor, and Company, in a database. o The Person table stores information about the ID, name, street, and city of each employee. o The Company table stores information about the tax number, name, and city of each company. A company may have several branches located in different cities. In this case, each branch of this company has its own tax number. (a) (b) (d) o The WorkFor table stores information about the ID and salary of each employee, and the tax number of each company. Write the data definition language (DDL) to create these three tables. (c) Write a SQL statement to calculate the number of employees who live in the city Uppsala. Write a SQL statement to find the names of all the employees who live in the city Stockholm. (1) Write a SQL statement to find the ID numbers of all the employees who work for the company IKEA and earn more than 35000. (e) Write a SQL statement to update the records in the WorkFor table, to double the salary of each employee whose salary is currently below 10000. Write a SQL statement to find the names of all the employees who work for companies which have branches located in the cities Stockholm or Uppsala.

Step by Step Solution

3.36 Rating (149 Votes )

There are 3 Steps involved in it

Step: 1

Answer Here is the DDL for creating the three tables Person WorkFor and Company Create the Person ta... 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

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions

Question

CL I P COL Astro- L(1-cas0) Lsing *A=2 L sin(0/2)

Answered: 1 week ago

Question

Describe two properties that each candidate key must satisfy.

Answered: 1 week ago