0% found this document useful (0 votes)
20 views9 pages

1 Mark Questionsf

The document contains a series of one-mark questions related to Python programming, covering topics such as data types, operators, identifiers, and functions. It includes multiple-choice questions with correct answers provided for each query. The questions assess knowledge on Python syntax, built-in functions, and programming concepts.

Uploaded by

psdspace007
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)
20 views9 pages

1 Mark Questionsf

The document contains a series of one-mark questions related to Python programming, covering topics such as data types, operators, identifiers, and functions. It includes multiple-choice questions with correct answers provided for each query. The questions assess knowledge on Python syntax, built-in functions, and programming concepts.

Uploaded by

psdspace007
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/ 9

1 MARK QUESTIONS a). / b). = c). = = d).

and a) 4th Sum b) Total c) Number# d) _Data


Ans (c) == Ans (b) Total (d) _Data
Identify the mutable data types? Which of the following are valid operators in Python:
(a) List (b) Tuple (c) Dictionary (d) String (a) ** (b) between (c) like (d) ||
Tokens- I mark questions Ans (a) **
Ans (a) List (c) Dictionary
Write the full form of IDLE Which of the following is not an assignment operator? Find the invalid identifier from the following Which of the following is a valid assignment operator in
Ans integrated development learning environment a) yourName b) _false c) 2My_Name d) My_Name Python ?
i.) **= ii.) /= iii.) == iv.) a) ? b) < c) *= d) and e) //
%= Ans (iii) == Ans (c) 2My_Name Ans (c) *=
Write the type of tokens from the following. Find the correct identifiers out of the following, which can be Which of the following is not a valid identifier in Which of the following is valid relational operator in Python:
used for naming Variable, Constants or Functions in a python Python? (a)// (b)? (c) < (d) and
i. _Var ii. In program : a) KV2 b) _main c) Hello_Dear1 d) 7 Sisters
Ans (i) identifier (ii) operator-membership For, while, INT, NeW, del, 1stName, Add+Subtract, name1 Ans (d) 7 Sisters Ans (c) <
operator Ans For, INT, NeW, name1 Find the valid identifier from the following Identify the invalid logical operator in Python from the
Find the correct identifiers out of the following, Which of the following is valid logical operator a) False b) Ist&2nd c) 2ndName d) My_Name following.
which can be used for naming variable, constants (i) && (ii) > (iii) and (iv) == a) and b) or c) not d) Boolean
or functions in a python program : Ans (iii) and Ans (d) My_Name Ans (d) Boolean
While, for, Float, int, 2ndName, A%B, Amount2,
_Counter
Ans While, Float, _Counter, Amount2 Operators evaluation - I mark questions
Write the data type of following literals: Which of the following is not a valid identifier name in Python?
(i) 123 (ii) True Justify reason for it not being a valid name. Evaluate the following expressions:
Ans (i) number-integer (ii) Boolean a) 5Total b) _Radius c) pi d)While a) 8/4+4**2//5%2-8 Ans -5.0
Ans (a) 5total-it starts with number (c) pi-is a keyword b) 10 >= 5 and 7 < 12 or not 13 == 3 Ans True
Which of the following are valid operator in Python: Which of the following are Keywords in Python ? c) 6 * 3 + 4**2 // 5 – 8 Ans 13
(i) */ (ii) is (iii) ^ (iv) like (i) break (ii) check (iii) range (iv) while d) 10 > 5 and 7 > 12 or not 18 > 3 Ans False
Ans (ii) is-identity operator Ans (i) break (iii) range (iv) while e) 18 % 4 ** 3 // 7 + 9 Ans 11
Find the invalid identifier from the following Which of the following is valid arithmetic operator in Python: f) 2 > 5 or 5 == 5 and not 12 <= 9 Ans True
a) def b) For c)_bonus d)First_Name (i) // (ii)? (iii) < (iv) and g) 6 * 3 + 4**2 // 5 – 8 Ans 13
Ans (i) // h) 10 > 5 and 7 > 12 or not 18 > 3 Ans False
Ans (a) def i) 51+4-3**3//19-3 Ans 51
Find the invalid identifier from the following Which operator is used for replication? j) 1718 and not 19==0 Ans True
a) Subtotal b) assert c) temp_calc d) Name2 a) + b) % c) * d) // k) 8 * 3 + 2**3 // 9 – 4 Ans 25
Ans (c) * l) 12 > 15 and 8 > 12 or not 19 > 4 Ans False
Ans (b) assert- it is a keyword m) not(20>6) or (19>7)and(20==20) Ans True
What is the value of the expression Identify the invalid keyword in Python from the following: n) 17%20 Ans 17
4+4.00, 2**4.0 (a) True (b) None (c) Import (d) return o) 2 ** 3 ** 2 Ans 512
Ans (8.0, 16.0) Ans (c) Import p) 7 // 5 + 8 * 2 / 4 – 3 Ans 2.0
Find the operator which cannot be used with a Name the mutable data types in Python. If given A=2,B=1,C=3, What will be the output of following expressions:
string in Python from the following: Ans : list,dictionary (i) print((A>B) and (B>C) or(C>A)) Ans True
(a) + (b) in (c) * (d) // (ii) print(A**B**C) Ans 2
Ans (d) // Write the output of the following python expression:
Find the valid identifier from the following Identify the valid logical operator in Python from the following. (a) print((4>5 and (2!=1) or (4<9)) Ans True
a) My-Name b) True c) 2ndName d) S_name a) ? b) < c) ** d) and (b) print(2 + 3*4//2 - 4) Ans 4
Ans (d) and (c) print(10%3 – 10//3) Ans -2
Ans (d) S_name
Which one is valid relational operator in Python Which of the following can be used as valid variable identifiers
in Python? Module Identification- I mark questions
Name the Python Library modules which need to be imported to invoke the following functions: String and List - I mark questions
(i) ceil() (ii) randrange() Ans (i) math (ii) random
(i) sin( ) (ii) randint ( ) Ans (i) math (ii) random Identify the valid declaration of P: Find the output –
(i) sqrt() (ii) randint() Ans (i) math (ii) random P= [‘Jan’, 31, ‘Feb’, 28] >>>A = [17, 24, 15, 30]
(i) dump() (ii) random() Ans (i) pickle (ii) random a) dictionary b) string c)tuple d) list >>>A.insert( 2, 33)
(i) round() (ii) load() Ans (i) math (ii) pickle >>>print ( A [-4])
(i) writerow() (ii) sqrt() Ans (i) csv (ii) math Ans (d) list Ans 24
(i) replace() (ii) load() Ans (i) string (ii) pickle Find the output of the following: Given the lists Lst=[‘C’,’O’,’M’,’P’,’U’,’T’,’E’,’R’] ,
(i) cursor() (ii) pi Ans (i) mysql.connector (ii) math >>>Name = “Python Examination” write the output of: print(Lst[3:6])
(i) sin() (ii) reader() Ans (i) math (ii) csv >>>print (Name [ : 8 : -1]) Ans PUT
(i) cursor() (ii) reader() Ans (i) mysql.connector (ii) csv Ans noitanima
i) stdin() ii) load() Ans (i) sys (ii) pickle What will be the output of following program: Give Output:
(i) log() (ii) writer() Ans (i) math (ii) csv a='hello' colors=["violet", "indigo", "blue", "green", "yellow",
Which of the following functions generates an integer? b='virat' "orange", "red"]
a) uniform( ) b) randint( ) c) random( ) d) None of the above Ans (b) randint() for i in range(len(a)): del colors[4]
print(a[i],b[i]) colors.remove("blue")
Which module is used for working with CSV files in Python? Ans csv Ans colors.pop(3)
Name the built-in function / method that is used to return the length of the object. Ans len() hv print(colors)
Name the function/method required for ei Ans ['violet', 'indigo', 'green', 'red']
(a) Finding second occurrence of m in madam. Ans (a) index or find() lr
(b) Get the position of an item in the list Ans (b) find() or index () la
Observe the following Python code and write the name(s) of the header file(s), which will be ot
essentially required to run in a Python compiler. If the following code is executed, what will be Given the list
X=randint(1,3) the output of the following code? Lst = [ 12, 34, 4, 56, 78, 22, 78, 89],
Y=pow(X,3) name="Computer Science with Python" find the output of
print(“hello”.upper()) Ans random,math,string print(name[2:10]) print(Lst[1:6:2])
Name the built-in mathematical function / method that is used to return square root of a number Ans mputer S Ans [34,56,22]
Ans sqrt() Give the output of the following code: Write the output of the following python
Name the Python library module(s) which needs to be imported to run the following program: L = [ 1,2,3,4,5,6,7] statements:
print(sqrt(random.randint(1,16))) Ans math,random B=L Array=[8,5,3,2,1,1]
B[3:5] = 90,34 print(Array[-1:-6:-1])
Which of the following function is used to write data in binary mode? print(L) Ans 11235
a) write ( ) b) output ( ) c) dump ( ) d) send ( ) Ans (c) dump Ans [1, 2, 3, 90, 34, 6, 7]
Given the lists L=[1,3,6,82,5,7,11,92] , Given the lists L=[“H”, “T”, “W”, “P”, “N”] ,
What will be the output of write the output of
print(L[2:5]) Ans [6,82,5] print(L[3:4]) Ans [“P”]
Write the output of following code Given the lists
t1 = [10, 12, 43, 39] L=[1,3,6,82,5,7,11,92] ,
print(t1*3) write the output of
Ans print(L[1:6])
[10, 12, 43, 39, 10, 12, 43, 39, 10, 12, 43, 39] Ans [3,6,82,5,7]
Identify the valid declaration of L: If the following code is executed, what will be the
L = [‘Mon’, ‘23’, ‘hello’, ’60.5’] output of the following code?
a). dictionary b). string c).tuple d). list name="ComputerSciencewithPython"
print(name[3:10])
Ans (d) list Ans puterSc
Which statement is not correct What will be the output of following code snippet:
a) The statement x = x + 10 is a valid msg = “Hello Friends”
statement msg [ : : -1]
b) List slice is a list itself. a) Hello b) Hello Friend Is there any difference between 1 or ‘1’ in Python does not support a character type.(T/F)
c) Lists are immutable while strings are c) 'sdneirF olleH' d) Friend Ans (c) python? Ans True. (Python supports string type)
mutable. Ans. Yes
d) Lists and strings in pythons support two  Write a code to create empty string 'str1' Ans. str1 = ' '
way indexing. Ans (c)  What do you mean by traversing a string?
Identify the valid declaration of L: A list is declared as Ans. Traversing a string means accessing all the elements of the string one by one by using
L = [1, 23, ‘hi’, 6] L=[(2,5,6,9,8)] index value.
(i)list (ii)dictionary (iii)array What will be the value of  What is the index value of first element of a string? Ans. 0
(iv)tuple print(L[0])?  What is the index value of last element of a string? Ans. -1
Ans (i) list Ans (2,5,6,9,8)  If the length of the string is 10 then what would be the positive index value of last element?
What will be the output when the following If the following code is executed, what will be the  Ans. 9
code is executed output of the following code?  If the length of string is 9, what would be the index value of middle element? 9 Ans. 4
>>> str1 = “helloworld” name="Kendriya Vidyalaya Class 12"  Index value of a string can be in float. (T/F) Ans. False
>>> str1[ : -1] print(name[9:15])  What type of error is returned by following statement, if the length of string 'str1' is 10.
a). 'dlrowolleh' b).‘hello’ Ans Vidyal print(str1[13]) Ans. Index error
c).‘world’ d).'helloworl' Ans (a)
Given the lists A list is declared as
L=[1,30,67,86,23,15,37,131,9232] , write the Lst = [1,2,3,4,5,6,8] Tuple: 1 mark Questions
output of What will be the value of sum(Lst)? Ans 29
print(L[3:7]) Ans [86, 23, 15, 37] A tuple is declared as Find the output from the following
Identify the valid declaration of L: If the following code is executed, what will be the t1=(1,2,3,3,5,6,5,6,7,3,8,9) code:
L = (‘Mon’, ‘23’, ‘hello’, ’60.5’) output of the following code? t=tuple()
what will be the value of t=t+(‘Python’,)
a). dictionary b). string c). tuple d). list name="Computer_Science_with_Python"
print(t1.count(3)) print(t)
Ans (c) print(name[-25:10])
Ans puter_S Ans 3 print(len(t))
How many times is the word ‘hello’ printed in Given the list ans
(‘Python’,)
the following statement? L=[1,3,6,82,5,7,11,92],
1
S=’python rocks’ write the output of
Suppose a tuple T is declared as Choose the correct way to access
for ch in s[3:8]: print(L[1:4:2]
T = "Yellow", 20, "Red" value 20 from the following tuple
print(‘hello’) Ans [3,82]
a, b, c = T
(i) 5 (ii) 6 print(a) aTuple = ("Orange", [10, 20, 30], (5, 15, 25))
(iii) 7 (iv) 4 Ans (i) which of the following is correct?
Given the string Identify the correct option to print the value 80 from (a) (‘Yellow’, 20, ‘Red’)
x="hello world", write the output of the list a) aTuple[1:2][1]
(b) TypeError b) aTuple[1:2](1)
print(x[:2],x[:-2]) L=[10,20,40,80,20,5,55] (c) Yellow c) aTuple[1][1]
Ans he hello wor (i) L[80] (ii) L[4] (iii) L[L] (iv) L[3] Ans (c)“Yellow” Ans (c) aTuple[1][1]
Ans (iv) L[3]
Suppose a tuple T is declared as Suppose a tuple T1 is declared as
if a=[5,4,3,2,2,2,1], Give the output of the following: T = (10, 12, 43, 39), T1 = (10, 20, 30, 40, 50)
evaluate the following expression: x="Marvellous" which of the following is Incorrect? which of the following is incorrect?
print( a[a[a[a[2]+1]]]) print( x[2:7], "and" , x[-4:-1] ) a) print(T[1]) b) print(max(T)) a) print(T[1]) b) T[2] = -29
Ans rvell and lou c) print(len(T)) d) None of the above c) print(max(T)) d) print(len(T))
Ans 2
Ans (d) Ans (b)
What is the output produce by the Is there any difference in ‘a’ or “a” in python?
following code? Suppose a tuple T is declared as Identify the data type of X:
Ans. No
alst=[1,2,3,4,5,6,7,8,9] T = (10, 12, 43, 39), X = tuple(list( (1,2,3,4,5) ) )
A string with zero character is called __________
print(alst[: :3]) string
which of the following is incorrect? a)Dictionary (b) string (c) tuple (d) list
Ans [1, 4, 7] a) print(T[1]) b) T[3] = 9 Ans tuple
Ans empty string c) print(max(T)) d) print(len(T))
Ans (b) because tuple is immutable. Find output Find output
A tuple is declared as (a,b,c)=(1,2,3) a,b,c,d=(1,2,3)
T = (20,5,16,29,83) Suppose a tuple T is declared as Ans this will assign 1 to a , 2 to b and 3 to c Ans Error becoz not enough values to
What will be the problem with the code T = (10, 20, 30, 40), pack(expected 4, got 3)
T[1]=100. what will be the output of Find output How can you add an extra element to a
Ans It will show error tuple is immutable. print(T*2) a, b, c, d, e = (p, q, r, s, t) = t1 tuple?
Ans 20,40,60,80 Ans If tuple t1 has 5 values then this will assign first Ans T=T+(9,)
t1=(2,3,4,5,6) What is the length of the tuple shown below? value of t1 in to a and p , next value to b and q and
print(t1.index(4)) t=(((('a',1),'b','c'),'d',2),'e',3)
so on.
output is Ans 3
a). 4 b). 5 c). 6 d). 2 Ans (d) 2 Which of the following will create a tuple x? What is the output of following line of code ?
A tuple is declared as T = (2,5,6,9,8) Which of the following statements will create (a) x = (1) (b). x = (1,) x= (2, 1, 4)
What will be the value of sum(T)? Ans 30 a tuple ? (c) . x = {1} (d) None of the above Ans (b) print(len(x)) Ans 3
(a) Tp1 = (“a”, “b”) (b) Tp1= (3) * 3 What is the output of following line of code? What is the output of following line of code?
(c) Tp1[2] = (“a”, “b”) (d) None of these x,y, z = (3.3, 4.1, 2.2) x,_, z = (3.3, 4.1, 2.2)
Ans (a) print(x) Ans 3.3 print(_) Ans 4.1
Find the output of the following: Identify the valid declaration of Rec: What is the output of following line of code ? What is the output of following line of code ?
>>>S = 1, (2,3,4), 5, (6,7) Rec=(1,‟Vikrant”,50000) _,_ = (3.3, 4.1, 2.2) x = (3.3, 4.1, 2.2) *2
>>> len(S) (i)List (ii)Tuple print(_) Ans Error print(x)
Ans 4 (iii)String (iv)Dictionary Ans (3.3, 4.1, 2.2, 3.3, 4.1,2.2)
Ans (ii) Tuple What is the output of following line of code? What is the output of following line of code?
A tuple is declared as Consider the tuple in python named x = (3.3, 3.3, 4.1, 4.1, 2.2, 2.2) x = (3.3, 3.3, 4.1, 4.1, 2.2, 2.2)
T = (1,2), (1,2,4), (5,3) DAYS=(”SUN”,”MON”,”TUES”) print(x.index(3.3)) Ans 0 print(x[0::2] == x[1::2]) Ans True
What will be the value of min(T) ? Ans (1,2) Identify the invalid statement(s) from the Which of the following method will not work with
given below statements:
Python tuple object?
a). S=DAYS[1] b). print(DAYS[2])
a). sort() b). count()
c). DAYS[0]=”WED” d). LIST=list(DAYS)
Ans (c) DAYS[0]=”WED” c). index() d). None of the above Ans (a)
Suppose a tuple Tup is declared as What is the output of the following code:
Tup = (12, 15, 63, 80), for i in range(-3,4,2):
which of the following is incorrect? print(i, end = '$')
Dictionary: 1 mark Questions
a) print(Tup[1]) b) Tup[2] = 90 What will be the result of the following code?
c) print(min(Tup)) d) print(len(Tup)) Ans -3$-1$ 1$ 3$ >>>d1 = {“abc” : 5, “def” : 6, “ghi” : 7}
Ans (b) Tup[2]=90 >>>print (d1[0])
If a is (1, 2, 3), what is the difference (if any) between If a is (1, 2, 3), is a *3 equivalent to a + a+ a? (a) abc (b) 5 (c) {“abc”:5} (d) Error Ans (d) Error
a*3 and [a, a, a]? Ans yes Which of the following statement create a dictionary?
Ans: a*3 is different from [a,a,a] because, a*3 will a) d = { }
produce a tuple (1,2,3,1,2,3,1,2,3) and [a, a, a] will b) d = {“john”:40, “peter”:45}
produce a list of tuples [(1,2,3),(1,2,3),(1,2,3)]. c) d = (40 : “john”, 45 : “peter”}
d) All of the above Ans (d) all of the above
Does a slice operator always produce a new Tuple? How is an empty Tuple created?
Which statement is correct for dictionary?
Ans: Yes Ans: T=() or T=tuple()
(i) A dictionary is a ordered set of key:value pair
How is a tuple containing just one element created? What is the difference between (30) and (ii) each of the keys within a dictionary must be unique
Ans: T=3, or T=(4,) (30,)? (iii) each of the values in the dictionary must be unique
Ans: (30) is an integer while (30,) is a tuple (iv) values in the dictionary are immutable
Predict the output Predict the output Ans (ii) each of the keys within a dictionary must be unique
G=’a’,’b’ T=(1,)*3 Which is the correct form of declaration of dictionary?
H=(‘a’,’b’) T[0]=2 (i) Day={1:’monday’,2:’tuesday’,3:’wednesday’}
print(G==H) Ans True print(T) (ii) Day=(1;’monday’,2;’tuesday’,3;’wednesday’)
Ans typeError. Tuple is immutable so can’t (iii) Day=[1:’monday’,2:’tuesday’,3:’wednesday’]
do changes (iv) Day={1’monday’,2’tuesday’,3’wednesday’]
Ans (i) Day={1:’monday’,2:’tuesday’,3:’wednesday’} MySQL- 1 mark questions
Declare a dictionary in python named QUAD having Keys(1,2,3,4) and
Values(“India”,”USA”,”Japan”,”Australia”)
Ans QUAD={1:”India”, 2:”USA”, 3:”Japan”, 4:”Australia”}
Write a statement in Python to declare a dictionary whose keys are 1,2,3 and values are Apple, Mango Which command is used to change the number of Which keyword is used to select rows containing
and Banana respectively. columns in a table? Ans ALTER column that match a wildcard pattern? Ans LIKE
Ans Dict={1:’Apple’, 2: ’Mango’,3 : ‘Banana’} Differentiate between Degree and Cardinality. All aggregate functions except ___________
Given Ans Degree – it is the total number of columns in ignore null values in their input collection.
employee={'salary':10000,'age':22,'name':'Mahesh'} the table. a) Count (attribute) b) Count (*)
employee.pop('age') Cardinality – it is the total number of tuples/Rows c) Avg () d) Sum ()
what is output in the table. Ans count(*)
print(employee) Ans {'salary':10000,'name':'Mahesh'}
Write the ouput of following code: Group functions can be applied to any numeric Which command is used to change the existing
d={'amit':19,'vishal':20} values, some text types and DATE values. information of table?
print(d.keys()) Ans dict_keys(['amit', 'vishal']) (True/False) Ans update
What will be output of following: Ans True
d = {1 : “SUM”, 2 : “DIFF”, 3 : “PROD”}
for i in d:
Expand the term: RDBMS Write an Aggregate function that is used in
print (i)
Ans Relational Database Management System MySQL to find No. of Rows in the database Table
a) 1 b) SUM c) 1 d) 3
Ans count(*)
2 DIFF SUM SUM
3 PROD 2 3
DIFF DIFF For each attribute of a relation, there is a set of In SQL, write the query to display the list of
3 3 permitted values, called the of that attribute. databases stored in MySQL.
PROD PROD a). Dictionaries b). Domain Ans show databases
Ans (a) c). Directory d). Relation
Write a statement in Python to declare a dictionary whose keys are ‘Jan’, ’Feb’, ’Mar’ and values are Ans (b) Domain
31, 28 and 31 respectively.
Ans Month={‘Jan’:31,’Feb’:28,’Mar’:31} Which is not a constraint in SQL? Which command is used to see the structure of
Write a statement in Python to declare a dictionary whose keys are 5, 8, 10 and values are May, August a) Unique b) Distinct c) Primary key d) check the table/relation.
and October respectively. Ans (b) Distinct a) view b) describe
Ans Dict= {5:"May", 8: "August", 10: "October"} c) show d) select
Write a code to add the following key-value to a given dictionary. Ans (b) describe
A={‘class’:’VI’, ‘Sec’:’B’,’Rollno’:1}
Key Value A virtual table is called a ............. Which clause is used to remove the duplicating
Fee Done Ans view rows of the table?
Route AB i) or ii) distinct iii) any iv)unique
Ans Ans (ii) distinct
A["Fee"]="Done"
A["Route"]="AB" Which clause is used in query to place the Which command is used for counting the number
Which of the following is the correct form of using dict()? condition on groups in MySql? of rows in a database?
i) where ii) having i) row ii) count
a) dict([('a' , 45), ('b', 78)])
iii) group by iv) none of the above iii) rowcount iv) row_count
b) dict({'a' : 45, 'b' :78}) Ans (ii) having Ans rowcount
c) dict('a'=45, 'b'=78)
d) All of these Ans (d) A Resultset is an object that is returned when a In SQL, name the clause that is used to place
a={1:10,2:20,3:30} cursor object is used to query a table. True/False condition on groups
(a) Write code to delete the second element using del command. Ans del(a[2]) Ans Having
(b) Write code to delete the third element using pop() function. Ans a.pop(3) Ans True
In SQL, which command is used to change the Which operator performs pattern matching in Identify the DDL Command. Which clause is used with a SELECT command in
structure of already created table. SQL? (i) Insert into command (ii) Create table SQL to display the records in ascending order of
Ans Alter table Ans Like command (iii) Drop table Command (iv) Delete an attribute?
command Ans Order by
What does the following function result into? In SQL, what are aggregate functions? Ans (ii) Create table command (iii) Drop table
count(field_name) Ans These functions work with data of multiple Command
Ans It returns the number of non-null records rows at a time and return a single value.
from the field. A relation has 45 tuples & 5 attributes, what will In SQL, which aggregate function is used to count
be the Degree & Cardinality of that relation? all records of a table?
How many Primary and Foreign keys can a table In SQL, write the name of the aggregate function a). Degree 5, Cardinality 45 Ans count(*)
have? which is used to calculate & display the average b). Degree 45, Cardinality 5
Ans Primary Key – 1 Foreign Key – Many of numeric values in an attribute of a relation. c). Degree 50, Cardinality 45
Ans AVG() d). Degree 50, Cardinality 2250
Ans (a) Degree 5, Cardinality 45
Write an SQL query to display all the attributes of What is the use of LIKE keyword in SQL?
a relation named “TEST” along with their Ans LIKE keyword is used to find matching CHAR Anita is executing sql query but not getting the Sunita executes following two statements but got
description. values with WHERE clause. appropriate output, help her to do the the variation in result 6 and 5 why?
Ans DESCRIBE TEST; or DESC TEST; correction. (i) select count(*) from user ;
Select name from teacher where subject=Null; (ii) select count(name) from user ;
Which of the following is NOT a DML command? What is the purpose of following SQL command: Ans Select name from teacher where subject is Ans
a). SELECT b). DELETE SHOW DATABASES; Null; Count(*) will count rows where as
c). UPDATE d). DROP Ans This command will print name of all the count(name) will count name column only which
Ans (d) DROP databases present in RDBMS. is having one null value.

