Infosys Campus Connect - IT Branches (Batch 2 To 5) Quiz

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Infycc
I
Infycc
Community Contributor
Quizzes Created: 2 | Total Attempts: 541
| Attempts: 389 | Questions: 50
Please wait...
Question 1 / 50
0 %
0/100
Score 0/100
1.
 ……............. clause is used to pass on privileges to other users in database 

Explanation

The "grant option" clause is used to pass on privileges to other users in a database. This means that a user who has been granted a privilege with the "grant option" can then grant that same privilege to other users. This allows for the delegation of privileges and helps to manage access control in a database system.

Submit
Please wait...
About This Quiz
Infosys Campus Connect - IT Branches (Batch 2 To 5) Quiz - Quiz

This quiz is for Batch 2, 3, 4, 5 (IT branches) and contains 50 MCQ questions. All the best :)

2.
_____________refers to the correctness and completeness of the data in a database

Explanation

Data integrity refers to the correctness and completeness of the data in a database. It ensures that the data is accurate, consistent, and reliable. Data integrity is maintained through various mechanisms such as data validation rules, referential integrity constraints, and data quality checks. It is essential for ensuring the reliability and trustworthiness of the data stored in a database.

Submit
3.
A table column that contains values that are primary-key values in another table?

Explanation

A foreign key is a table column that contains values that are primary-key values in another table. It is used to establish a relationship between two tables in a database. The foreign key in one table refers to the primary key of another table, creating a link between the two tables. This allows for data integrity and helps maintain the referential integrity of the database.

Submit
4.
Which of the following function convert a String to a set in python?

Explanation

The function set(x) in Python converts a string to a set.

Submit
5.
Which method of cursor class is used to execute SQL query on database

Explanation

The execute() method of the cursor class is used to execute an SQL query on a database. This method allows you to pass an SQL statement as a parameter and execute it. It is commonly used to execute SELECT, INSERT, UPDATE, and DELETE statements.

Submit
6.
Find the name of cities with all entries whose temperature is in the range of 71 and 89

Explanation

The correct answer is "SELECT * FROM weather WHERE temperature BETWEEN 71 AND 89." This query will retrieve all entries from the weather table where the temperature is within the range of 71 and 89. The BETWEEN keyword is used to specify a range, and the AND keyword is used to specify the upper and lower bounds of the range.

Submit
7.
A table that displays data redundancies yields  ____________ anomalies

Explanation

A table that displays data redundancies can lead to insertion, deletion, and update anomalies. Data redundancies occur when the same data is repeated multiple times in a table, which can result in inconsistencies and errors when inserting, deleting, or updating data. These anomalies can cause data inconsistencies and make it difficult to maintain the integrity and accuracy of the data in the table.

Submit
8.
In which of the following is a single-entity instance of one type related to many entity instances of another type?

Explanation

A one-to-many relationship is when a single entity instance of one type is related to many entity instances of another type. This means that for every instance of the first entity, there can be multiple instances of the second entity associated with it.

Submit
9.
Which SQL keyword is used to sort the result-set?

Explanation

The SQL keyword "ORDER BY" is used to sort the result-set in ascending or descending order based on one or more columns. It is followed by the column(s) that should be used for sorting.

Submit
10.
To delete rows from table use command in SQL

Explanation

The correct answer is "Delete". In SQL, the "Delete" command is used to remove one or more rows from a table. It allows us to specify the condition for deleting the rows, such as deleting rows where a certain column value matches a specific criteria. The "Drop" command is used to remove an entire table, the "Rename" command is used to change the name of a table, and "All" is not a valid command in SQL.

Submit
11.
What data type is the object below ? L = [1, 23, 'hello', 1]

Explanation

The object L is a list because it is enclosed in square brackets and contains a sequence of elements separated by commas. Lists are a data type in Python that can hold multiple values of different types. In this case, the list contains the values 1, 23, 'hello', and 1.

Submit
12.
Suppose list1 is [3, 4, 15, 20, 5, 25, 1, 3], what is list1 after list1.pop(1)?

Explanation

After executing the code list1.pop(1), the element at index 1 (value 4) is removed from the list. The remaining elements are shifted to fill the gap, resulting in the updated list [3, 15, 20, 5, 25, 1, 3].

Submit
13.
The attribute that can not be divided into any other attributes is called ________

Explanation

