Question
Write SQL queries for (i) to (iv) and find outputs for SQL queries (v) to (vii), which are based on the tables. [CBSE Sample Paper 2018]

Table: Trainer

TID Tname City HireDate Salary
101 Sunaina Mumbai 1998-10-15 90000
102 Anamika Delhi 1994-12-24 80000
103 Deepti Chandigarh 2001-12-21 82000
104 Meenakshi Delhi 2002-12-25 78000
105 Richa Mumbai 1996-01-12 95000
106 Maniprabha Chennai 2001-12-12 69000

Table: Course

CID CNAME FEES STARTDATE TID
C201 AGDCA 12000 2018-07-02 101
C202 ADCA 15000 2018-07-15 103
C203 DCA 10000 2018-10-01 102
C203 DDTP 9000 2018-09-15 104
C205 DHN 20000 2018-08-01 101
C206 O LEVEL 18000 2018-07-25 105

(a) Display the Trainer Name, City and Salary in descending order of their hire date.

(b) To display the TNAME and CITY of Trainer of joined the institute in the month of December 2001.

(c) To display TNAME, HIREDATE,CNAME, STARTDATE from tables TRAINER and COURSE whose FEES is less than or equal to 10000

(d) To display number of trainer from each city (e) select tid, tname,from trainer where city not in(‘delhi’,’mumbai’);

(f) select distinct tid from course;

(g) select tid , count (*), min(fees) from course group by tid having count(*)>1;

(h) Select count(*),sum(fees) from course where startdate <’2018-09-15’;

Answer

Get the step-by-step solution for this question inside the Vidyadip app.

Get the answer in the app

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

Software Development Company has set up its new center at Raipur for its office and web-based activities. It has 4 blocks of buildings named Block A, Block B, Block C, Block (d).

Block Number of Computers
A 25
B 50
C 125
D 10

Shortest distances between various Blocks in meters:

Block A to Block B 60m
Block B to Block C 40m
Block C to Block A 30m
Block D to Block C 50m

(a) Suggest most suitable place to store server of this company.

(i) Block A (ii) Block B

(iii) Block C (iv) Block D

(b) Suggest the topology within the blocks.

(i) Bus (ii) Ring

(iii) Tree (iv) Star

(c) Suggest the placement of the Router in the network.

(i) Block A (ii) Block B

(iii) Block C (iv) Block D

(d) The company wants to design a website for its customers that can be changing the contents as per the responses of customers. What type of website can they design for this purpose?

(i) Static Website (ii) HTML website

(iii) Dynamic Website (iv) Blog

(e) What type of network would be formed if the Raipur office is connected to their New Delhi office?

(i) LAN (ii) PAN

(iii) MAN (iv) WAN


The ABC School Management has given a task to Mr. Amit Anand to write the code for the promotion rule/salary increment. He wrote the following code using function. On the basis of code, answer the following question.


(a) Which statement will be executed if Post = “Pgt” and experience = 15?
(i) Statement 1 (ii) Statement 2
(iii) Statement 3 (iv) Statement 4
(b) Which statement will be executed if Post = “Vice Principal” and experience = 15?
(i) Statement 2 (ii) Statement 4
(iii) Statement 6 (iv) Statement 8
(c) Which statement will be executed if Post = “tgt” and experience = 5?
(i) Statement 5 (ii) Statement 6
(iii) Statement 7 (iv) Statement 8
(d) Which statement will be executed if Post = “tgt” and experience = 22?
(i) Statement 5 (ii) Statement 6
(iii) Statement 7 (iv) Statement 8
(e) Which statement will be executed if Post = “Pgt” and experience = 15?
(i) Statement 1 (ii) Statement 2
(iii) Statement 3 (iv) Statement 4
Write some of the health issues caused due to technology.
Consider the following DEPT and WORKER tables. Write SQL queries for (i) to (iv) and find outputs for SQL queries (v) to (viii): [Delhi 2015]

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;

Mr. Sharma is working with an IT company and he was provided with some data. On which he wants to do some operations but he is facing some problem, help him in resolving:

Amit Ram Sam Roja Monan
Maths 90 92 89 81 94
Science 91 81 91 71 95
Hindi 97 96 88 67 99

(a) He wants to add a new column with name of student ‘Prem’ in above data frame choose the right command to do so:

(b) He wants to set all the values to zero in data frame, choose the right command to do so:

Amit Ram Sam Roja Monan Prem
Maths 0 0 0 0 0 0
Science 0 0 0 0 0 0
Hindi 0 0 0 0 0 0

(i) DF=0 (ii) DF[]=0

(iii) DF[:]=0 (iv) DF[:]==0

(c) He want to delete the row of Science marks:

(i) DF.drop(‘Science’, axis=1)

(ii) Dfdrop(‘Science’, axis=0)

(iii) dfdrop(‘Science’, axis=-1)

(iv) dfdrop(‘Science’, axis==0)

(d) What will be the output of the given command?

DFindex=[‘A’,’B’,’C’]

(iv) Error, Index already exist cannot be overwrite

Amit Ram Sam Roja Manan
A 90 92 89 81 94
B 91 81 91 71 95
C 97 96 88 67 99

