About Programming MCQs

Programming is the cornerstone of computer science and IT. MCQs on this subject test your understanding of syntax, logic, data structures, and algorithms across various programming languages. Whether you are preparing for a university exam or a technical job interview, these questions will sharpen your problem-solving skills.

Topics Covered in This Category

  • Language Fundamentals: C, C++, Java, Python, and PHP basics.
  • Data Structures: Arrays, linked lists, stacks, queues, trees, and graphs.
  • Algorithms: Sorting, searching, recursion, and time complexity.
  • Object-Oriented Programming (OOP): Classes, objects, inheritance, polymorphism, and encapsulation.

Study Tips for Programming MCQs

Programming is best learned by doing. Do not just read the code; type it out and run it. Trace algorithms on paper to understand how variables change. When solving MCQs, pay attention to subtle syntax errors, loop conditions, and array indices, as these are common traps in exams.

Question 51: Which command(s) is(are) used to enable/disable/drop an integrity constraint in SQL?

  • A ALTER TABLE
  • B All of the above
  • C MODIFY TABLE
  • D DEFINE TABLE
  • E None of the above

Explanation: The correct answer to the question is: ALTER TABLE

Question 52: Which command is used to select distinct subject (SUB) from the table (BOOK)?

  • A SELECT SUB FROM BOOK
  • B SELECT DISTINCT SUB FROM BOOK
  • C None of the above
  • D SELECT ALL FROM BOOK
  • E All of the above

Explanation: The correct answer to the question is: SELECT DISTINCT SUB FROM BOOK

Question 53: Which two files are used during operation of the DBMS?

  • A data dictionary and transaction log
  • B query language and utilities
  • C data dictionary and query language
  • D data manipulation language and query language
  • E None of the above

Explanation: The correct answer to the question is: data dictionary and transaction log

Question 54: A form can be used to

  • A None of the above
  • B modify records
  • C delete records
  • D All of the above
  • E format printed output

Explanation: The correct answer to the question is: All of the above

Question 55: In a _____ a parent record type can be linked to one or more "child" record types, but a child record type can have only one parent.

  • A None of the above
  • B Relational database
  • C Hierarchical database
  • D Network database
  • E Distributed database

Explanation: The correct answer to the question is: Hierarchical database

Question 56: Long-range planning report produced in an MIS are primarily designed for

  • A top management
  • B All of the above
  • C None of the above
  • D lower management
  • E middle management

Explanation: The correct answer to the question is: top management

Question 57: A database management system might consist of application programs and a software package called

  • A TOTAL
  • B BPL
  • C AUTOFLOW
  • D FORTRAN
  • E None of the above

Explanation: The correct answer to the question is: BPL

Question 58: The _____ command is used to allocates an extent for the table in SQL

  • A MODIFY ALLOCATES
  • B ALTER TABLE
  • C None of the above
  • D MODIFY TABLE
  • E REDEFINE TABLE

Explanation: The correct answer to the question is: MODIFY ALLOCATES

Question 59: In SQL, which command(s) is(are) used to enable/disable a database trigger?

  • A ALTER DATABASE
  • B ALTER TABLE
  • C ALTER TRIGGER
  • D All of the above
  • E MODIFY TRIGGER

Explanation: The correct answer to the question is: ALTER TRIGGER

Question 60: The physical location of a record is determined by a mathematical formula that transforms a file key into a record location in

  • A a hashed file
  • B a tree file
  • C a sequential file
  • D an indexed file
  • E None of the above

Explanation: The correct answer to the question is: a hashed file

Question 61: A large computer information system maintains many different computer files. Which amongst them is called a perpetual file?

  • A None of the above
  • B Update file
  • C Specialized file
  • D Log file
  • E Master file

Explanation: The correct answer to the question is: Master file

Question 62: In SQL, the CREATE TABLE is used

  • A to redefine a column
  • B to create a table, defining its columns, integrity constrains, and storage allocation
  • C All of the above
  • D to add a column/integrity constraint to a table
  • E to change a table's storage characteristics

Explanation: The correct answer to the question is: to create a table, defining its columns, integrity constrains, and storage allocation

Question 63: When performing a look-up operation using a form

  • A None of the above
  • B you type the key in an entry line, and the correct form is displayed
  • C you look at each form sequentially until you see the one you want
  • D you enter the search value into the form
  • E All of the above

Explanation: The correct answer to the question is: you enter the search value into the form

Question 64: Data security threats include

  • A None of the above
  • B privacy invasion
  • C fraudulent manipulation of data
  • D hardware failure
  • E All of the above

Explanation: The correct answer to the question is: privacy invasion

