Question

Consider the following DEPT and WORKER tables. Write SQL queries for (i) to (iv) and find outputs for SQL queries (v) to (viii):

Table: DEPT

DCODE DEPARTMENT CITY
D01 MEDIA DELHI
D02 MARKETING DELHI
D03 INFRASTRUCTURE MUMBAI
D05 FINANCE KOLKATA
D04 HUMAN RESOURCE MUMBAI

Table: WORKER

WNO NAME DOJ DOB GENDER DCODE
1001 George K 2013-09-02 1991-09-01 MALE D01
1002 Ryma Sen 2012-12-11 1990-12-15 FEMALE D03
1003 Mohitesh 2013-02-03 1987-09-04 MALE D05
1007 Anil Jha 2014-01-17 1984-10-19 MALE D04
1004 Manila Sahai 2012-12-09 1986-11-14 FEMALE D01
1005 R SAHAY 2013-11-18 1987-03-31 MALE D02
1006 Jaya Priya 2014-06-09 1985-06-23 FEMALE D05

Note: DOJ refers to date of joining and DOB refers to date of Birth of workers.

(i) To display Wno, Name, Gender from the table WORKER in descending order of Wno.

(ii) To display the Name of all the FEMALE workers from the table WORKER.

(iii) To display the Wno and Name of those workers from the table WORKER who are born between ‘1987-01-01 ’and ‘1991-12-01 ’.

(iv) To count and display MALE workers who have joined after ‘1986-01-01 ’.

(v) SELECT COUNT(*), DCODE FROM WORKER GROUP BY DCODE HAVING COUNT(*)>1;

(vi) SELECT DISTINCT DEPARTMENT FROM DEPT;

(vii) SELECT NAME, DEPARTMENT, CITY FROM WORKER W,DEPT D WHERE W.DCODE=D.DCODE AND WNO <1003;

(viii) SELECT MAX(DOJ), MIN(DOB) FROM WORKER;

Answer

(i) SELECT Wno,Name,Gender FROM Worker ORDER BY Wno DESC;

(ii) SELECT Name FROM Worker WHERE Gender=’FEMALE ’;

(iii) SELECT Wno, Name FROM Worker WHERE DOB BETWEEN ‘1987-01-01 ’AND ‘1991-12-01 ’;

OR

SELECT Wno, Name FROM Worker WHERE DOB >=‘1987-01-01 ’AND DOB <=‘1991-12-01 ’

(iv) SELECT COUNT(*) FROM Worker WHERE GENDER=’MALE ’AND DOJ >‘1986-01-01 ’;

(v) COUNT(*) DCODE

2

2

D01

D05

(vi) Department

MEDIA

MARKETING

Infrastructure

Finance

Human Resource

(vii) Name Department City

George K

Ryma Sen

Media

Infrastructure

Delhi

Mumbai

(viii) Max(doj) Min(dob)
2014-06-09 1984-10-19

Need a full question paper?

Generate a complete, print-ready paper with questions like this in minutes — across 16+ boards, with answer keys.

Start Generating Free

Similar questions

Write the adverse effects of e-waste.
Write the freedom related to Open source softwares.
Answer the following question based on the given dataset download from data.gov.in:

data name : Percentage of Schools with Computers from 2013-14 to 2015-16

Screen shot of the data:

Assuming that we have saved the file with name: "computer_data" in python default folder.

Assuming that all the required libraries are imported once:

(i) To create the data frame of the above file.

(ii) To display all the column names of the data frame.

(iii) To plot the line graph for the first 5 record of the Primary Only column on y-axis and 'State_UT' on x-axis.

The line colour should be red and marker as 'x'. The graph will display only 2013-14

(iv) To display the histogram of the 2013-14, primary_only column.

(v) To display bar graph of the last 7 record of the year 2013-14 use the title and required label. Also write the statement to create the data frame.

(vi) To display the pie chart of the first 10 records of the 2013-14. Also create the data frame.

(vii) To display the boxplot for the Sec with higher secondary and All India data.

(viii) To display the scatter diagram of the 2014-15

Write a script to create a list of 10 random integers and display it. Then input an integer from the user and check whether it is present in the list (use in operator). If it is present in the list, then remove it from the list. If the element is present in the list multiple times then all its occurrences should be removed. (use remove() method). If the element is not present, then display an appropriate message.

Write a function delrecord() to delete the record form the binary file “student”. The record should be deleted on the basis of student number.
WAP using function to insert new element in sorted list.
WAP to find the sum of first n terms of the following series:
$x-x^2+x^3+\ldots$
Write a function Common () to accept lists as argument and return the list with common elements from both the lists.
Write the function Insertion() to sort the list using Insertion sort technique. The function will take the list as parameter.
Xcelencia Edu Services Ltd. is an educational organization. It is planning to set up its India campus at Hyderabad with its head office at Delhi. The Hyderabad campus has four main buildings - ADMIN, SCIENCE, BUSINESS and MEDIA.

You as a network expert have to suggest the best network related solutions for their problems raised in (a) to (d), keeping in mind the distances between the buildings and other given parameters.

Shortest Distances between various buildings:

ADMIN to SCIENCE 65 M
ADMIN to BUSINESS 100 m
ADMIN to ARTS 60 M
SCIENCE to BUSINESS 75 M
SCIENCE to ARTS 60 M
BUSINESS to ARTS 50 M
DELHI Head Office to HYDERABAD Campus 1600 KM

Number of Computers installed at various building are as follows:

ADMIN 100
SCIENCE 85
BUSINESS 40
ARTS 12
DELHI Head Office 20

(a) Suggest the most appropriate location of the server inside the HYDERABAD campus (out of the 4 buildings), to get the best connectivity for maximum no. of computers. Justify your answer.

(b) Suggest and draw the cable layout to efficiently connect various buildings ‘within the HYDERABAD campus for connecting the computers.

(c) Which hardware device will you suggest to be procured by the company to be installed to protect and control the internet uses within the campus?

(d) Which of the following will you suggest to establish the online face-to-face communication between the people in the Admin Office of HYDERABAD campus and DELHI Head Office?

(a) E-mail (b) Text Chat (c) Video Conferencing (d) Cable TV