(e) The given code is to create another data frame, which he want to add to existing Data Frame choose the right command to do so:

Sheet1={

‘Aaradhya’: pdSeries([90, 91, 97],

index=[‘Maths’,’Science’,’Hindi’])}

S1=pdDataFrame(Sheet1)

(i) Df.append(S1,axis=0)

(ii) Df.append(S1)

(iii) Df.insert(S1)

(iv) Df.join(S1)

What are the rules of Netiquettes?
Web Server is an uncommon PC framework running on HTTP through website pages. The page is a medium to convey information starting with one PC framework then onto the next. The working of the webserver begins from the customer or client. The client sends their request through the web browser to the webserver. Web server takes this request, processes it, and then sends back processed data to the client. The server gathers all of our web page information and sends it to the user, which we see on our Computer System n the form of a web pag(e) When the client sends a request for processing to the web server, a domain name and IP address are important to the webserver. The domain name and IP address are used to identify the user on a large network.

(a) A piece of icon or image on a web page associated with another webpage is called ______

(i)URL (ii) Hyperlink(iii)Plugin(iv)Extension

(b) Web servers are:

(i)IP addresses

(ii)Computer systems

(iii)Webpages of a site

(iv)A medium to carry data from one computer to another.

(c) The _______ translates internet domain and host names to IP address.

(i)Domain name system

(ii)Routing information protocol

(iii)Google

(iv)Networktime protocol

(d) What does the webserver need to send back information to the user?

(i)Home address

(ii) Domain name

(iii)IP address

(iv)Both (ii) and (iii)

(e) What is the full form of HTTP?

(i)Hypertext Transfer Protocol

(ii)Hypertext Transfer Procedure

(iii)Hyperlink Transfer Protocol

(iv)Hyperlink Transfer Procedure

Write SQL commands for the following queries on the basis of Club relation given below:

Relation: Club

Coach-ID CoachName Age Sports date_of_app Pay Sex
1 Kukreja 35 Karate 27/03/1996 1000 M
2 Ravina 34 Karate 20/01/1998 1200 F
3 Karan 34 Squash 19/02/1998 2000 M
4 Tarun 33 Basketball 01/01/1998 1500 M
5 Zubin 36 Swimming 12/01/1998 750 M
6 Ketaki 36 Swimming 24/02/1998 800 F
7 Ankita 39 Squash 20/02/1998 2200 F
8 Zareen 37 Karate 22/02/1998 1100 F
9 Kush 41 Swimming 13/01/1998 900 M
10 Shailya 37 Basketball 19/02/1998 1700 F

(a) To show all information about the swimming coaches in the club.

(b) To list the names of all coaches with their date of appointment (date_of_app) in descending order.

(c) To display a report showing coach name, pay, age, and bonus (15% of pay) for all coaches.

(d) To insert a new row in the Club table with ANY relevant data:

(e) Give the output of the following SQL statements:

(i) Select COUNT(Distinct Sports) from Club;

(ii) Select Min(Age) from Club where SEX = “F”;

The Teacher wrote the following code. Sanya was absent on the day when the topic was taught. Help her to complete the assignment.

Choose the output on the basis of the above code.

(a) Which statement is used to display “HeLLo PyThon ”?

(i) Statement 1 (ii) Statement 12

(iii) Statement 13 (iv) No Statement will display.

(b) Which statement will check for capital letters?

(i) Statement 6 (ii) Statement 7

(iii) Statement 8 (iv) Statement 9

(c) Which statement will convert it into capital letters?

(i) Statement 6 (ii) Statement 7

(iii) Statement 8 (iv) Statement 9

(d) Which is iterative Statement?

(i) Statement 5 (ii) Statement 6

(iii) Statement 8 (iv) There is No iterative Statement.

(e) What will be the output of Python code (Statement 1 to Statement 13)

(i) HeLLo PyThon (ii) No Output

(iii) hEllO pYtHON (iv) Hello Python

The following is the code related to the data structure QUEUE

Now answer the following based on the code given:

(a) What is the purpose of EnQueue function

(# Statement-1) defined above:

(i) It is a user defined function to scan / access QUEUE elements

(ii) It is a pre defined function to scan / access QUEUE elements

(iii) It is a user defined function working on double ended queue

(iv) It is a user defined function working on circular queue

(b) What is the line QUEUE.append(VALUE)

(# Statement-2) doing

(i) This will add the element at the end of the QUEUE

(ii) This will remove the element from the end of the QUEUE

(iii) This will add the element at the beginning of the QUEUE

(iv) This will remove the element from the beginning of the QUEUE

(c) Conceptually if the QUEUE is already full , what will happen

(i) PEEK() function will be executed

(ii) OVERFLOW occurs

(iii) UNDERFLOW occurs

(iv) We may still add more elements in it.

(d) What is the use of the variable VALUE used in argument (# Statement-1)

(i) This is the position of FRONT

(ii) This is the position of REAR

(iii) This is an element added in a QUEUE

(iv) This is the name of the list

(e) When the else part (# Statement-3) of the above code will be executed

(i) When the length of the QUEUE is zero

(ii) When the length of the QUEUE is one

(iii) When the length of the QUEUE is more than one

(iv) This part of the code will always executed