Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

undefined Q2) Suppose you have the following four tables that represent a database for company. This database describes employees (EMP), departments (DEPT), who manages the

image text in transcribedundefined

Q2) Suppose you have the following four tables that represent a database for company. This database describes employees (EMP), departments (DEPT), who manages the departments (MANAGES_DEPT) and where employees works (IN_DEPT) with percentage of work time for each employee. An employee can work in more than one department. Department managers can manage more than one per department. The primary key of each table is the attribute(s) in written in upper case. Other attributes are not necessarily unique. EID 001 002 003 004 005 EMP - 100,000 tuples EName Salary Start Date End Date Jane $124.000 3/1/93 null Jim $32.000 2/29/96 mull John $99.000 12/12/98 null $55,000 2/2/92 null Jenny $51.000 5/5/95 mull EID values range from 1 to 100,000 MANAGES DEPT - 800 tuples EID DID 003 101 003 102 001 103 Joe DEPT - 1,000 tuple DID DName Annual Budget 101 Research $1.001.000 102 Development $500.000 103 Sales $2.000.000 DID values range from 1 to 1000 IN DEPT-110,000 tuples EID DID Percent Time 001 101 100 002 102 100 003 101 60 003 102 40 004 103 100 005 103 100 a) 1- What is the degree and the cardinality of the EMP relation? 2- What will happen if we execute the following SQL statement? INSERT INTO MANAGES_DEPT VALUES (005,2340); b) Write SQL statement for the following: 1- List employee name and salary for all employees works in Sales department. 3- List manager name and department name for all departments having annual budget more that 500,000$. 4- List all employees name those works at more than one department. 5- List employee name and start date for all employees whom starting from 1994/3/12 to 1996/1/10. 6- List manager name and salary for all managers where their names started with letter J. 7- Add 50,000$ to all departments having annual budget less than 700,000$ 8- Remove data from all tables

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

Oracle Database 10g Insider Solutions

Authors: Arun R. Kumar, John Kanagaraj, Richard Stroupe

1st Edition

0672327910, 978-0672327919

More Books

Students also viewed these Databases questions