MySQL Questions And Answers

General MySQL Quiz 2





Q 11 - SQL permits attribute names to be repeated in the same relation. (True or False)

A ) True

B ) 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?

A ) Restrict

B ) Project

C ) Difference

D ) A and C

E ) None of the above

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?

A ) Revoke

B ) Generate

C ) Always

D ) Join

E ) Virtual

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?

A ) Alter, Drop

B ) Delete Column

C ) Truncate Column

D ) Delete Column

Answer : A

Q 15 - What command is used to shuffle a list ‘L’?

A ) L.shuffle()

B ) random.shufflelist(L)

C ) shuffle(L)

D ) random.Shuffle(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()

A ) ‘Its an Exception!’

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'}?

A ) Tuple(''abc'')

B ) List(''abc'')

C ) Set(''abac'')

D ) None of the above.

Answer : D

Explanation

Set does not allow the repetitive values in it and it separated each value present under a string.

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 ?

A ) Window.eventloop()

B ) Window.mainloop()

C ) Window.loop()

D ) Eventloop.window()

Answer : B

Q 20 - What is the value of a, b, c in the given below code?

a, b = c = 2 + 2, ''SenGideons''

A ) a=4, 'SenGideons'

b= 4, 'SenGideons'

c= 4, 'SenGideons'

B ) a=2

b= 'SenGideons'

c=4, 'SenGideons'

C ) a=4

b= 'SenGideons'

c=4, 'SenGideons'

D ) a=4

b= 'SenGideons'

c= NULL.

Answer : C

mysql_questions_answers_2.html

Advertisements

Post a Comment

0 Comments