Identify the error in the following SQL query In SQL, name the command/clause that is used to What is the difference between where and Write a command to add new column marks in
which is expected to delete all rows of a table display the rows in descending order of a column. having in SQL. table ‘student’ data type int.
TEMP without deleting its structure and write the Ans Order By …… Desc Ans Where is used apply condition in query, Ans Alter table student add marks int(3)
correct one: where as having is used only with group.
DELETE TABLE TEMP;
Ans DELETE FROM TEMP; Write query to display the structure of table In SQL, what is the use of BETWEEN operator?
teacher. Ans The BETWEEN operator selects values within
In SQL, what is the error in following query : Write any two aggregate functions used in SQL. Ans describe teacher or desc teacher a given range
SELECT NAME, SAL, DESIGNATION WHERE Ans max(),min(),avg(),count()
DISCOUNT=NULL; In SQL, name the clause that is used to display In SQL, what is the use of IS NULL operator?
Ans SELECT NAME,SAL,DESIGNATION WHERE the tuples in ascending order of an attribute. Ans To check if the column has null value / no
DISCOUNT IS NULL; Ans Orderby value

Which of the following is a DML command? In SQL, write the query to display the list of Write any one aggregate function used in SQL. Which of the following is a DDL command?
a) SELECT b) Update databases. Ans SUM / AVG / COUNT / MAX / MIN a) SELECT b) ALTER
c) INSERT d) All Ans SHOW DATABASES’ c) INSERT d) UPDATE
Ans (d) All Ans (b) ALTER

