Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following database schema (primary keys are bolded and underlined): Employees(elD; integer, eName: string, age: integer, salary: real) Works(elD: integer, dName: string, startedDate: date,

image text in transcribed

Consider the following database schema (primary keys are bolded and underlined): Employees(elD; integer, eName: string, age: integer, salary: real) Works(elD: integer, dName: string, startedDate: date, ended: date) Departments(dName: string, budget: real, managerEID: integer) The meaning of these relations is straightforward, for example, the table Works has one record per employee-department pair, such that an employee works for a department for a specific period of time. There are three foreign keys for this database: The attribute elD of the relation Works that references the relation Emplovees The attribute 4Name of the relation Works that references the relation Departments rences the relation The attribute managerEID of the relation Departments that references the relation Employees Write the following queries in SQL. No duplicates should be printed in any of the answers. You should use the SQL keyword DISTINCT only when necessary. Also, the creation of temporary tables is not allowed, i.e., for each question, you must write exactly one SQL statement. Note: You MUST denote the number of each query before your answer. 1. Retrieve the name and budget of every department 2. Retrieve the name and budget of every department with a budget greater than S100,000.00 3. Retrieve the name of every department along with its manager name. 4. Retrieve the name and budget of every department that has more budget than the Data Mining department. Note that Data Mining is a department name. 5. Retrieve the names of each employee who works for both departments of Data Warehouse and the Data Mining. Note that e and Data Mining are 6. Find the name of the departament with the largest amount of budget

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 Systems For Advanced Applications 15th International Conference Dasfaa 2010 International Workshops Gdm Benchmarx Mcis Snsmw Diew Udm Tsukuba Japan April 2010 Revised Selected Papers Lncs 6193

Authors: Masatoshi Yoshikawa ,Xiaofeng Meng ,Takayuki Yumoto ,Qiang Ma ,Lifeng Sun ,Chiemi Watanabe

2010th Edition

3642145884, 978-3642145889

More Books

Students also viewed these Databases questions

Question

What are the major social responsibilities of business managers ?

Answered: 1 week ago

Question

What are the skills of management ?

Answered: 1 week ago