0% found this document useful (0 votes)
34 views

hp2 Rachna3

The document provides instructions for a test with multiple sections and questions. It includes two tables defining relationships between trainers and courses, and products and clients. It asks to write SQL queries and Python code to retrieve and manipulate data from the tables.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

hp2 Rachna3

The document provides instructions for a test with multiple sections and questions. It includes two tables defining relationships between trainers and courses, and products and clients. It asks to write SQL queries and Python code to retrieve and manipulate data from the tables.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

A.V.P.

TRUST PUBLIC SENIOR SECONDARY SCHOOL (CBSE)


(Affiliated to the Central Board of Secondary Education, Delhi. Affl.No:1930358)
A.V.P Lay out, Gandhi Nagar, Tirupur, Tamilnadu
HALF PORTION TEST - II
Grade : XII COMPUTER SCIENCE (083) Total Marks : 70
General Instructions:
 The paper is divided into 5 Sections- A, B,C,D and E
 Section A, consists of Question number 1 to 18 and student need to attempt all
questions. Each carries 1 mark.
 Section B, consists of Question number 19 to 25 and student need to attempt all
questions. Each carries 2 marks.
 Section C, consists of Question number 26 to 30 and student need to attempt all
questions. Each carries 3 Marks.
 Section D, consists of Question number 31 to 33 and student need to attempt all
questions. Each carries 5 Marks.
 Section E, consists of Question number 34, 35 and student need to attempt all
questions. Each carries 4 Marks.
SECTION - A
1. Which command is used to add a new row?
(a) Insert (b) create (c) update (d) add
2. Number of rows in a relation is known as
(a) Degree (b) Cardinality (c) Cartesian Product (d) Attribute
3. Which clause is used to group the column(s) with aggregate function?
(a) Order by (b) Like (c) Where (d) Group by
4. Fill in the Blanks.
_________________ clause is used to remove duplicate rows from the result of SQL select
statement.
5. What is the purpose of BETWEEN Clause?
6. A Table customer contains 5 rows and 7 columns. What will be its cardinality and degree?
7. Mandatory arguments required to connect any database from Python
(a) Username, Password, Hostname, Database Name, Port.
(b) Username, Password, Hostname
(c) Username, Password, Hostname, Database Name
(d) Username, Hostname, Database name
8. Complete the code

(a) MySQLDB and connection (b) MySQLdb and connect


(c) MYSQL and connect (d) MySQLdb and connector
9. What do you understand by the term commit?
10. Define cursor.
1
11. DNS stand for __________ .
(a) Domain Network Service (b) Dynamic Network System
(c) Domain Name System (d) Dynamic Naming System
12. MAC address is __________ long.
(a) 16 bit (b) 32 bit (c) 48 bit (d) 64 bit
13. 162.248.49.180 is an example of
(a) MAC address (b) IP address (c) Both a and b (d) None of them
14. Wi-fi stands for
(a) Wireless Fidelity (b) Wireless frequency (c) Wireless File (d) Wireless Fiber
15. State True or False.
Switch is a device that is used to connect different types of networks.
16. Write the name of the two remote desktop applications.
17. Identify the following device:
(i) An intelligent device that connects several nodes to form a network and redirects the
received information only to intended node(s)
(ii) A device that regenerates (amplifies) the received signal and re-transmit it to its
destination
18. Why is a switch called an intelligent hub?
SECTION - B
19. Observe the following STUDENTS and EVENTS tables carefully and write the name of
the RDBMS operation which will be used to produce the output as shown in LIST ? Also, find
the Degree and Cardinality of the LIST.

20. Differentiate between the terms primary key and alternate key.

2
21. What is the importance of a Primary Key in a table? Explain with a suitable example.
22. Distinguish between MAC address and IP address with the help of example of each.
23. A school with 20 stand -alone computers is considering to network them together and
adding a server. State two advantages of doing this.
24. What is the purpose of Modem in network?
25. Differentiate between packet switching and message switching technique in network
communication.
SECTION – C
26. Write SQL queries for (i) to (iii), which are based on the following tables.
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.

27. What are candidate keys in a table? Give a suitable example of candidate keys in a table.

3
28. Write the python script to display all the records from the table student using for loop.

29. Write function insert() to insert the new row in table emp. The function will take the
values as parameter.

30. a. Write any two examples of DBMS Software.


