Professional Documents
Culture Documents
12th CS Sample Paper
12th CS Sample Paper
General Instructions:
ORANGE EDUCATION 1
8. Which of the following is a DDL command? 1
(a) SELECT (b) ALTER (c) INSERT (d) UPDATE
9. By default, Python names the segment with top‐level statements (main program) as _________. 1
10. Which of the following SQL commands displays the structure of a table? 1
(a) MODIFY (b) ADD PRIMARY (c) DESCRIBE (d)SHOW DATA
11. Which of the following functions will read lines of a text file as list elements. 1
(a) read() (b) get( ) (c) readline() (d) readlines( )
14. Which of the following will be the output of the statement given below? 1
print([12,34,56,78,90].pop())
(a) 78 (b) 90 (c)12 (d) 12,34,56,78,90
15. The aggregate functions can only be used in the select list or _________ clause of a select query. 1
16. For the HAVING clause, which of the following phrases is /are ture? 1
(a) Acts EXACTLY like a WHERE clause.
(b) Acts like a WHERE clause but is used for columns rather than groups.
(c) Acts like a WHERE clause but is used for groups rather than rows.
(d) Acts like a WHERE clause but is used for rows rather than columns.
Q17 and 18 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
17. Assertion (A):‐ Multiple text files may be opened together for processing. 1
Reasoning (R):‐ Python allows creation and association of multiple file objects linked to text files.
18. Assertion (A): A user‐defined function that accepts 3 parameters where no parameter carries a default 1
value must be called with 3 parameters.
Reason (R): Since, there are no defaults parameters, 3 parameters must be passed to the function.
Section‐B
19. Consider the following code and write the flow of execution for this. Line number have been given for 2
your referencing.
1 def power (b,p):
2 y=b**p
3 return y
4
5 def calcSquare(x):
6 a=power(x,2)
7 return a
8
9 n=5
10 result=calcSquare(n)
11 print(result)
ORANGE EDUCATION 2
20. Write one advantages and one disadvantage of bus topology. 2
OR
Write two advantages of using an optical fibre cable over an Ethernet cable to connect two service
stations, which are 190 m away from each other.
21. Consider the code below and answer the questions that follow: 2
def multiply(number1, number2):
answer=number1*number2
return(answer)
print(number1,’times’,number2,’=’,answer)
output=multiply(5,5)
(i) When the code above is executed, what gets printed?
(ii) What is variable output equal to after the code is executer?
22. What is Primary key? Give a Suitable example of Primary Key from a table containing some 2
meaningful data.
23. (a) Write the full forms of the following: 2
(i) PPP (ii) POP
(b) What is RJ‐45 connector?
24. Predict the output of the Python code given below: 2
x=[1,2,3,4]
counter=0
while counter <len(x):
print(x[counter]*'$')
for y in x:
print(y*'*')
counter+=1
OR
Predict the output of the Python code given below:
empdict={'Eno':[1,2,3,4], 'Ename':[ 'Amar', 'Akash', 'Nitin', 'Vijay',], 'Sal':[5000, 6000, 7000, 8000 ]}
print(empdict[‘Ename’][0].empdict['Sal'][0])
25. Explain the terms Cardinality and Degree in table. 2
OR
Explain DDL and DML . Write any two commands of both.
Section‐C
26. (a) Consider the following tables – Student and Fees: 1+2
Table: Student
Roll_No Name Class
1 Anita 12th
2 Prerna 11th
3 Krisha 10th
Table: Fees
Roll_No Fees
1 9000
2 8500
3 8000
What will be the output of the following statement?
SELECT * FROM Student NATURAL JOIN Fees;
ORANGE EDUCATION 3
(b) Write the output of the queries (i) to (iv) based on the table,TEACHER given below:
No. Name Age Department Salary
1. Akash 34 Computer 12000
2. Aditya 31 History 20000
3. Sandeep 35 Maths 30000
4. Amit 36 History 25000
5. Vijay 37 Maths 30000
6. Neeraj 34 Computer 21000
7. Narinder 35 Maths 20000
(i) To count the number of teachers with Age<23.
(ii) To insert a new row in the TEACHER table with the following data: ,
8,”Lalit”,27,”History”,18000.
27. Write a program to accept a filename and a position. Using the inputs, call a function 3
SearchFile(Fname, pos) to read the contents of the file from the position to the end. Now, display all
those words that start with “U” or “u”.
OR
Write a program in Python to open a text file “lines.txt” and display all those words whose length is
greater than 5.
28. Consider the following table CLUB. Write SQL commands for the following statements. 3
Table: CLUB
COACH‐ID COACHNAME AGE SPORTS DATEOFAPP PAY SEX
1. Abhinav 35 JUDO 27/03/1996 1000 M
2. Kirti 34 JUDO 20/01/1998 1200 F
3. Kartik 34 SQUASH 19/02/1998 2000 M
4. Munish 33 BASKETABLL 01/01/1998 1500 M
5. Yuvraj 36 SWIMMING 12/01/1998 750 M
6. Sonali 36 SWIMMING 24/02/1998 800 F
7. Rekha 39 SQUASH 22/02/1998 2200 F
8. Preeti 37 JUDO 22/02/1998 1100 F
9. Mohit 41 SWIMMING 13/01/1998 900 M
10. Amit 37 BASKETBALL 19/02/1998 1700 M
(I) To show all information about the Judo coaches in the club.
(II) To list names of all coaches with their date of appointment (DATEOFAPP) in descending order.
(III) To display a report, showing caochname , pay, age and bonus(15% of pay) for all the coaches.
(IV) To insert a new row in the CLUB table with the following
data:11,”PRAKASH”,37,”SQUASH”,{25/002/98},2500,”M”.
29. Write a user defined function to accept a string and check whether it is palindrome or not. (A 3
palindrome is a string that is same as its reverse).
31. The Cyber Mind Organization has setup its new branch at Mizoram for its office and web 5
based activates. It has four wings of buildings as shown in the diagram.
34. Ajay creates a table RESULT with a set of records to maintain the marks secured by students 1+1+2
in Term 1and Term2 and their position. After creation of the table, he has entered data of 7
students in the table.
Table Name :‐ Result
ROLL_NO Name Term 1 Term2 Position
1 Amar 370 412 I
2 Aditya 320 340 I
3 Vijay 415 425 I
4 Mohit 350 357 I
5 Aarushi 120 95 IV
6 Raj 150 205 II
7 Karan 475 440 I
Based on the data given above answer the following questions:
(i) Identify the most appropriate column, which can be considered as Primary key.
(ii) If two columns are added and 2 rows are deleted from the table result, what will be the
new degree and cardinality of the above table?
(iii) (a) Write the statements to Insert the following record into the table
Roll No‐ 8, Name‐ Aastha, Term 1‐ 470, Term 2‐444, Position – I.
(b) Increase the term 2 marks of the students by 3% whose name begins with ‘A’.
OR (Option for part iii only)
(iii) (a)Write the statements to Delete the record of students securing IV division.
( b) Add a column REMARKS in the table with datatype as varchar with 50 characters
ORANGE EDUCATION 6
35. Anita Rani has been given following incomplete code, which takes a student’s details (rollnumber, 4
name and makrs) and write into a binary file stu.dat using pickling.
Import pickle
sturno=int(input(“Enter roll number:”))
stuname=input(“Enter name:”)
stumakrs=float(input(“Enter Marks:”))
Stuq={“RollNo.”:sturno,”Name”:stuname,”Marks”:stumarks}
with__________________as fh: # Fill_Line1
__________________ # Fill_Line2
________________________as fin: # Fill_Line3
___________________ # Fill_Line4
print(Rstu)
if Rstu[“Marks”]>=85:
print(“Eligible for merit certificate”)
else:
print(“Not eligible for merit certificate”)
Help Anita to complete the code as per the following instructions.
(a) Complete Fill_Line1 so that the mentioned binary file is opened for writing in fh object using a
with statement.
(b) Complete Fill_Line2 so that the dictionary Stu1’s contents are written on the file opened in
step(a)
(c) Complete Fill_Line3 so that the earlier created binary file is opened for reading in a file object
namely fin, using a with statement.
Or
Complete Fill_Line4 so that the contents of open file in fin are read into a dictionary namely
Rstu.
(d) After completion of the code , what output will be produced , if the following details are input:
Enter roll number : 24
Enter name :Megha
Enter Marks: 76
ORANGE EDUCATION 7