Consider the following relations with their attributes: EMPLOYEE(fname,Iname.ssn.sex,salary,super_ssn.dno,address,birth_date) DEPENDENT(essn.dependent name,sex, relationship,birth_date) DEPARTMENT(Dname, Dnumber, Mgr_ssn.Mgr_start_date) PROJECT(Pname Pnumber,Plocation,...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Consider the following relations with their attributes: EMPLOYEE(fname,Iname.ssn.sex,salary,super_ssn.dno,address,birth_date) DEPENDENT(essn.dependent name,sex, relationship,birth_date) DEPARTMENT(Dname, Dnumber, Mgr_ssn.Mgr_start_date) PROJECT(Pname Pnumber,Plocation, Dnum) WORKS ON(Esso.Png Hours) ssn stands for social security number of an employee, super_ssn stands for supervisor's ssn, essn stands for employee's ssn. ssn is the primary key of EMPLOYEE relation and essn is the foreign key of DEPENDENT relation referring to the EMPLOYEE relation. Mgr ssn is manager ssn which is a Foreign Key(FK) in DEPARTMENT table and referring to EMPLOYEE table, Dnum is FK in PROJECT table referring to DEPARTMENT table. Pname stands for project name. Essn is FK in WORKS ON table referencing primary key of EMPLOYEE table and Pno is also FK in WORKS ON table referencing Pnumber in PROJECT table. Mgr_start_year is the year when a manager started managing the corresponding department. Write the queries in SQL to achieve the following: a. Find out the number of employees working under each department. [2] b. Retrieve names of such employees who earn in between 60000 to 80000 and have male dependents. [3] c. Find the salary differences between the highest paid employee and the lowest paid one. [2] d. Select those projects where number of employees working are more than five. [2] e. Write the sql statement to define table DEPENDENT as mentioned above. [3] Note: Consider that the database has a proper database instance to process the above queries. Consider the following relations with their attributes: EMPLOYEE(fname,Iname.ssn.sex,salary,super_ssn.dno,address,birth_date) DEPENDENT(essn.dependent name,sex, relationship,birth_date) DEPARTMENT(Dname, Dnumber, Mgr_ssn.Mgr_start_date) PROJECT(Pname Pnumber,Plocation, Dnum) WORKS ON(Esso.Png Hours) ssn stands for social security number of an employee, super_ssn stands for supervisor's ssn, essn stands for employee's ssn. ssn is the primary key of EMPLOYEE relation and essn is the foreign key of DEPENDENT relation referring to the EMPLOYEE relation. Mgr ssn is manager ssn which is a Foreign Key(FK) in DEPARTMENT table and referring to EMPLOYEE table, Dnum is FK in PROJECT table referring to DEPARTMENT table. Pname stands for project name. Essn is FK in WORKS ON table referencing primary key of EMPLOYEE table and Pno is also FK in WORKS ON table referencing Pnumber in PROJECT table. Mgr_start_year is the year when a manager started managing the corresponding department. Write the queries in SQL to achieve the following: a. Find out the number of employees working under each department. [2] b. Retrieve names of such employees who earn in between 60000 to 80000 and have male dependents. [3] c. Find the salary differences between the highest paid employee and the lowest paid one. [2] d. Select those projects where number of employees working are more than five. [2] e. Write the sql statement to define table DEPENDENT as mentioned above. [3] Note: Consider that the database has a proper database instance to process the above queries.
Expert Answer:
Related Book For
Fundamentals of Database Systems
ISBN: 978-0136086208
6th edition
Authors: Ramez Elmasri, Shamkant Navathe
Posted Date:
Students also viewed these computer engineering questions
-
Consider the following relations for an order-processing application database at ABC, Inc. ORDER (O#, Odate, Cust#, Total_amount) ORDER-ITEM (O#, I#, Qty_ordered, Total_price, Discount%) Assume that...
-
Consider the following relations for a database that keeps track of business trips of salespersons in a sales office: SALESPERSON (SSN, Name, Start_Year, Dept_No) TRIP (SSN, From_City, To_City,...
-
Consider the following relations for a database that keeps track of student enrollment in courses and the books adopted for each course: STUDENT (SSN, Name, Major, Bdate) COURSE (Course#, Quarter,...
-
Q5] A firm has reported a profit of Rs.1,47,000 for the year ended 31-3-2014 after taking into consideration the following items. (i) The cost of an asset Rs.23,000 has been taken as an expense (ii)...
-
Example 6.14 gave the probability distributions shown below for x = number of flaws in a randomly selected glass panel from Supplier 1 y = number of flaws in a randomly selected glass panel from...
-
Lyle Steinberg has recently been hired as the manager of Laramie Coffee, a national chain of franchised coffee shops. During her first month as store manager, Lyle encountered the following internal...
-
A recent study by a respected psychologist, Daryl J. Bem (Cornell University) claimed to find evidence for the existence of extrasensory perception, or ESP. Dr. Bems results showed relatively small...
-
The following balances are available for Chrisman Company: Bonds were retired during 2010 at face value, plant and equipment were acquired for cash, and common stock was issued for cash. Depreciation...
-
A retailer sells products through their stores, their CFO has requested your help in the following issue. The store offers credit to guests through proprietary credit cards. However, in October of...
-
Southwestern University (SWU), a large state college in Stephenville, Texas, 30 miles southwest of the Dallas/Fort Worth metroplex, enrolls close to 20,000 students. In a typical town-gown...
-
- m 2) An eagle carrying a fish flies with a constant velocity v = (4 2 ). If the eagle is at a height of 50 m above a lake when it drops the fish, then: (a) write out position functions for the fish...
-
Spinning Gears has reported their beginning materials of $75,800 and ending material inventory of $79,200. In order to produce their 12" gear, they need $500,000 for production. How much in direct...
-
A typical level of sodium in blood is 3.24 mg/mL. What is the millimolar concentration of sodium in blood?
-
Using the link below, determine why you as an international student who has been in Canada for less than a year, has a part time job, and has a credit and debit card from Canada must file an income...
-
In 2013 collected $25,000 from customers for sales made in 2012 and $210,000 for sales made in 2013 . In 2014 it collected $23,000 from customers for sales made in 2013. At that point, all 2012 and...
-
Nordstrom Inc has the income statement shown Below. What is the Net Profit Margin? Round your answers. INCOME STATEMENT Net Sales $31,000,000 Cost of Goods Sold $10,230,000 Gross Profit $20,770,000...
-
If the length of the pendulum is increased four times, a. the time-period will increase by four times b. decrease by four times increase by two times c. decrease by two times d. no change.
-
Refer to Exercise 8.S.I. Construct a scatterplot of the data. Does the appearance of the scatterplot indicate that the pairing was effective? Explain. Exercise 8.S.I. A volunteer working at an animal...
-
What is the difference between controlled and uncontrolled redundancy?
-
Suppose that only 80% of the STUDENT records from Exercise 17.28 have a value for PHONE, 85% for MAJORDEPTCODE, 15% for MINORDEPTCODE, and 90% for DEGREEPROGRAM, and we use a variable-length record...
-
Convert the example of GEOMETRY_OBJECTS given in section 11.1.5 from the functional notation to the notation given in Figure 11.2 that distinguishes between attributes and operations. Use the keyword...
-
Using two CST elements, solve the simple shear problem depicted in the figure and determine whether the CST elements can represent the simple shear condition accurately or not. Material properties...
-
A heat conduction problem is modeled using four onedimensional heat conduction elements, as shown in figure 4.6. All elements are of the same length, \(L=1 \mathrm{~m}\), cross sectional area of...
-
Consider a network of onedimensional heat conduction elements as shown in figure 4.7. The temperature at node 1 is fixed and heat inputs at other nodes are prescribed. Properties of the elements are...
Study smarter with the SolutionInn App