Which of the following will suppress the entry of A non-key attribute, whose values are derived In SQL, write the query to display the list of tables Which of the following types of table constraints
duplicate value in a column? from primary key of some other table. stored in a database will prevent the entry of duplicate rows?
a) Unique b) Distinct a). Alternate Key b). Foreign Key Ans Show tables; a) check b) Distinct
c) Primary Key d) NOT NULL c). Primary Key d). Candidate Key c) Primary Key d) NULL
Ans (b) Distinct Ans (b) foreign Key Ans (c) Primary Key
Which is known as range operator in MySQL. If column “salary” of table “EMP” contains the Rearrange the following transmission media in
a) IN b) BETWEEN dataset {10000, 15000, 25000, 10000, 25000}, increasing order of data transfer rates.
c) IS d) DISTINCT what will be the output of following SQL UTP CAT - 5 , UTP CAT – 6, IR, Bluetooth, OFC
Ans (b) BETWEEN statement? Ans IR, Bluetooth, UTP CAT - 5, UTP CAT – 6, OFC
SELECT SUM(DISTINCT SALARY) FROM EMP;
a) 75000 b) 25000
c) 10000 d) 50000
Ans (d) 50000 Networking – 1 mark Questions
_______________ is a network device that Give one example of each – Guided media and
Which of the following functions is used to find Name the clause used in query to place the
connects dissimilar networks. Unguided media
the largest value from the given data in MySQL? condition on groups in MySQL?
Ans Gateway Ans Guided – Twisted pair, Coaxial Cable, Optical
a) MAX ( ) b) MAXIMUM ( ) Ans having
Fiber (any one)
c) LARGEST ( ) d) BIG ( )
Unguided – Radio waves, Satellite, Micro Waves
Ans (a) MAX()
(any one)
Write SQL statement to find total number of Write command to list the available databases in
records in table EMP? MySQL. Ravi received a mail from IRS department on __________ is a specific condition in a network
Ans count(*) Ans show databases clicking “Click –Here”, he was taken to a site when more data packets are coming to network
designed to imitate an official looking website, device than they can handle and process at a
In SQL, name of the keyword used to display In SQL, what is the use of ORDER BY clause ? such as IRS.gov. He uploaded some important time. Ans Network Congestion
unique values of an attribute. Ans To display the values in sorted order information on it
Ans DISTINCT Ans Phishing