A simple attribute is one that cannot be divided into any other attributes. It represents an atomic value and cannot be further decomposed.

Submit
14.
find the output of following statement: name = "snow storm"  print(name[6:8])

Explanation

The given statement assigns the string "snow storm" to the variable name. The expression name[6:8] is used to access a substring of name starting from index 6 and ending at index 8 (exclusive). This means it will access the characters at index 6 and 7. In the string "snow storm", the characters at index 6 and 7 are "t" and "o" respectively. Therefore, the output of the statement will be "to".

Submit
15.
Let F = {A → B, AB → E, BG → E, CD → I, E → C}. The closures, A+, (AE)+ and (ADE)+ will be

Explanation

The closure of A+ is ABCE, which means that A can produce ABCE. The closure of (AE)+ is ABCE, which means that AE can produce ABCE. The closure of (ADE)+ is ABCDEI, which means that ADE can produce ABCDEI. Therefore, the correct answer is ABCE, ABCE, ABCDEI.

Submit
16.
Which function removes an object from a list?

Explanation

The function list.remove(obj) is used to remove an object from a list. It takes the object as an argument and removes the first occurrence of that object from the list. This function modifies the original list and does not return any value.

Submit
17.
In the __________ normal form, a composite attribute is converted to individual attributes.

Explanation

In the First normal form, a composite attribute is converted to individual attributes. This means that instead of having a single attribute that contains multiple values, each value is separated into its own attribute. This helps to eliminate redundancy and improve data integrity.

Submit
18.
If a relation scheme is in BCNF then it is also in

Explanation

If a relation scheme is in BCNF (Boyce-Codd Normal Form), it means that it satisfies the criteria of BCNF, which includes the absence of any non-trivial functional dependencies where the determinant is not a superkey. This also implies that it satisfies the criteria of 3NF (Third Normal Form), which includes the absence of any transitive dependencies. Therefore, if a relation scheme is in BCNF, it is also in 3NF.

Submit
19.
The error displayed in the code shown below is: import itertools l1=(1, 2, 3) l2=[4, 5, 6] l=itertools.chain(l1, l2) print(next(l1))

Explanation

The error displayed in the code is that the 'tuple' object (l1) is not an iterator. The next() function is used to retrieve the next item from an iterator, but in this case, l1 is a tuple and not an iterator. Therefore, trying to call next(l1) will result in an error.

Submit
20.
Which of the following query is correct for using comparison operators in SQL?

Explanation

The correct answer is the second option: SELECT name, course_name FROM student WHERE age>50 and age " and "

Submit
21.
If two relations R and S are joined, then the non matching tuples of both R and S are ignored in

Explanation

When performing an inner join between two relations R and S, only the matching tuples from both R and S are included in the result. The non-matching tuples are ignored.

Submit
22.
class A():     def disp(self):         print("Text displayed") class B(A):     pass obj = B() obj.disp()

Explanation

The correct answer is "Text displayed" because the code defines a class A with a method disp that prints "Text displayed". Class B is then created as a subclass of A, inheriting the disp method. An object obj of class B is created and the disp method is called on it, resulting in the text "Text displayed" being printed.

Submit
23.
If a transaction acquires exclusive lock, then it can perform ………. operation.

Explanation

If a transaction acquires an exclusive lock, it means that it has exclusive access to the resource and no other transaction can access it. This allows the transaction to both read and write data, as it has full control over the resource. Therefore, the correct answer is "read and write".

Submit
24.
What is the output of the following code? class Demo:     def __init__(self):         self.a = 1         self.__b = 1       def display(self):         return self.__b obj = Demo() print(obj.a)

Explanation

The code defines a class called Demo with an __init__ method that initializes two attributes, a and __b. The class also has a display method that returns the value of __b. An object of the Demo class is created and assigned to the variable obj. The code then prints the value of obj.a, which is 1. Since there are no errors in the code and the value of obj.a is printed correctly, the correct answer is "The program runs fine and 1 is printed."

Submit
25.
The statement that is executed automatically by the system as a side effect of the modification of the database is

Explanation

A trigger is a statement that is automatically executed by the system when a specific event occurs, such as a modification of the database. It is used to enforce certain actions or constraints, and is often used to maintain data integrity or perform additional tasks related to the modification. In this case, the trigger is executed as a side effect of the modification of the database, making it the correct answer.

