Software Development Exam  >  Software Development Tests  >  Database Management System (DBMS)  >  Test: Data Storage and Querying - 1 - Software Development MCQ

Test: Data Storage and Querying - 1 - Software Development MCQ


Test Description

15 Questions MCQ Test Database Management System (DBMS) - Test: Data Storage and Querying - 1

Test: Data Storage and Querying - 1 for Software Development 2024 is part of Database Management System (DBMS) preparation. The Test: Data Storage and Querying - 1 questions and answers have been prepared according to the Software Development exam syllabus.The Test: Data Storage and Querying - 1 MCQs are made for Software Development 2024 Exam. Find important definitions, questions, notes, meanings, examples, exercises, MCQs and online tests for Test: Data Storage and Querying - 1 below.
Solutions of Test: Data Storage and Querying - 1 questions in English are available as part of our Database Management System (DBMS) for Software Development & Test: Data Storage and Querying - 1 solutions in Hindi for Database Management System (DBMS) course. Download more important topics, notes, lectures and mock test series for Software Development Exam by signing up for free. Attempt Test: Data Storage and Querying - 1 | 15 questions in 30 minutes | Mock test for Software Development preparation | Free important questions MCQ to study Database Management System (DBMS) for Software Development Exam | Download free PDF with solutions
Test: Data Storage and Querying - 1 - Question 1

Which of the following is true about primary memory in a computer system?

Detailed Solution for Test: Data Storage and Querying - 1 - Question 1

Primary memory, also known as main memory or RAM, is volatile and provides temporary storage for data and program instructions.

Test: Data Storage and Querying - 1 - Question 2

Which of the following is NOT a data storage device?

Detailed Solution for Test: Data Storage and Querying - 1 - Question 2

The CPU is not a data storage device. It is the primary component responsible for executing instructions and performing calculations in a computer system.

1 Crore+ students have signed up on EduRev. Have you? Download the App
Test: Data Storage and Querying - 1 - Question 3

Which of the following indexing techniques is commonly used for fast searching in a database?

Detailed Solution for Test: Data Storage and Querying - 1 - Question 3

B-tree indexing is commonly used for fast searching in a database. It organizes data in a balanced tree structure, allowing efficient retrieval based on the indexed key values.

Test: Data Storage and Querying - 1 - Question 4

What is the purpose of indexing in a database management system?

Detailed Solution for Test: Data Storage and Querying - 1 - Question 4

Indexing in a database management system is used to improve data storage efficiency and retrieval speed by creating a separate data structure that enables faster searching and access to specific data.

Test: Data Storage and Querying - 1 - Question 5

In a hash table, collisions can occur when two different keys hash to the same:

Detailed Solution for Test: Data Storage and Querying - 1 - Question 5

In a hash table, collisions occur when two different keys hash to the same bucket. A bucket is a container that holds elements with the same hash value.

Test: Data Storage and Querying - 1 - Question 6

my_list = [1, 2, 3, 4, 5]
print(my_list[3])
What will be the output of the above code?

Detailed Solution for Test: Data Storage and Querying - 1 - Question 6

The code prints the element at index 3 in the list my_list, which is 4.

Test: Data Storage and Querying - 1 - Question 7

my_dict = {'name': 'John', 'age': 25}
print(my_dict.get('gender'))
What will be the output of the above code?

Detailed Solution for Test: Data Storage and Querying - 1 - Question 7

The code attempts to retrieve the value associated with the key 'gender' from the dictionary my_dict using the get() method. Since the key does not exist in the dictionary, it returns None.

Test: Data Storage and Querying - 1 - Question 8

my_set = {1, 2, 3, 4, 5}
my_set.add(3)
print(len(my_set))
What will be the output of the above code?

Detailed Solution for Test: Data Storage and Querying - 1 - Question 8

The code adds the value 3 to the set my_set. However, since sets only store unique elements, the duplicate value is not added. Therefore, the length of my_set remains 4.

Test: Data Storage and Querying - 1 - Question 9

my_tuple = (1, 2, 3)
print(my_tuple[1:])
What will be the output of the above code?

