General MySQL Quiz 2
Q 11 - SQL permits attribute names to be repeated in the same relation. (True or False)
Answer : B
Explanation
In SQL, attribute names must be unique within a relation. A relation is essentially a table, and each column in a table corresponds to an attribute.
Q 12 - The relational operator that works on one table at a time is?
Answer : A
Explanation
The Restrict operation selects a subset of rows from a table that satisfy a given condition. It operates on a single table and returns a new table with only the rows that meet the specified criteria. The Project and Difference operations, on the other hand, can work on multiple tables at the same time to produce a new table with different columns or rows.
Q 13 - Which of the following keyword is not in mysql?
Answer : B
Explanation
MySQL does not have a GENERATE keyword. However, it does have a similar keyword called "AUTO_INCREMENT" that can be used to generate unique values for a column in a table. The other keywords, namely REVOKE, ALWAYS, JOIN, and VIRTUAL are all valid keywords in MySQL.
Q 14 - The command used to delete a particular column in a relation a relation is?
Answer : A
Q 15 - What command is used to shuffle a list ‘L’?
Answer : D
Explanation
To shuffle the list we use random.shuffle(List_name) function.
Q 16 - Guess the output −
def main(): try: func() print(''print this after function call'') except ZeroDivisionError: print('Divided By Zero! Not Possible! ') except: print('Its an Exception!') def func(): print(1/0) main()
B ) ‘Divided By Zero! Not possible!’
C ) ‘print this after function call’ followed by ‘Divided By Zero! Not Possible!’
D ) ‘print this after function call’ followed by ‘Its an Exception!’
Answer : B
Explanation
The function ‘func’ will not run because it contains an exception. So in try and expect block. The function called under try will not run and will move to except block which defines the type of exception present in the function ‘func’. Thus block of statements present in except ZeroDivisionError is printed.
Q 17 - Which among them will produce {'a', 'b', 'c'}?
Answer : D
Explanation
Set does not allow the repetitive values in it and it separated each value present under a string.
Q 18 - Select the correct code to create a check button under parent frame1 and it should be bind to v1?
A ) CheckButton(frame1, text=''Bold'' , command=CheckButton)
B ) Checkbutton(frame1 , text=''Bold’’ ,variable=v1 ,command=processCheckbutton)
C ) Checkbutton(frame1,text=''Bold'',variable=v1.set(),command=v1.set(processCheckbut ton)
D ) Checkbutton(frame.set(f1) ,text.set(''bold'') ,command=v1.set(processCheckbutton)
Answer : B
Explanation
Checkbutton method is used to make a checkbox. In the parameters we need to pass the values as asked in the question. Here it should bind to v1 thus variable is set to v1 and frame should be under frame1 thus frame1 mentioned in the code.
Q 19 - Which way among them is used to create an event loop ?
Answer : B
Q 20 - What is the value of a, b, c in the given below code?
a, b = c = 2 + 2, ''SenGideons''
b= 4, 'SenGideons'
c= 4, 'SenGideons'
b= 'SenGideons'
c=4, 'SenGideons'
b= 'SenGideons'
c=4, 'SenGideons'
b= 'SenGideons'
c= NULL.
0 Comments