Submit
26.
What type of join is needed when you wish to include rows that do not have matching values?

Explanation

An outer join is needed when you wish to include rows that do not have matching values. An outer join returns all the rows from one table and the matching rows from another table, and if there is no match, it will still return the unmatched rows from one table. Equi-join and natural join only return the matching rows, while an outer join includes all rows. Therefore, the correct answer is outer join.

Submit
27.
A functional dependency between two or more non-key attributes is called

Explanation

A functional dependency between two or more non-key attributes is called a transitive dependency. This means that there is a relationship between these attributes where one attribute determines the value of another attribute, and that attribute in turn determines the value of another attribute. In other words, the dependency "transfers" from one attribute to another through a chain of dependencies.

Submit
28.
What is the output ? sets = {3, 4, 5} sets.update([1, 2, 3]) print(sets)

Explanation

The output of the code is {1, 2, 3, 4, 5}. The sets.update() method adds the elements from the given iterable (in this case, [1, 2, 3]) to the set. Since sets are unordered collections, the order of the elements in the output may vary. However, all the elements from the given iterable will be added to the set.

Submit
29. Identify the output of following statements :
boxes = {} jars = {} crates = {} boxes['cereal'] = 1 boxes['candy'] = 2 jars['honey'] = 4 crates['boxes'] = boxes crates['jars'] = jars print(len(crates[boxes]))

Explanation

The code initializes three empty dictionaries: boxes, jars, and crates. Then, it assigns the value 1 to the key 'cereal' in the boxes dictionary and the value 2 to the key 'candy'. It also assigns the value 4 to the key 'honey' in the jars dictionary. Next, it assigns the boxes dictionary to the key 'boxes' in the crates dictionary, and the jars dictionary to the key 'jars'. Finally, it prints the length of crates[boxes]. Since boxes is a dictionary, crates[boxes] will raise a KeyError because it is looking for the key 'boxes' within the crates dictionary, not the variable boxes. Therefore, the output will be 2.

Submit
30.
In Triggers, action is executed when

Explanation

In triggers, an action is executed when an event occurs. This means that the action is triggered or initiated by the occurrence of a specific event. The condition may also play a role in determining whether the action should be executed or not, but the primary factor is the occurrence of the event.

Submit
31.
Advantages of Views are

Explanation

The advantages of views include security, query reusability, and abstraction - hiding data. Views provide a layer of security by allowing users to access only the data they are authorized to see. They also allow queries to be reused, saving time and effort in writing the same query multiple times. Additionally, views provide abstraction by hiding the underlying data structure, making it easier to work with and understand the data. Therefore, all of these advantages apply to views.

Submit
32.
Which of the following is the correct syntax for creating a VARRAY named grades, which can hold 100 integers, in a PL/SQL block?

Explanation

The correct syntax for creating a VARRAY named grades, which can hold 100 integers, in a PL/SQL block is "TYPE grades IS VARRAY(100) OF INTEGER;".

Submit
33.
What is the output of the following piece of code? class A:     def test(self):         print("test of A called") class B(A):     def test(self):         print("test of B called")         super().test()  class C(A):     def test(self):         print("test of C called")         super().test() class D(B,C):     def test2(self):         print("test of D called")      obj=D() obj.test()

Explanation

The output of the code is "test of B called, test of C called, test of A called". This is because the class D inherits from both class B and class C, and both of these classes have a method named "test". When the method "test" is called on an object of class D, it first looks for the method in class D itself. Since class D does not have a method named "test", it then looks for the method in class B. Class B has a method named "test" which is called first and it prints "test of B called". After that, the method "test" is called on the object of class D again, but this time it looks for the method in class C. Class C has a method named "test" which is called next and it prints "test of C called". Finally, the method "test" is called on the object of class D one more time, but this time it looks for the method in class A. Class A has a method named "test" which is called last and it prints "test of A called".

Submit
34.
A type of query that is placed within a WHERE and HAVING clause of another query is called

Explanation

A subquery is a type of query that is placed within a WHERE or HAVING clause of another query. It is used to retrieve data from one table based on the result of another query. The subquery is executed first and its result is used by the outer query to perform further operations or filtering. It helps in breaking down complex queries into smaller, more manageable parts and allows for more flexibility in retrieving specific data.

Submit
35.
Which of the following statement on the view concept in SQL is invalid?

Explanation

