Friday

Sample Question Answers class 12 CBSE

 

 

Section-II

Both the Case study-based questions are compulsory. Attempt any 4 sub parts from each question. Each question carries 1 mark

 

22.

Adarsh Public School is maintaining fees records of students. The database administrator Sandeep decided that-

      Name of the database -School

      Name of the table – Fees

      The attributes of Fees are as follows: Rollno - numeric

Name – character of size 20 Class - character of size 20 Fees – Numeric

Qtr – Numeric

 

Answer any four from the following questions:

 

 

(i) Identify the attribute best suitable to be declared as a primary key

1

 

(ii) Write the degree of the table.

1


 

(iii) Insert the following data into the attributes Rollno, Name, Class, Fees in fees table. 101, ‘vijay’, XII, 4000

1

 

(iv)  Sandeep want to remove the table Fees table from the database School.

 

Which command will he use from the following:

 

a)  DELETE FROM Fees;

 

b)  DROP TABLE Fees;

 

c)DROP DATABASE Fees;

 

d)  DELETE Fees FROM Fees;

1

 

(v) Now Sandeep wants to display the structure of the table Fees,

i.e, name of the attributes and their respective data types that he has used in the table. Write the query to display the same.

1

23.

Anil of class 12 is writing a program to create a CSV file “mydata.csv” which will contain user name and password for some entries. He has written the following code. As a programmer, help him to successfully execute the given task.

import                                                                                          # Line 1

 

def addCsvFile(UserName,PassWord): # to write / add data into the CSV file f=open(' mydata.csv','                      ')                                                     # Line 2 newFileWriter = csv.writer(f) newFileWriter.writerow([UserName,PassWord])

f.close() #csv file reading code

 

def readCsvFile(): # to read data from CSV file with open('mydata.csv','r') as newFile:

newFileReader = csv.                   (newFile)                            # Line 3 for row in newFileReader:

print (row[0],row[1])

 

newFile.                                                                                       # Line 4 addCsvFile(“Mahima”,” mah@456”)

addCsvFile(“Anil”,” anil@kruti”) addCsvFile(“Rakesh”,” star@nime”)

readCsvFile()                                                                                   #Line 5

 

 

(a) Give Name of the module he should import in Line 1.

1


 

(b) In which mode, Aman should open the file to add data into the file

1

 

(c) Fill in the blank in Line 3 to read the data from a csv file.

1

 

(d) Fill in the blank in Line 4 to close the file.

1

 

(e) Write the output he will obtain while executing Line 5.

1

 

Part-B

 

 

Section-I

 

24.

Evaluate the following expressions: a) (13%5)==(13%5.0)

b) ('abc' =='Abc') or not (2==2 or 4==6)

2

25

Differentiate between Viruses and Trojans in context of networking and data communication threats.

OR

Differentiate between Website and webpage. Write any two popular example of online shopping.

2

26

Expand the following terms:

a. HTTP b. FLOSS c. PAN d. IRC

2

27

Differentiate between call by value and call by reference with a suitable example for each.

OR

Explain the use of return key word used in a function with the help of a suitable example.

2

28

Rewrite the following code in Python after removing all syntax error(s). Underline each correction done in the code.

 

p=30

for c in range(0,p) if c%4==0:

print (c*4) Elseif c%5==0: print (c+3)

else

print(c+10)

2

29.

What possible outputs(s) are expected to be displayed on screen at the time of execution of the program from the following code? Also specify the maximum values that can be assigned to each of the variables Lower and Upper.

import random

 

AR=[20,30,40,50,60,70];

Lower =random.randint(1,4) Upper =random.randint(2,5)

for K in range(Lower, Upper +1): print (AR[K],end=”#“)

 

(i) 10#40#70# (ii) 30#40#50# (iii) 50#60#70# (iv) 40#50#70#

2

30

What do you understand by Foreign Key in a table? Give a suitable example of Foreign Key from a table containing some meaningful data.

2

31

Differentiate between fetchone() and fetchall() methods with suitable examples for each.

2

32

Categorize the following as DML and DDL Commands:

SELECT, INSERT, CREATE, UPDATE, ALTER, DELETE, DROP

2

33

Find and write the output of the following Python code:

2


 

def Display(str):

m=""

for i in range(0,len(str)): if(str[i].isupper()):

m=m+str[i].lower() elif str[i].islower():

m=m+str[i].upper() else:

if i%2==0:

m=m+str[i-1] else:

m=m+"#"

print(m) Display('Star@World ')

 

0 comments:

Post a Comment

Thanks for leaving a comment. As soon as it's approved, it will appear.