Question 65: In SQL, which command is used to create a database user?

  • A All of the above
  • B ADD USER TO DATABASE
  • C CREATE USER
  • D None of the above
  • E MK USER

Explanation: The correct answer to the question is: CREATE USER

Question 66: An audit trail

  • A is used to make back-up copies
  • B can be used to restore lost information
  • C None of the above
  • D All of the above
  • E is the recorded history of operations performed on a file

Explanation: The correct answer to the question is: is the recorded history of operations performed on a file

Question 67: The files stored on a secondary stage device are composed of a hierarchy of data. What does a record in a file contain?

  • A None of the above
  • B Bits
  • C Schema
  • D Data field
  • E Characters

Explanation: The correct answer to the question is: Data field

Question 68: A top-to-bottom relationship among the items in a database is established by a

  • A Network schema
  • B All of the above
  • C Relational schema
  • D Hierarchical schema
  • E None of the above

Explanation: The correct answer to the question is: Hierarchical schema

Question 69: A condition that led to the development of databases was

  • A a demand for more data to support information needs
  • B the proliferation of data files
  • C None of the above.
  • D All of the above
  • E an increase in the amount of data handled by organizations

Explanation: The correct answer to the question is: All of the above

Question 70: Which language has recently become the de-facto standard for interfacing application programs with relational database system?

  • A None of the above
  • B 4GL
  • C SQL
  • D dBASE
  • E Oracle

Explanation: The correct answer to the question is: SQL

Question 71: In SQL, the CREATE TABLESPACE is used

  • A to create a database trigger
  • B None of the above
  • C All of the above
  • D to add/rename data files, to change storage
  • E to create a place in the database for storage of scheme objects, rollback segments, and naming the data files to comprise the tablespace

Explanation: The correct answer to the question is: to create a place in the database for storage of scheme objects, rollback segments, and naming the data files to comprise the tablespace

Question 72: A _____ means that one record in a particular record type may be related to more than one record of another record type.

  • A None of the above
  • B Many-to many relationship
  • C Many-to-one relationship
  • D One-to-one relationship
  • E One-to-many relationship

Explanation: The correct answer to the question is: One-to-many relationship

Question 73: In SQL, the ALTER TABLESPACE command is used

  • A All of the above
  • B to take a tablespace online/offline
  • C to change storage characteristics
  • D to add/rename data files
  • E to begin/end a backup

Explanation: The correct answer to the question is: All of the above

Question 74: Which command(s) is(are) used to redefine a column of the table in SQL ?

  • A ALTER TABLE
  • B All of the above
  • C None of the above
  • D DEFINE TABLE
  • E MODIFY TABLE

Explanation: The correct answer to the question is: ALTER TABLE

Question 75: Which command is used to remove an index from the database in SQL?

  • A REMOVE INDEX
  • B DELETE INDEX
  • C None of the above
  • D DROP INDEX
  • E ROLL BACK INDEX

Explanation: The correct answer to the question is: DROP INDEX

Question 76: If you want your database to include methods, you should use a _____ database.

  • A Network
  • B Hierarchical
  • C None of the above
  • D Object-Oriented
  • E Distributed

Explanation: The correct answer to the question is: Object-Oriented

Question 77: With respect to data input, the most accurate description of batch control is

  • A None of the above
  • B comparing to a pre-calculated figure the total of a data item summed across a batch records put into the system
  • C All of the above
  • D dividing documents to be entered into batches
  • E controlling the input of each input clerk

Explanation: The correct answer to the question is: comparing to a pre-calculated figure the total of a data item summed across a batch records put into the system

Question 78: A set of programs that handle a firm's data base responsibilities is called a

  • A Data Base Management System (DBMS)
  • B None of the above
  • C All of the above
  • D Data Base Processing System (DBPS)
  • E Data Management System (DMS)

Explanation: The correct answer to the question is: All of the above

Question 79: In a relational schema, each tuple is divided into fields called

  • A All of the above
  • B Queries
  • C Relations
  • D None of the above
  • E Domains

Explanation: The correct answer to the question is: Domains

Question 80: Which of the following is not an advantage of the data-base approach?

  • A program/data independence
  • B elimination of the data redundancy
  • C increased security
  • D All of the above are advantages
  • E ability to associate related data

Explanation: The correct answer to the question is: All of the above are advantages

Question 81: A _____ means that one record in a particular record type can be related to many records in another record type and vice-versa.

  • A Many-to-many relationship
  • B One-to-one relationship
  • C Many-to-one relationship
  • D None of the above
  • E One-to-many relationship

