Pre-Board CS-Final
Pre-Board CS-Final
Pre-Board CS-Final
(a) True
(b) False
(c) NONE
(d) NULL
5. Write the output:- 1
print('This is my first @ preboard exam, I will try @ my best in this @
exam.’split('’@’', 2))
6. Which of the following mode in file opening statement can be used to add more 1
records in binary file?
(a) ab+ (b) rb+ (c) wb+ (d) None of the above
7. Fill in the blank: 1
______ command is used to delete a column from the table in SQL.
(a) update (b)remove (c) alter (d)drop
8. Which of the following commands will delete the table from MYSQL database? 1
(a) DELETE TABLE
(b) DROP TABLE
(c) REMOVE TABLE
(d) ALTER TABLE
9. Which of the following statement(s) would give an error after executing the 1
following code?
1
S1="Hello All" # Statement 1
print(S) # Statement 2
S2=S1+3 # Statement 3
print(S2) # Statement 4
S3=S1+"Welcome to my class" # Statement 5
(a) Statement 3
(b) Statement 4
(c) Statement 5
(d) Statement 4 and 5
10. Fill in the blank: 1
_________ is a key attribute, which can serve the purpose of Primary key of a
relation in SQL.
(a) Primary Key
(b) Foreign Key
(c) Candidate Key
(d) Alternate Key
11. The correct syntax of tell() is: 1
(a) tell()
(b) fileobject.tell(n)
(c) fileobject.tell()
(d) None of these
12. Fill in the blank: 1
The SELECT statement when combined with __________ clause, returns records
in ascending order of column name.
(a) group by
(b) where
(c) order by
(d) like
13. Fill in the blank: 1
______is a communication methodology designed to transfer file from source to
destination over Internet protocol.
(a) VoIP (b) FTP (c) PPP (d)HTTP
14. What will the following expression be evaluated to in Python? 1
42+4-3**2//19-3
(a) 43.25 (b) 43.0 (c) 43 (d) 43.5
15. Which function is used to display the total of values of column from table in a 1
database?
(a) sum(*)
(b) total(*)
(c) count(*)
(d) return(*)
16. To establish a connection between Python and SQL database, connect() is 1
used. How this function can be used with?
(a) Commit function
(b) cursor function
(c) file object
(d) password
17. Assertion (A):- If the arguments in function call statement match the number and 1
2
order of arguments as defined in the function definition, such arguments are
called positional arguments.
Reasoning (R):- During a function call, the argument list first contains default
argument(s) followed by positional argument(s).
18. Assertion (A): Text is a file where data is in human readable form. 1
Reason (R): The data is stored where internal translation take place.
SECTION B
19. Aruna has written a code to find the sum of even and odd elements from first 10 2
natural numbers. Her code is having errors. Rewrite the correct code and
underline the corrections made.
Def eveodd()
sume=0
sumo=0
for i in range(1, 11):
if i%2=0:
sum+=sume
else
sum=+sumo
print(“The sum of even numbers is:”, sume)
print(“The sum of odd numbers is:”, sumo)
20. Write two points of difference between Bus and Star Topology. Switching. 2
OR
Write two points of difference between XML and HTML.
21. (a) Given is a Python string declaration: 1
name="ComputerSciencewithPython"
print(name[3:14:2])
1
(b) Write the output of the code given below:
result = {x: x**x for x in range(4)}
print(result)
22. Explain the use of ‘Candidate key’ in a Relational Database Management System. 2
Give example to support your answer.
def Sum(N1,N2):
if N1>N2:
return N1-N2
else:
return N2-N1
3
lst= [20,25,24,34,35]
for C in range (4,0,-1):
A=lst[C]
B=lst[C-1]
print(Sum(A,B),'#', end=' ')
OR
Predict the output of the Python code given below:
tuple1 = (10,20,30,40,50,60)
list1 =list(tuple1)
new_list = []
for i in list1:
if i%3==0:
new_list.append(i)
new_tuple = tuple(new_list)
print(new_tuple)
25. Differentiate between count(ALL) and count(DISTINCT) functions in SQL with 2
appropriate example.
OR
Categorize the following commands as DDL or DML:
CREATE, DELETE,ALTER, INSERT
SECTION C
26. (a) Consider the following tables – Sales and Item: 1+2
Table: Sales
SCode SName SCITY
S01 HITESH DELHI
S02 SANDEEP MUMBAI
S03 MAHESH BANGALORE
Table: Item
(b) Write the output of the queries (i) to (iv) based on the table, TABLE:
EMPLOYEE
TABLE: EMPLOYEE
EMPNO NAME DATE_OF_ SALARY CITY
JOINING
5001 SUMIT SINGH 2012-05-24 55000 JAIPUR
5002 ASHOK 2015-10-25 65000 DELHI
4
SHARMA
5003 VIJAY SINGH 2009-09-09 85000 JAIPUR
5004 RAKESH VERMA 2020-12-21 60000 AGRA
5006 RAMESH 2011-01-22 72000 DELHI
KUMAR
27. Write a method COUNTLINES() in Python to read lines from text file ‘MYFILE.TXT’ 3
and display the lines which are not starting with an alphabet “P”.
Example:
OR
Example:
5
Table: SPORTS
SCODE NAME CITY COACH
S101 KARATE AGRA KARAN
S102 SQUASH DELHI ANKITA
S103 SWIMMING LUCKNOW AJAY
S104 TENNIS DELHI MUKESH
Table: WINNER
STUDENTN NAME SCODE MEDAL
O
11 AJAY S103 BRONZE
KUMAR
12 DINESH S101 GOLD
SHARMA
14 ASHOK S102 GOLD
KUMAR
15 RUPESH S101 SILVER
16 MOHIT S104 SILVER
(a) To display detail of all the sports conducted in Delhi and Agra.
(b) To display the detail of students who won medals in descending order of
their names.
(c) To display the student’s name with their game name who won gold
medal.
(d) To display medal name with total number of medals won by the students.
For example:
30. Sumit has created a list containing marks of 10 students. Write a program, with 3
separate user defined function to perform the following operation:
6
PUSH()- Traverse the content of the List and push all the odd marks into the
stack.
7
31 IFC University is setting up its academic blocks at Bhubneshwar and is planning
to set up a network. The University has 3 academic blocks and one Human
Resource Centre as shown in the diagram below:
LAW
Center to
8
(b) The given program is used to connect with MySQL abd show the name of
the all the record from the table “stmaster” from the database “oraclenk”. You
are required to complete the statements so that the code can be executed
properly.
(b) The code given below reads the following record from the table named
employee and displays only those records who have salary greater than
53500:
Empcode – integer
EmpName – string
EmpSalary – integer
9
employee in the database.
1. Identify the Primay Key from the given table with justification of your
answer.
2. If three more records are added and 2 more columns are added, find the
10
degree and cardinality of the table.
3. (i) Write SQL command to insert one more data/record to the table
(ii) Increase the price of furniture by 1000, where discount is given more
than 10.
35. Write a python program to create binary file dvd.dat and write 5 records in it 4
DVD id, DVD name, qty, price Display those DVD details whose DVD price
more than 25.
________________________________xxxxxxxxxxxxxxxxxxxxxxxx____________________________
11