0% found this document useful (0 votes)
9 views10 pages

Cs 083 Hp 2 Mat Cs Final (1)

Uploaded by

Mishku
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)
9 views10 pages

Cs 083 Hp 2 Mat Cs Final (1)

Uploaded by

Mishku
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/ 10

BHARATH VIDYA MANDIR

HALF PORTION TEST II


COMPUTER SCIENCE (083)

DATE: 13.12.2023 MARKS: 70


CLASS: XII MAT-CS DURATION: 180 MINS

General Instructions:
1. This question paper contains five sections, Section A to E.
2. All questions are compulsory.
3. Section A has 18 questions carrying 01 mark each.
4. Section B has 7 Very Short Answer type questions carrying 02 marks each.
5. Section C has 5 Short Answer type questions carrying 3 marks each.
6. Section D has 2 questions carrying 04 marks each.
7. Section E has 3 question carrying 05 marks each.

SECTION A (40 MINS) (18*1 = 18 MARKS)

1) Which switching technique follows the store and forward mechanism?


(a) Message (b) Circuit (c) Packet (d) All of these
2) Who invented the World Wide Web (WWW) in 1989?
(a) Robert E Kahn (b) Linus Torvalds (c) Tim Berners-Lee (d) Ted Nelson
3) A device that connects networks with different protocols –
(a) Switch (b) Hub (c) Gateway (d) Proxy Server
4) Which of the following networking devices forwards data packets between computer
networks?
(a) Router (b) Gateway (c) Switch (d) Hub
5) A relation can have only one ________ key and may have more than one _______ keys.
(a) Primary, Candidate (b) Candidate, Alternate
(c) Candidate, Primary (d) Alternate, Candidate
6) The vertical subset of a table is known as:
(a) Tuple (b) Row (c) Attribute (d) Relation
7) A field or a combination of fields in a table that has a unique value for each row is called:
(a) Candidate key. (b) Foreign key. (c) Main key. (d) Alternate key.
8) How do you select all the columns from a table named "Employee"?
(a) SELECT [all] FROM Employee; (b) SELECT Employee;
(c) SELECT * BY Employee; (d) SELECT * FROM Employee;
9) Which clause will display NULL values in output?
(a) NULL (b) IS NULL (c) IS NOT NULL (d) NULL IS
10) Which multiple row method will give output except 0 for string data type?
(a). AVG() (b). COUNT() (c) MIN() (d) SUM()
11) Which of the following will give the same answer irrespective of the NULL values in the
specified column?
` (a) MIN() (b) MAX() (c) SUM() (d) None of the above
12) Which method of cursor class is used to fetch limited rows from the table?
(a) cursor.fetchsize(SIZE) (b) cursor.fetchmany(SIZE)
(c) cursor.fetchall(SIZE) (d) cursor.fetchonly(SIZE)
13) Which method of cursor class is used to insert or update multiple rows using a single Query?
(a) cursor.executeall(query,rows) (b) cursor.execute(query,rows)
(c) cursor.executemultiple(query,rows) (d) cursor.executemany(query,rows)
14) Which method of cursor class is used to get the number of rows affected after any of the
Insert/update/delete database operation executed from Python?
(a) cursor.rowcount (b) cursor.getaffectedcount
(c) cursor.rowscount (d) cursor.rcount
15) Which of the following is invalid method for fetching the records from database within
Python?
(a) fetchone() (b) fetchmany() (c) fetchall() (d) fetchmulti()
16) Which of the following method reflects the changes made in database permanently?
(a) <connection>.done() (b) <connection>.final()
(c) <connection>.reflect() (d) <connection>.commit()
17) To get all the records from the result set, we may use____________.
(a) cursor.fetch(SIZE) (b) cursor.fetchmany()
(c) cursor.fetchall() (d) cursor.fetchone()
18) How would you display all those rows from a table named "Trends" where value of the
column "Hobbies" is "marketing" ?
(a) SELECT ALL FROM Friends WHERE Hobbies IS 'marketing';
(b) SELECT * FROM Friends WHERE Hobbies='marketing';
(c) SELECT * FROM Friends WHERE Hobbies = 'marketing" ;
(d) SELECT ALL FROM Friends WHERE Hobbies 'marketing' ;

SECTION B (30 MINS) (7*2 = 14 MARKS)

19) Suresh, a Class X student, has just started understanding the basics of Internet and web
technologies. He is bit confused in between the terms “World Wide Web ‘and ‘Internet’. Help
him in understanding both the terms with the help of suitable examples of each.

20) Neeta is a bit confused between the term URL and Domain Name. Help him in understanding
both the terms with the help of suitable explanation using an example.

21) Define DDL & DML commands of SQL with example.

22) What is the use of LIKE operator in SQL?

23) What is the difference between where clause and having clause?

24) Write two differences between Coaxial and Fiber transmission media.

25) Write components of data communication.

SECTION C (50 MINS) (5*3 = 15 MARKS)

26) a) Explain the use of ‘Primary Key’ in a Relational Database Management System. Give
example to support your answer.
b) Write the full forms of the following: (i) VoIP (ii) TCP/IP.
c) If we want to access remote computer than which command should be used in networking?

27) Ganesh creates a table COMPANY with a set of 06 records.

Based on the data given above answer the following questions:

(a)Identify the most appropriate column, which can be considered as Primary key.
(b) If 3 columns are added and 2 rows are deleted from the table result, what will be
the new degree and cardinality of the above table?
(c) Write the statements to:
(i) Delete a record which has C_ID as C24
(ii) Increase the Fee of all by 500.

28) Write the outputs of the SQL queries (i) to (iii) based on the table Emp:

(a) Select ename, salary from emp where name like ‘_r%’
(b) Select count(salary) from emp where joindate>’2019-11-28’
(c) Select max(joindate), min(joindate) from emp

29) A mysql table class contains following columns:

-Roll no
-Name
-Marks

The mysql database has following details:

User =‘python’
Password=’test’
database=student
The code given below calculates the sum of marks of all students. Fill in the blanks:

import mysql.connector
con=_____________________.connect(host=’localhost’, user=’python’,
password=’test’, database=’student’) # statement 1
cur1=con.cursor()
cur1.____________(“select * from class”) # statement 2
total=0
for x in __________: # statement 3
total=total+int(x[2])
print(“total marks of all students :- “, total)
cur1.close()

30) Explain in detail Cartesian product / Cross join in SQL?

SECTION D (20 MINS) (2*4 = 8 MARKS)

31) Write the output of the queries (i) to (iv) based on the table, COURSE given below:

i. SELECT ALL TID FROM COURSE;


ii. SELECT TID, COUNT(), MAX(FEES) FROM COURSE GROUP BY TID HAVING
COUNT(TID)>1;
iii. SELECT CNAME FROM COURSE WHERE FEES>15000 ORDER BY CNAME
DESC;
iv. SELECT SUM(FEES) FROM COURSE WHERE FEES BETWEEN 15000 AND 17000;

32)
(a) Consider the following tables – Employee and Office:
What will be the output of the following statement?

SELECT Name, Dept FROM EMPLOYEE E,OFFICE O WHERE


E.Emp_Id=O.Emp_Id;

(b) Write the output of the queries (i) to (iv) based on the table Flights given below:

i. SELECT DISTINCT(TO) FROM Flights;


ii. SELECT To, COUNT(*), MIN(fare) FROM Flights GROUP BY TO HAVING
COUNT(TO)>1;
iii. SELECT FNAME FROM Flights WHERE FARE>5000 ORDER BY NAME;
iv. SELECT AVG(FARE) FROM Flights WHERE FARE BETWEEN 6000 TO 10000;

SECTION E (30 MINS) ((3*5 = 15 MARKS)

33) A table GAME has following structure and data:

a. Identify candidate key of the Game table, if any. Justify your answer.
b. How many rows will be in output if a query is executed using DISTINCT clause in field
captain?
c. i. Which command will display the structure of GAME table?
ii. Write a sql query that will delete the record of captain Dhoni in outside location.
d. i. Write sql query to remove the column draw.
ii. Write sql query that change number of player for the game kabaddi to 6.
34) Write SQL commands for (i) to (vi) on the basis of table STUDENT:

(i) List the name of all the students, who have taken stream as science.
(ii) To count the number of female students.
(iii) To display the number of students, stream wise.
(iv) To display all the records in sorted order of name.
(v) To display the stream of student whose name start from ‘s’.
(vi) To display the name and fees of students whose fees range from 3000 to 4000(both
values of fees included).

35) Star Info Solution is a professional consultancy company. The company is planning to set up
their new offices in India with its hub at Jaipur. As a network adviser, you have to understand
their requirement and suggest them the best available solutions. Their queries are mentioned as (i)
to (iv) below. Physical Locations of the blocked of Company

(a) What will be the most appropriate block, where company should plan to install their server?
(b) Draw a block to cable layout to connect all the buildings in the most appropriate manner for
efficient communication.
(c) What will be the best possible connectivity out of the following, you will suggest connecting
the new setup of offices in Bangalore with its London based office: o Satellite Link
i. Infrared ii. Ethernet Cable
(d) Which of the following device will be suggested by you to connect each computer in each of
the buildings?
i. Switch ii. Modem iii. Gateway
(e) Which protocol will be used to transfer files over this network?
ANSWER KEY

SECTION A
1) Which switching technique follows the store and forward mechanism?
(a) Message (b) Circuit (c) Packet (d) All of these
2) Who invented the World Wide Web (WWW) in 1989?
(a) Robert E Kahn (b) Linus Torvalds (c) Tim Berners-Lee (d) Ted Nelson
3) A device that connects networks with different protocols –
(a) Switch (b) Hub (c) Gateway (d) Proxy Server
4) Which of the following networking devices forwards data packets between computer networks?
(a) Router (b) Gateway (c) Switch (d) Hub
5) A relation can have only one ________ key and may have more than one _______ keys.
(a) Primary, Candidate (b) Candidate, Alternate
(c) Candidate, Primary (d) Alternate, Candidate
6) The vertical subset of a table is known as:
(a) Tuple (b) Row (c) Attribute (d) Relation
7) A field or a combination of fields in a table that has a unique value for each row is called:
(a) Candidate key. (b) Foreign key. (c) Main key. (d) Alternate key.
8) How do you select all the columns from a table named "Employee"?
(a). SELECT [all] FROM Employee; (b). SELECT Employee;
(c). SELECT * BY Employee; (d). SELECT * FROM Employee ;
9) Which clause will display NULL values in output?
(a). NULL (b). IS NULL (c). IS NOT NULL (d). NULL IS
10) Which multiple row method will give output except 0 for string data type?
(a). AVG() (b). COUNT() (c). MIN() (d). SUM()
11) Which of the following will give the same answer irrespective of the NULL values in the specified column:
` (a). MIN() (b). MAX() (c). SUM() (d). None of the above