Explanation: The correct answer to the question is: Many-to-many relationship

Question 82: Which command is used to remove a table from the database in SQL?

  • A UNATTACH TABLE
  • B ERASE TABLE
  • C DROP TABLE
  • D DELETE TABLE
  • E None of the above

Explanation: The correct answer to the question is: DROP TABLE

Question 83: When using a database management system, the first thing that you must do is to

  • A keep a floppy disk in readiness
  • B None of the above
  • C activate file editor
  • D load the software into your micro
  • E create a database file

Explanation: The correct answer to the question is: load the software into your micro

Question 84: Data items grouped together for storage purposes are called a

  • A list
  • B title
  • C record
  • D None of the above
  • E string

Explanation: The correct answer to the question is: record

Question 85: Data item characteristics that are important in data management include

  • A spelling
  • B None of the above
  • C width
  • D language
  • E punctuation

Explanation: The correct answer to the question is: width

Question 86: Sort/report generators

  • A None of the above
  • B both (a) and (b)
  • C do not need to sort before generating a report
  • D are faster than index/report generators
  • E require more disk space than index/report generators

Explanation: The correct answer to the question is: require more disk space than index/report generators

Question 87: An-owner-member set in the CODASYL specifications may have

  • A only one member but many member occurrence
  • B only one owner but many owner occurrences
  • C None of the above
  • D All of the above
  • E more than one member but only one occurrence per member

Explanation: The correct answer to the question is: only one owner but many owner occurrences

Question 88: The master list of an indexed file

  • A has a number assigned to each record
  • B contains only a list of keys and record numbers
  • C None of the above
  • D both (b) and (c)
  • E is sorted in ascending order

Explanation: The correct answer to the question is: has a number assigned to each record

Question 89: The designer of a form includes

  • A data
  • B filed designators
  • C both (a) and (b)
  • D None of the above
  • E prompts

Explanation: The correct answer to the question is: both (a) and (b)

Question 90: After you _____ a record, many data management the environments require you to issue a command to save the changes you made.

  • A Index
  • B None of the above
  • C Delete
  • D Sort key
  • E Update

Explanation: The correct answer to the question is: Update

Question 91: In a large DBMS

  • A each user can access every sub
  • B each subschema contains every field in the logical schema
  • C All of the above
  • D each user can "see" only a small part of the entire database
  • E None of the above

Explanation: The correct answer to the question is: each user can "see" only a small part of the entire database

Question 92: The index consists of

  • A both (a) and (b)
  • B All of the above
  • C pointers to the master list
  • D None of the above
  • E a list of keys

Explanation: The correct answer to the question is: both (a) and (b)

Question 93: A network schema

  • A permits many-to-many relation
  • B None of the above
  • C All of the above
  • D restricts the structure to a one-to-many relationship
  • E stores data in tables

Explanation: The correct answer to the question is: permits many-to-many relation

Question 94: In SQL, which command(s) is(are) used to create a synonym for a schema object?

  • A All of the above
  • B CREATE SAME
  • C CREATE SCHEMA
  • D CREATE SYNONYM
  • E None of the above

Explanation: The correct answer to the question is: CREATE SYNONYM

Question 95: The database administration function includes

  • A computer operations management
  • B All of the above
  • C None of the above
  • D application programming
  • E database access planning

Explanation: The correct answer to the question is: database access planning

Question 96: If the record management system allows you to edit values before they are recorded on disk, you can

  • A All of the above
  • B None of the above
  • C correct spelling changes before they are recorded
  • D change the width of a field
  • E change the name of a field

Explanation: The correct answer to the question is: correct spelling changes before they are recorded

Question 97: What name is given to the collection of facts, items of information or data which are related in some way?

  • A Database
  • B Directory information
  • C None of the above
  • D Information tree
  • E Information provider

Explanation: The correct answer to the question is: Database

Question 98: A database management system

  • A both (a) and (b)
  • B allows simultaneous access to multiple files
  • C can do more than a record management system
  • D is a collection of programs for managing data in a single file
  • E None of the above

Explanation: The correct answer to the question is: both (a) and (b)

Question 99: Two files may be joined into a third file if

  • A both (b) and (c)
  • B they have no records with the same value in the common field
  • C they have a field in common
  • D None of the above
  • E they have a row in common

Explanation: The correct answer to the question is: they have a field in common

Question 100: A _____ means that one record in a particular record type is related to only one record of another record type.

  • A None of the above
  • B Many-to-one relationship
  • C One-to-one relationship
  • D Many-to-many relationship
  • E One-to-many relationship

Explanation: The correct answer to the question is: One-to-one relationship