b. What is meant by NULL value in MYSQL?
c. Table 'Employee' has 4 rows and 3 columns. Table 'Dept' has 2 rows and 5 columns.
What will be the cardinality of the cartesian product o them.

SECTION – D
31. Oberoi Industries has set up its new center at Mangalore for its office and web-based
activities. It has 4 blocks of buildings as shown in the diagram below:

Center to center distances between various blocks :

Block A to Block B 50 m

Block B to Block C 150 m

Block C to Block D 25 m

Block A to Block D 170 m

Block B to Block D 125 ill

Block A to Block C 90 m

Number of Computer:

Block A 25

Block B 50

Block C 125

Block D 10

(a) Suggest the device which is used to connect all the nodes in particular block.
(i)Repeater (ii)Gateway (iii)Bridge (iv)Switch
(b) Suggest the most suitable wire to connect all the blocks with high-speed data
transfer.
(i)Ethernet Cable (ii)Twisted Pair (iii)Optical Fibre (iv)Co-axial Cable

4
(c)The organization is planning to link its front office situated in the city in a hilly region
where cable connection is not feasible, suggest an economic way to connect way to connect
it with reasonably high speed.
(i)Satellite (ii)Radio Wave (iii)Microwave (iv)Bluetooth
(d) Suggest the appropriate protocol/way to do the audio-video communication between
the different parts of the world.
(i)E-Mail (ii)Blog (iii)Chat (iv)VOIP
(e) What type of network would be formed if the Mangalore office is connected to their
New York office?
(i) LAN (ii) PAN (iii) MAN (iv) WAN

32. Consider the following tables Product and Client. Write SQL commands for the statements
(i) to (iv) and give outputs for SQL query (v)

TABLE: PRODUCT

P_ID Product Name Manufacturer Price

TP01 Talcom Powder LAK 40

FW05 FaceWash ABC 45

BS01 Bath Soap ABC 55

SH06 Shampoo XYZ 120

FW12 Face Wash XYZ 95

TABLE: CLIENT

C_ID ClientName City P_ID

01 Cosmetic Shop Delhi FW05

06 Total Health Mumbai BS01

12 Live Life Delhi SH06

15 Pretty Woman Delhi FW12

16 Dreams Bangalore TP01

(i) To display the details of those Clients whose City is Delhi

(ii) To display the details of Products whose Price is in the range of 50 to 100 (Both values
included)

5
(iii) To display the ClientName, City from Table Client, and ProductName and Price from
table Product, with their corresponding matching P_ID

(iv) To increase the Price of all Products by 10

(v) SELECT ClientName, ManufacturerName FROM Product, Client WHERE


Client.Prod_Id = Product.P_Id;
33. Consider the following tables CARHUB and CUSTOMER and answer (a) and (b) parts
of this question:

Table: CARHUB

Vcode VehicleName Make Color Capacity Charges

100 Innova Toyota WHITE 7 15

102 SX4 Suzuki BLUE 4 14

104 C Class Mercedes RED 4 35

105 A-Star Suzuki WHITE 3 14

108 Indigo Tata SILVER 3 12

Table: CUSTOMER

CCode CName VCode

1 Hemant Sahu 101

2 Raj Lal 108

3 Feroza Shah 105

4 Ketan Dhal 104

(a) Write SQL commands for the following statements:


(i) To display the names of all white colored vehicles
(ii) To display name of vehicle, make and capacity of vehicles in ascending order of their
sitting capacity
(iii) To display the highest charges at which a vehicle can be hired from CARHUB.
(iv) To display the customer name and the corresponding name of the vehicle hired by them.
(b) Give the output of the following SQL queries:
(i) Select count(distinct make) from cabhub;
(ii) Select max(charges), min(charges) from carhub;

6
SECTION – E

34. Consider the following DEPT and WORKER tables. Write SQL queries for (a) and find
outputs for SQL queries (b):

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.

a.(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’.

b. (i) SELECT NAME, DEPARTMENT, CITY FROM WORKER W,DEPT D WHERE


W.DCODE=D.DCODE AND WNO<1003;

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

7
35. Write SQL queries for a, b and find outputs for SQL queries c and d, which are based on
the following tables.
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) select tid, tname,from trainer where city not in(‘delhi’,’mumbai’);
(d) select distinct tid from course; (g) select tid , count (*), min(fees) from course group by
tid having count(*)>1;

*********All the Best*********

You might also like