12) Which method of cursor class is used to fetch limited rows from the table?
(a) cursor.fetchsize(SIZE) (b) cursor.fetchmany(SIZE)
(c) cursor.fetchall(SIZE) (d) cursor.fetchonly(SIZE)
13) Which method of cursor class is used to insert or update multiple rows using a single Query?
(a) cursor.executeall(query,rows) (b) cursor.execute(query,rows)
(c) cursor.executemultiple(query,rows) (d) cursor.executemany(query,rows)
14) Which method of cursor class is used to get the number of rows affected after any of the
Insert/update/delete database operation executed from Python?
(a) cursor.rowcount (b) cursor.getaffectedcount
(c) cursor.rowscount (d) cursor.rcount
15) Which of the following is invalid method for fetching the records from database within
Python?
(a) fetchone() (b) fetchmany() (c) fetchall() (d) fetchmulti()
16) Which of the following method reflects the changes made in database permanently?
(a) <connection>.done() (b) <connection>.final()
(c) <connection>.reflect() (d) <connection>.commit()
17) To get all the records from the result set, we may use____________.
(a) cursor.fetch(SIZE) (b) cursor.fetchmany()
(c) cursor.fetchall() (d) cursor.fetchone()
18) How would you display all those rows from a table named "Trends" where value of the column "Hobbies" is
"marketing" ?
(a). SELECT ALL FROM Friends WHERE Hobbies IS 'marketing';
(b). SELECT * FROM Friends WHERE Hobbies='marketing';
(c). SELECT * FROM Friends WHERE Hobbies = 'marketing" ;
(d). SELECT ALL FROM Friends WHERE Hobbies 'marketing' ;
SECTION B
19)Ans: World Wide Web is a set of programs, standards and protocols that allows the multimedia and hypertext files to be
created, displayed and linked on the Internet.
Eg: www.microsoft.com, www.amazon.com etc.
Internet is a computer-based worldwide communications network, which is composed of large number of smaller
interconnected networks.
Eg: Web, E-mails, Social media etc.
While internet is a collection of computers or networking devices connected together; WWW is a collection of
documents, linked via special links called hyperlinks. WWW forms a large part of Internet but is not the Internet.
20)