Detailed Solution for Test: Data Storage and Querying - 1 - Question 9

The code prints a slice of the tuple my_tuple starting from index 1. The slice [1:] includes all elements from index 1 to the end, resulting in (2, 3).

Test: Data Storage and Querying - 1 - Question 10

my_string = "Hello, World!"
print(my_string.lower())
What will be the output of the above code?

Detailed Solution for Test: Data Storage and Querying - 1 - Question 10

The lower() method is used to convert all characters in a string to lowercase. The code converts the string my_string to lowercase, resulting in "hello, world!".

Test: Data Storage and Querying - 1 - Question 11

employees = [
    {'name': 'John', 'age': 25, 'department': 'Sales'},
    {'name': 'Emma', 'age': 30, 'department': 'HR'},
    {'name': 'Mike', 'age': 35, 'department': 'IT'}
]

department_names = [employee['department'] for employee in employees]
department_set = set(department_names)

print(len(department_set))
What will be the output of the above code?

Detailed Solution for Test: Data Storage and Querying - 1 - Question 11

The code creates a list of department names by extracting the 'department' value from each employee dictionary in the employees list. The department names are then converted into a set to eliminate duplicates. The length of the set department_set is 3.

Test: Data Storage and Querying - 1 - Question 12

def hash_function(key):
    return key % 5

hash_table = [[] for _ in range(5)]
keys = [15, 7, 22, 3, 12]

for key in keys:
    index = hash_function(key)
    hash_table[index].append(key)

print(hash_table)
What will be the output of the above code?

Detailed Solution for Test: Data Storage and Querying - 1 - Question 12

The code demonstrates hash table implementation using a hash function that performs modulo division. Each key from the keys list is hashed, and the resulting index is used to append the key to the corresponding bucket in the hash_table.

Test: Data Storage and Querying - 1 - Question 13

class Student:
    def __init__(self, name, roll_number):
        self.name = name
        self.roll_number = roll_number

students = [Student('John', 1), Student('Emma', 2), Student('Mike', 3)]
student_dict = {student.roll_number: student for student in students}

print(student_dict[2].name)
What will be the output of the above code?

Detailed Solution for Test: Data Storage and Querying - 1 - Question 13

The code creates instances of the Student class and stores them in a dictionary student_dict with the 'roll_number' as the key. The code accesses the student with a roll number of 2 (student_dict[2]) and prints its name, which is 'Emma'.

Test: Data Storage and Querying - 1 - Question 14

class Database:
    def __init__(self):
        self.data = []

    def insert(self, value):
        self.data.append(value)

    def search(self, value):
        return value in self.data

db = Database()
db.insert(10)
db.insert(20)
db.insert(30)

print(db.search(20))
What will be the output of the above code?

Detailed Solution for Test: Data Storage and Querying - 1 - Question 14

The code defines a Database class with insert() and search() methods. An instance of the class db is created, and values are inserted into the data list using the insert() method. The search() method is then used to check if the value 20 exists in the data list, returning True.

Test: Data Storage and Querying - 1 - Question 15

import hashlib

def hash_string(s):
    return hashlib.md5(s.encode()).hexdigest()

hash_table = [[] for _ in range(5)]
keys = ['apple', 'banana', 'cherry', 'date']

for key in keys:
    index = int(hash_string(key), 16) % 5
    hash_table[index].append(key)

print(hash_table)
What will be the output of the above code?

Detailed Solution for Test: Data Storage and Querying - 1 - Question 15

The code demonstrates hash table implementation using the MD5 hashing algorithm. The hash_string() function converts a string into its MD5 hash. The keys from the keys list are hashed, and the resulting hash values are converted to integers and used as indices to append the keys to the appropriate buckets in the hash_table.

75 videos|44 docs
Information about Test: Data Storage and Querying - 1 Page
In this test you can find the Exam questions for Test: Data Storage and Querying - 1 solved & explained in the simplest way possible. Besides giving Questions and answers for Test: Data Storage and Querying - 1, EduRev gives you an ample number of Online tests for practice

Top Courses for Software Development

Download as PDF

Top Courses for Software Development