The statement "The definition of a view should not have GROUP BY clause in it" is invalid because views can have a GROUP BY clause in their definition. The GROUP BY clause is used to group rows based on a specific column or expression in order to perform aggregate functions on the grouped data. This allows for more complex queries and analysis to be performed on the view.

Submit
36. What is the output of the program : 
class Account:     def __init__(self, id):         self.id = id         id = 666 acc = Account(123) print(acc.id)

Explanation

The program creates a class called Account with an __init__ method that takes an id parameter. Inside the __init__ method, the id attribute of the object is set to the value of the id parameter. Then, a local variable id is created and assigned the value 666, but it does not affect the id attribute of the object. Finally, an instance of the Account class is created with the id parameter set to 123. When the print statement is executed, it prints the value of the id attribute of the acc object, which is 123. Therefore, the output of the program is 123.

Submit
37.
The common column is eliminated in

Explanation

In a natural join, the common column(s) between two tables are used to match and combine the rows from both tables. The common column is eliminated in the resulting joined table because it is redundant information. The natural join only includes the columns that are unique to each table, ensuring that there are no duplicate columns in the joined table.

Submit
38.
In python , When will the else part of try-except-else be executed?

Explanation

The else part of the try-except-else block in Python will be executed when no exception occurs. This means that if the code inside the try block runs successfully without any errors or exceptions, then the else block will be executed.

Submit
39.
Which of the following operators has its associativity from right to left?  

Explanation

The operator with right-to-left associativity is the exponentiation operator (**). This means that when there are multiple exponentiation operators in an expression, the calculation is performed from right to left. For example, in the expression 2 ** 3 ** 2, the calculation is performed as 2 ** (3 ** 2), resulting in 2 ** 9.

Submit
40.
Which Of The Following Statements Is Most Accurate For The Declaration X = Circle()?

Explanation

The correct answer is "x contains a reference to a Circle object." This is because when we declare X = Circle(), we are creating a new instance of the Circle class and assigning it to the variable X. In this case, X does not contain the actual Circle object itself, but rather a reference to it in memory. This means that X can be used to access and manipulate the properties and methods of the Circle object.

Submit
41.
Which of the following SQL query is correct for selecting the name of staffs from 'staffinfo' table where salary is 10,000 or 25,000?

Explanation

The correct answer is "SELECT name FROM staffinfo WHERE salary IN (10000, 25000)". This query selects the name of staffs from the 'staffinfo' table where the salary is either 10,000 or 25,000. The IN operator is used to specify multiple values for a column, and in this case, it is used to check if the salary is either 10,000 or 25,000.

Submit
42.
Which of these is a private data field? def Demo: def __init__(self):     __a = 1     self.__b = 1     self.__c__ = 1     __d__= 1

Explanation

The correct answer is __b. In Python, a private data field is indicated by starting the variable name with two underscores (__). In the given code, __b is a private data field because it starts with two underscores. __a, __c__, and __d__ are not private data fields because they either have only one underscore or have underscores at the end of the variable name.

Submit
43.
What is the output? f = None for i in range (5):     with open("data.txt", "w") as f:         if i > 2:             break print(f.closed)  

Explanation

The output of the code will be True. This is because the "with open" statement opens the file "data.txt" in write mode and assigns it to the variable f. Since the file is successfully opened, f.closed will return True. The for loop runs 5 times, but when i becomes greater than 2, the break statement is executed and the loop is terminated. However, since the file was opened outside of the loop, it remains open and f.closed still returns True.

Submit
44.
What is the output of the following piece of code? class A:     def __str__(self):         return '1' class B(A):     def __init__(self):         super().__init__() class C(B):     def __init__(self):         super().__init__() def main():     obj1 = B()     obj2 = A()     obj3 = C()     print(obj1, obj2,obj3) main()

Explanation

The code defines three classes: A, B, and C. Class A has a __str__ method that returns the string '1'. Class B inherits from A and has an __init__ method that calls the super().__init__() method. Class C inherits from B and also has an __init__ method that calls the super().__init__() method. The main function creates objects of classes B, A, and C. When the objects are printed, the __str__ method of class A is called, which returns '1'. Therefore, the output of the code is '1 1 1'.

Submit
45.
What is the output of the following code? class Demo:     def_init_(self):           self.x=1    def change(self):          self.x=10  class Demo_derieved(Demo):         def change (self):         self.x=self.x+1         return self.x def main():         obj = Demo_derieved ()        print (obj.change()) main()  

