Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In a single SQL script file ending in .sql: Create a COMPANY database. This should be part of your SQL script, and you may add

In a single SQL script file ending in .sql:

Create a COMPANY database. This should be part of your SQL script, and you may add a DROP DATABASE command before it so that you can re-run your script as many times as you like.

Create tables that match the schema in figure 5.6, the COMPANY database in your book. Include all necessary constraints.

Add new tables to track expenses by employees and paychecks to employees.

Insert matching information to the data seen in the book so that the queries you write will match.

QUESTIONS Guide

Specify the following queries in SQL on the COMPANY relational database schema shown in Figure 5.5. Show the result of each query if it is applied to the COMPANY database in Figure 5.6

a. Retrieve the names of all employees in department 5 who work more than 10 hours per week on the ProductX project.

b. List the names of all employees who have a dependent with the same first name as themselves.

c. Find the names of all employees who are directly supervised by Franklin Wong.

image text in transcribedimage text in transcribed

FMPI OYF F DEPARTMENT DEPT_LOCATIONS PROJECT WORKS_ON Figure 5.5 DEPENDENT Schema diagram for the COMPANY relational database schema. Figure 5.6 One possible database state for the COMPANY relational database schema. EMPLOYEE DEPARTMENT DEPT_LOCATIONS wndke ON PROJECT DEPENDENT

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

Databases Demystified

Authors: Andrew Oppel

1st Edition

0072253649, 9780072253641

More Books

Students also viewed these Databases questions

Question

10.3 Discuss the five steps in the performance management process.

Answered: 1 week ago

Question

8. How would you explain your decisions to the city council?

Answered: 1 week ago