21)
DDL: - Data Definition Language (DDL) provides commands for defining relation schemas, deleting relations,
creating indexes, and modifying relation schemas. For example: CREATE,
ALTER, DROP etc…
DML: - Data Manipulation Language (DML) includes commands for manipulating tuples in databases. For
example: Insert, Delete, Update commands etc…
22)
What is the use of LIKE operator in SQL?
Like operator is used for matching patterns of character values on specific attributes and filter out the tuples on the
basis of the given patterns. It uses two wildcard characters % and _ (Underscore) for specifying patterns.

23)

24)

25)
Sender, Receiver, transmission media, protocol, message

SECTION C

26)
(a)Primary Key gives unique row values from given relation MARKS-1 Each
and as constraint it removed delicacy of data as input.
. (b)Full Form: VoIP:- Voice over internet protocol MARKS-1/2 Each
TCP/IP :- Transmission control Protocol/Internet protocol.
(c) TELNET Command MARKS-1
27)
(a) C_ID
(b) degree =7 and cardinality=4
(c) (i) DELETE FROM COMPANY WHERE C_ID= C24;
(ii) UPDATE COMPANY SET Fees=Fees+500;
28)
29)
Mysql.connector #statement 1
cur1.execute # statement 2
rec # statement 3
30)

SECTION D

Answer the following questions (2 X 4=8)

31)

32)
SECTION E
33)

a. There is no any candidate key as every field has duplicate values


b. 3
c. I. Desc game
II. Delete from game where captain=”Dhoni” and Location=”outside”;
` d.
(i) Alter table drop draw
(ii) Update game set noplayer=6 where gname=’Kabaddi’

34)(I) SELECT NAME FROM STUDENT WHERE STREAM=”SCIENCE”;


(II) SELECT COUNT(*) FROM STUDENT WHERE SEX=’FEMALE’;
(III) SELECT COUNT(*) FROM STUDENT GROUP BY STREAM;
(IV) SELECT * FROM STUDENT ORDER BY NAME ASC;
(V) SELECT STREAM FROM STUDENT WHERE STREAM LIKE”S%”;
(VI) SELECT NAME,FEES FROM STUDENT WHERE FEES BETWEEN 3000 AND 4000;

35)

(i) Finance block because it has maximum number of computers.


ii.

(iii) Satellite link (iv) Switch (v) FTP

You might also like