Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. For the following schema: Person(PersonID, Name) Visited(PersonID, PlaceName, Year). Location(PlaceName, Country, MainAttraction) Write the following queries: 1.1 Return all rows in Location where the

1. For the following schema:

Person(PersonID, Name)

Visited(PersonID, PlaceName, Year).

Location(PlaceName, Country, MainAttraction)

Write the following queries:

1.1 Return all rows in Location where the main attraction is a beach.

1.2 Return all the places visited by someone before 2000.

1.3 Return the names of everybody who visited somewhere in 2003.

2. For the following schema:

Employees(EmployeeID, EmpName, Birthdate, Street, City, DepartID, ManagerID, Salary )

Information about employees, with EmployeeID as key. The DepartID denotes the department to which they are assigned and the ManagerID is the EmployeeID of their supervisor. Every employee has a supervisor.

Department(DepartID, DepartName, ManagerID)

Stores information about the departments such as the unique department number, a unique department name (DepartName), and the employee ID of the department manager (every department must have a manager).

PROJECTS(ProjectNum,ProjectName, ProjectLocation, DepartID)

Information about projects at the company, with unique project number (ProjectNum). The project has a name and a location and is controlled/managed by a department.

WORKS(EmployeeID, ProjectNumber, Hours)

Information about the projects that each employee works on and the number of hours each employee works on each project.

Write the following queries:

2.1 Find the names and addresses (street and city) of employees who work for the Research department. (Research DeptID = RSH)

2.2 For every project located in Stanford, list the project number, the controlling department number and department name, and the department managers name. (ProjectLocation = Stanford)

2.3 Find and list all employees, their names, and hours for the project with the ProjectNum = 345.

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

Database Processing

Authors: David M. Kroenke, David Auer

11th Edition

B003Y7CIBU, 978-0132302678

More Books

Students also viewed these Databases questions

Question

What is the basis for Security Concerns in Cloud Computing?

Answered: 1 week ago

Question

Describe the three main Cloud Computing Environments.

Answered: 1 week ago