Write the function used in SQL to display current Which of the following is a DML command? Name the protocol that is used to transfer file Raj is a social worker, one day he noticed
date a) CREATE b)ALTER c) INSERT d) DROP from one computer to another. someone is writing insulting or demeaning
Ans curdate() Ans (c) insert Ans FTP comments on his post. What kind of Cybercrime
Raj is facing?
In SQL, write the command / query to display the Which of the following type of column Ans Identity Theft
structure of table ‘emp’ stored in a database. constraints will allow the entry of unique and not
Ans desc emp null values in the column? Name the Transmission media which consists of Write the expanded form of GPRS?
a) Unique b) Distinct an inner copper core and a second conducting Ans General Packet Radio Service (GPRS)
c) Primary Key d) NULL outer sheath.
Ans (c) Primary Key Ans Co-axial cable

In SQL, name the clause that is used to display In SQL, what is the use of <> operator? Define Bandwidth? --------------describe the maximum data transfer
the unique values of an attribute of a table. Ans not equal to Ans a band of frequencies used for sending rate of a network or Internet connection.
Ans distinct electronic signals Ans Bandwidth

Write any two aggregate function used in SQL Which of the following is/ are DML command(s)? Mahesh wants to transfer data within a city at What is a Firewall in Computer Network?
Ans max/min/avg/sum/count(*) a) SELECT b) ALTER very high speed. Write the wired transmission A). The physical boundary of Network
c) DROP d) UPDATE medium and type of network. B). An operating System of Computer Network
Ans (a) select (d) update Ans Wired transmission medium – Optical fiber C). A system designed to prevent unauthorized
cable access
In SQL, write the query to display the list Which of the following types of table constraints Type of network – MAN. D). A web browsing Software
databases. will not prevent NULL entries in a table? Ans
Ans show databases a) Unique b) Distinct C). A system designed to prevent unauthorized
c) Primary Key d) NOT NULL access.
Ans (c) Primary Key
Which of the following is not done by cyber Name the wired transmission media which has a Ans Telephone line, Twisted Pair Cable, Coaxial
criminals? higher bandwidth. Ans Optical Fiber Cable, Fiber Optics
a) Unauthorized account access
b) Mass attack using Trojans as botnets State whether the following statements is True or Expand the term a). XML b). SMS
c) Report vulnerability in any system False. When two entities are communicating and
d) Email spoofing and spamming do not want a third party to listen, this situation Ans
Ans (c) Report vulnerability in any system is defined as secure communication. (a) XML-Extensible Markup Language
Name the network device that connects Arrange the following media in decreasing order Ans True (b) SMS–Short Messaging Service
dissimilar networks. of transmission rates.
Ans Gateway Twisted Pair Cables, Optical Fiber, Coaxial Cables. Name two web scripting languages Which of these is not an example of unguided
Ans VBScript, JavaScript, ASP, PHP, PERL and JSP media?
Ans Optical Fiber, Coaxial Cables, Twisted Pair (i) Optical Fibre Cable (ii) Radio wave
Cables (iii) Bluetooth (iv) Satellite
Ans Optical Fiber( guided media or wired media)
Name the protocol used for remote login. Website incharge KABIR of a school is handling
Ans TELNET downloading/uploading various files on school What is HTML? Name the protocol that is used to upload and
website. Write the name of the protocol which is Ans HTML (Hyper Text Markup Language) is used download files on internet.
being used in the above activity. to create Hypertext documents (web pages) for Ans FTP or HTTP
Ans FTP websites.