Explanation

The code provided will throw an exception because there is a syntax error in the code. The "__init__" method in the "Demo" class is not properly defined. It should be "__init__" instead of "_init_". Therefore, when the "Demo_derieved" class tries to inherit from the "Demo" class and calls the "change" method, it will throw an exception.

Submit
46.
What is true about indexes?

Explanation

not-available-via-ai

Submit
47.
Study the code import cx_Oraclecon = cx_Oracle.connect('pythonhol/welcome@localhost/orcl')cur = con.cursor()cur.execute('select * from employee')     Which code snippet will print all the reterived records

Explanation

The correct answer is "for result in cur: print result". This code snippet uses a for loop to iterate over the cursor object "cur" and print each result.

Submit
48.
count = 1 def doThis(): count = 1 for i in (1, 2, 3): count += 1 doThis() print count

Explanation

The code defines a function called "doThis" which initializes a local variable "count" to 1. Then, a for loop iterates over the tuple (1, 2, 3) and increments the "count" variable by 1 for each iteration. However, the "doThis" function is never called in the code. Therefore, the value of "count" remains 1. Finally, the value of "count" is printed, which is 1.

Submit
49.
a = True b = False c = False if a or b and c: print "IF" else: print "ELSE"

Explanation

The correct answer is "IF" because the condition in the if statement is evaluated as true. The condition is "a or b and c", which means that if either a is true or both b and c are true, the condition is true. In this case, a is true, so the condition is true and the code inside the if block is executed, which prints "IF".

Submit
50.
What is the output of the following code? a = {} a [2]=1 a [1]={2,3,4} print (a[1][1])  

Explanation

The code initializes an empty dictionary "a". Then, it assigns the value 1 to key 2 in dictionary "a". Next, it assigns a list [2, 3, 4] to key 1 in dictionary "a". Finally, it prints the value at index 1 in the list associated with key 1 in dictionary "a", which is 3.

Submit
View My Results

Quiz Review Timeline (Updated): Jan 31, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Jan 31, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Dec 07, 2018
    Quiz Created by
    Infycc
Cancel
  • All
    All (50)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
 ……............. clause is used to pass on...
_____________refers to the correctness and completeness of the data in...
A table column that contains values that are primary-key values in...
Which of the following function convert a String to a set in python?
Which method of cursor class is used to execute SQL query on database
Find the name of cities with all entries whose temperature is in the...
A table...
In which of the following is a single-entity instance of one type...
Which SQL keyword is used to sort the result-set?
To delete rows from table use command in SQL
What data type is the object below ? L = [1, 23, 'hello', 1]
Suppose list1 is [3, 4, 15, 20, 5, 25, 1, 3], what is list1 after...
The attribute that can not be divided into any other attributes is...
Find the output of following statement: name = "snow...
Let F = {A → B, AB → E, BG → E, CD → I, E →...
Which function removes an object from a list?
In the __________ normal form, a composite attribute is converted to...
If a relation scheme is in BCNF then it is also in
The error displayed in the code shown below is: ...
Which of the following query is correct for using comparison operators...
If two relations R and S are joined, then the non matching tuples of...
Class A(): ...
If a transaction acquires exclusive lock, then it can perform...
What is the output of the following code? ...
The statement that is executed automatically by the system as a side...
What type of join is needed when you wish to include rows that do not...
A functional dependency between two or more non-key...
What is the output ? ...
Identify the output of following statements : ...
In Triggers, action is executed when
Advantages of Views are
Which of the following is the correct syntax for creating a VARRAY...
What is the output of the following piece of code? ...
A type of query that is placed within a WHERE and HAVING...
Which of the following statement on the view concept in SQL is...
What is the output of the program :  ...
The common column is eliminated in
In python , When will the else part of try-except-else be executed?
Which of the following operators has its associativity from right to...
Which Of The Following Statements Is Most Accurate For The Declaration...
Which of the following SQL query is correct for selecting the name of...
Which of these is a private data field? ...
What is the output? ...
What is the output of the following piece of code? ...
What is the output of the following code? ...
What is true about indexes?
Study the code import cx_Oraclecon =...
Count = 1 ...
A = True ...
What is the output of the following code? ...
Alert!

Advertisement