0% found this document useful (0 votes)
26 views4 pages

Std12 Practice QP 1

Uploaded by

usernam710
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)
26 views4 pages

Std12 Practice QP 1

Uploaded by

usernam710
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/ 4

CLASS: 12 SET A PRACTICE PAPER I Marks:55

COMP SCIENCE (Code: 083) Time:2.30 hours

1. Which of the following functions is used to write data in the binary mode? (1)
(a) write (b) output (c) dump (d) send
2. ______ keyword is used to display non-repeated values in MySQL. (1)

3. Which of the following is the correct syntax of file object ‘fobj’ to write sequence data type using (1)
writelines() function?
(a) file.writelines(sequence) (b) fobj.writelines()
(c) fobj.writelines(sequence) (d) fobj.writeline()
4. The HAVING clause is used in combination with ____________ clause. (1)
Which of the following commands will change row(s) of the table from (1)
5. MySQL database?
(a) REPLACE TABLE (b) CHANGE TABLE
(c) UPDATE (d) ALTER TABLE
6. Which of the following is not a file access mode (1)
a. rb b. rb+ c. wb d. rw

7. The ____________command can be used to makes changes in the rows of a table in SQL. (1)
a. Alter b. Modify c. Insert d. Update

8. Suggest the suitable command to remove the pre-existing database named Clients. (1)
(a) delete database Clients (b) drop Clients (c) drop
database Clients (d) Alter table drop Clients
9. A column or a group of columns which can be used as the primary key of relation is called a (1)
__________.
(a) Primary Key (b) Candidate Key (c) Alternate key (d) Foreign Key

10. The correct syntax of seek() is file_object.seek(offset [, reference_point]) (1)


Here reference_point can mean _____
(A) 0: means your reference point is the beginning of the file.
(B) 1: means your reference point is the current file position.
(C) 2: means your reference point is the end of the file.
(D) All the above
11. The columns of the table is called __________ (1)
(a)Attributes (b)Degree (c)Tuples (d)Cardinality

12. Which function is used to display the maximum value in a column of records from table in a database? (1)
(A) max() (B) high() (C) maximum() (D) large()

13. Which of the following function can work with NULL values in a database?
(a) avg() (b) sum() (c) count(*) (d) total(*)
Q14 and 15 are ASSERTION AND REASONING based questions. Mark the correct
choice as
(a) Both A and R are true and R is the correct explanation for A
(b) Both A and R are true and R is not the correct explanation for A
(c) A is True but R is False
(d) A is false but R is True

14. Assertion (A): Pickle in Python is primarily used in serializing and deserializing a Python object (1)
structure.
Reason (R): pickle.dump() method is used to read the object in file and pickle.load() method is
used to write the object from pickled file.
15. Assertion (A): The key word DISTINCT is used with select command
Reason (R): Distinct Keyword eliminates duplicate rows

16. While using SQL pattern matching, what is the difference between ‘_’(underscore) and ‘%’ wildcard (2)
symbols? OR
Categorize the following commands as DDL or DML:
DROP TABLE, INSERT, ALTER, DELETE
17. Differentiate between the Primary key and Alternate key of a table with the help of an example. (2)

18. (a) Consider the following tables – Salesperson and item (1)

What will be the output of the following statement?


SELECT * FROM Salesperson NATURAL JOIN ITEM;

19. A text file “MESSAGE.TXT” contains some line of text. (3)


Write a function COUNTWORD() in python to read the file and display the word and
number of words which are 6 or more than 6 characters long.
An apple a day keeps the doctor away.
We all pray for everyone’s safety.
A marked difference will come in our country.
The COUNTWORD() function should display the output as:
doctor
everyone’s
safety
marked
difference
country
No of words =6

20 A text file “MESSAGE.TXT” contains some line of text. (3)


Write a function COUNTFIRST() in python to read and return a string which contains
all the first characters of the words in the file.
Assume the file contains “THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG’
Then the function returns
“TQBFJOTLD”
21 A) Why is CSV used to transfer data over a network? (1+4)
B) Write a Program in Python that defines and calls the following user defined functions:
I) ADD() – To accept and add data of an employee to a CSV file ‘emp.csv’. Each record consists of a list
with field elements as [EID, ENAME, DEPT, SAL].

II) SEARCHR() – To count and return the number of records present in the CSV file named ‘emp.csv’ who
are working in DEPT = “FINANCE”
22. a) Write the output of the SQL commands for (i) to (iv) on the basis of tables (2+1)
BOOKS and ISSUES.

(i) select sum(price) as TOTAL_PRICE from BOOKS;


(ii) select * from BOOKS where publisher=”DEF”;
(iii) select BookName, AuthorName from BOOKS,ISSUES where
BOOKS.Book_ID=ISSUES.Book_ID and Qty_Issued>10;
(iv) select BOOKS.Book_ID, BookName, Publisher, Price, Qty, Qty_Issued from
BOOKS,ISSUES where BOOKS.Book_ID=ISSUES.Book_ID;
b) Write the command to view all the databases.

23. A company in Mega Enterprises has 4 wings of buildings as shown in the diagram : (5)

Distance between various buildings:

Number of computers at different units are:


(A) Draw a cable Layout for connecting all the wings and name the topology formed.
(B) Suggest the placement of the following devices with justification if the company wants
minimized network traffic
a) Repeater b) Hub / switch
(C) The company is planning to link its head office situated in New Delhi with the offices in hilly
areas. Suggest a way to connect it economically.
(D) Suggest the most suitable unit to house the server. Justify your answer.
(E) For online face to face communication, suggest the most suitable option from the following:
a) Voice call b) Text chat c) Email d) Video conferencing
24. Sony has set up its Branch at Srinagar for its office and web based activities. It has four zones of (5)
buildings as shown in the diagram:

A)Suggest the most suitable cable layout or Networking Topology of connections between the zones.
(b) Suggest the most suitable place (i.e., Zone) to house the Server of this organization. Give a suitable
reason with justification.
(c) Suggest the placement of the following devices with justification:
(i) Repeater (ii) Hub/Switch
(d) Which is the most economic type of cable for the selected topology?
e) Suggest a device/software to be installed in each branch to take care of data security.
25. Naveen creates a table “TOY” for keeping records. (1+1 +2+2)

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 one 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) Insert the following record into the table
T106, CYCLE, PLASTIC, 100, 10
ii) Increase the price of plastic toys by 3%.
(D) Write the statements to:
i) Delete the record of TRAIN toy.
ii)Add a column REMARKS with datatype as varchar with 50 characters
26. a)Give one difference between Text file and Binary File
b) A binary file “Book.dat” has structure *BookNo, Book_Name, Author, Price+.
i.Write a user defined function CreateFile() to input data for a record and add to Book.dat .
ii.Write a function CountRec(Author) in Python which accepts the Author name as parameter and (1+4)
count and return number of books by the given Author are stored in the binary file “Book.dat”

You might also like