What is its use of Data encryption in a network Give the full form of the following: Your friend kaushal complaints that somebody Which is not a network topology?
communication? (a) URL (b) TDMA accessed his mobile device remotely and deleted a)BUS b). STAR
Ans Data encryption is the process of converting Ans the important files. Also he claims that the c). LAN d). RING
a message into an unmeaningful form. It is used (a) URL – Uniform Resource Locator password of his social media accounts were Ans (c) LAN
to ensure data security while communication. (b)TDMA – Time Division Multiple Access changed. What crime was Manoj a victim of? Also
classify the crime on basis of it’s intent (malicious
Differentiate between Bps & bps. Identify the Guided and Un-Guided Transmission / non-malicious).
Ans Bps is Byte per second and Media out of the following: Ans The gaining of unauthorized access to data in
bps is bits per second which tells the variation in Satellite, Twisted Pair Cable, Optical Fiber, Infra- a system or computer is termed as hacking. It can
data transmission speed. Red waves be classified in two ways: (i) Ethical Hacking
Ans Guided: Twisted Pair Cable, Optical Fiber (ii)Cracking
Unguided: Satellite, Infra-Red waves
Which of the following appears harmless but Name the protocol that is used to send emails.
Protocol is used to send email ………… Your friend Sunita complaints that somebody has actually performs malicious functions such as Ans SMTP
Ans SMTP (simple mail transfer protocol) created a fake profile on Twitter and defaming deleting or damaging files.
her character with abusive comments and (a) WORM (b)Virus
pictures. Identify the type of cybercrime for these (c) Trojan Horse (d)Malware
situations. Ans (c) Trojan Horse
Ans Identity Theft
Your friend Ranjana complaints that somebody Name The transmission media best suitable for
Name the transmission media best suitable for Write the expanded form of VPN. has created a fake profile on Facebook and connecting to hilly areas
connecting to desert areas. Ans Virtual Private Network defaming her character with abusive comments Ans microwave/radiowave
Ans microwave and pictures. Identify the type of cybercrime for
these situations.
Rearrange the following terms in increasing order What is Telnet? Ans Cyber Stalking / Identity theft
of speedy medium of data transfer. Ans Telnet is an internet utility that lets us log on
Telephone line, Fiber Optics, Coaxial Cable, to a remote computer system. A user is able to Write the expanded form of Wi-Fi. TCP/IP stands for-
Twisted Paired Cable log in the system for sharing of files without Ans Wireless-Fidelity Ans Transmission Control Protocol/Internet
being the actual user of that system Protocol
An attack that encrypts files in a computer and Write the name of topology in which all the
only gets decrypted after paying money to the nodes are connected through a single Coaxial
attacker. cable?
a) Botnet b) Trojan Ans BUS totplogy
c) Ransomware d) Spam
Ans (c) Ransomware

