LIVE Course for free

Rated by 1 million+ students
Get app now
JEE MAIN 2023
JEE MAIN 2023 TEST SERIES
NEET 2023 TEST SERIES
NEET 2023
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
+2 votes
34.7k views
in Computer by (91 points)

Study the following tables STAFF and SALARY and write SQL commands for the questions

(i) to (iv) and give outputs for SQL queries (v) to (viii). /* CBSE 2006 */

TABLE: STAFF

ID NAME DEPT SEX EXPERIENCE

101 Siddharth SALES M 12

104 Raghav FINANCE M 5

107 Naman RESEARCH M 10

114 Nupur SALES F 3

109 Janvi FINANCE F 9

105 Rama RESEARCH M 10

117 James SALES F 3

111 Binoy FINANCE F 12

130 Samuel SALES M 15

TABLE: SALARY

ID BASIC ALLOWANCE COMMISSION%

101 12000 1000 3

104 23000 2300 5

107 32000 4000 5

114 12000 5200 10

109 42000 1700 20

105 18900 1690 3

130 21700 2600 30

i. Display NAME of all staff who are in “SALES” having more than 10 years

experience from the table STAFF.

ii. Display the average salary of all staff working in “FINANCE” department using

the tables STAFF and SALARY. (SALARY= BASIC + ALLOWANCE).

iii. Display the minimum ALLOWANCE of female staff.

iv. Display the highest commission% among all male staff.

v. SELECT count (*) from STAFF where SEX = ‘F’;

vi. SELECT NAME, DEPT, BASIC from STAFF, SALARY where DEPT =

‘SALES’ and STAFF.ID = SALARY.ID;

vii. SELECT distinct DEPT from STAFF;

viii. SELECT MAX(EXPERIENCE) FROM STAFF GROUP BY SEX;

Please log in or register to answer this question.

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...