Write full form of VoIP. Expand the term DHCP.


Ans voice over internet protocol Ans Dynamic Host Configuration Protocol

Name the protocol that is used for the transfer of In a Multi-National company Mr. A steals Mr. B’s
hypertext content over the web. intellectual work and representing it as A’s own
Ans HTTP work without citing the source of information,
which kind of act this activity be termed as?
Ans Plagiarism

Give at least two names for Guided and Unguided Write the expanded form of Wi-Fi and GSM
Transmission Media in networking. Ans
Ans Guided Media: Twisted pair Cable, Coaxial WiFi : Wireless Fidelity
Cable , Fiber Optic Cable GSM : Global System for Mobile Communication
Unguided Media: Microwave / Radio wave ,
Infrared, Satellite

Rearrange the following terms in increasing order Name the protocol that is used to transfer files.
of data transfer rates. Ans FTP
Gbps, Mbps, Tbps, Kbps, bps

Ans bps, Kbps, Mbps, Gbps, Tbps

Your friend’s mother receives an e-mail to access Name the fastest available transmission media.
the additional services of bank at zero cost from Ans Optical Fibre cable( OFC)
some agency asking her to fill her bank details
like credit card number and PIN in the form
attached to the mail. Identify the type of
cybercrime in this situation
Ans phishing

Write the expanded form of LAN & MAN.

Ans
Local Area Network .
Metropolitan Area Network

You might also like