DBMS and SQL MCQ for BPSC TRE Computer Science
DBMS and SQL concept mcq computer science helpful for all competitive exams, entrance exams and it industry preparation from scratch.
1. The collection of related data is called:
A. Database
B. Data warehouse
C. Metadata
D. File system
2. DBMS stands for:
A. Data Base Managing System
B. Data Base Management System
C. Database Management Software
D. Data Backup Management System
DBMS is software that allows users to define, create, maintain and control access to the database.
3. Which of the following is NOT a function of DBMS?
A. Data redundancy control
B. Data security
C. Data integrity
D. Data compilation
DBMS handles storage, security, and integrity of data. Compilation is related to programming languages.
4. A database designed for analytical processing is called:
A. OLTP
B. OLAP
C. Data mining
D. Transaction processing
OLAP (Online Analytical Processing) is used for data analysis and reporting.
5. Which language is used to interact with relational databases?
A. SQL
B. HTML
C. XML
D. Python
SQL (Structured Query Language) is used to create, retrieve, update, and delete data.
6. The three schema architecture was proposed by:
A. IBM
B. ANSI/SPARC
C. Oracle
D. Microsoft
The ANSI-SPARC architecture defines three levels: External level, Conceptual level,Internal level.
7. Which level describes how data is stored physically?
A. External level
B. Conceptual level
C. Internal level
D. Logical level
Internal level deals with physical storage structure.
8. Which level describes the entire database structure?
A. External
B. Conceptual
C. Physical
D. Logical
Conceptual schema represents overall logical structure of database.
9. Which data model uses tables?
A. Hierarchical model
B. Network model
C. Relational model
D. Object model
10. In relational model, table is called:
A. Tuple
B. Relation
C. Attribute
D. Domain
Tuple - Row
Attribute - Column
Domain Allowed - values
11. Which model represents data in tree structure?
A. Network model
B. Relational model
C. Hierarchical model
D. Object model
Hierarchical model organizes data in parent-child tree structure.
12. A key that uniquely identifies each record is called:
A. Primary key
B. Foreign key
C. Secondary key
D. Super key
13. A set of attributes that uniquely identifies a tuple is called:
A. Primary key
B. Super key
C. Candidate key
D. Alternate key
14. A candidate key not selected as primary key is called:
A. Foreign key
B. Secondary key
C. Alternate key
D. Composite key
15. A key made of multiple attributes is:
A. Composite key
B. Primary key
C. Foreign key
D. Secondary key
16. A foreign key is used to:
A. Identify record uniquely
B. Link two tables
C. Delete table
D. Create table
17. Ability to change physical storage without affecting schema is called:
A. Logical independence
B. Physical independence
C. Data abstraction
D. Schema independence
18. Changing conceptual schema without affecting external schema is:
A. Logical independence
B. Physical independence
C. Schema independence
D. Data abstraction
19. Who manages database system?
A. Programmer
B. Database Administrator
C. Data analyst
D. Network engineer
20. A person who designs database structure is:
A. DBA
B. Database designer
C. End user
D. Operator
21. Which of the following constraint ignores NULL value?
A. UNIQUE
B. FOREIGN
C. CHECK
D. All of above
22. Which constraint allows NULL values but prevents duplicate entries?
A. PRIMARY KEY
B. UNIQUE
C. FOREIGN KEY
D. CHECK
23. Which is the correct difference between Primary key and Foreign key?
A. A table can have multiple primary key and single foreign key
B. A primary key cannot ignore NULL value but Foreign key can
C. A Primary key can have duplicate data but foreign key does not
D. None of the above
24. Which one of the following refers to copies of the same data in multiple places?
A. Data Repository
B. Data Inconsistency
C. Data Mining
D. Data Redundancy
25. In a relational table, the number of attributes (columns) is known as:
A. Degree
B. Cardinality
C. Tuple
D. Domain
26. Consider attributes ID, CITY and NAME. Which can be a primary key?
A. NAME
B. ID
C. CITY
D. CITY, ID
27. Which of the following is considered as DBMS?
A. Access
B. Oracle
C. SQL Server
D. All of these
28. If degree of relation is 4 that means relation have
A. 4 tuples
B. 4 attributes
C. 4 state
D. 4 relations
29. Relational model was developed by
A. E. F. Codd
B. Richard Stallman
C. Guido Van Rossum
D. John Von Neumann
30. In a student table, which field is most appropriate to uniquely identify each record?
A. Name
B. Class
C. Admission number
D. Age
31. A DBMS is generally categorized as:
A. System software
B. Application
software
C. Programming software
D. Utility software
32. Copies of the same data occupying memory at multiple places is called
A. Data Repository
B. Data Inconsistency
C. Data Mining
D. Data Redundancy
33. The term “Data” refers to
A. Electronic presentation of information
B. Basic information
C. Raw facts and figures
D. Both (a) and (c)
34. In a relational database table, a row is also called a:
A. Attribute
B. Tuple
C. Domain
D. Column
35. Which key is used to link two tables together?
A. Candidate key
B. Primary key
C. Foreign key
D. Alternate key
36. Which system was commonly used for data storage before DBMS became popular?
A. Cloud storage
B. File system
C. Spreadsheet system
D. Operating
system
37. Which benefit is provided by DBMS?
A. Reduced redundancy
B. Improved data
consistency
C. Data sharing
D. All of the above
38. A structured collection of related data is known as:
A. Table
B. Database
C. Query
D. Attribute
39. Which key ensures that each record in a table is unique and cannot contain NULL values?
A. Foreign key
B. Candidate key
C. Primary key
D. Alternate key
40. Which of the following is an example of a real-world DBMS application?
A. Banking systems
B. Airline
reservation systems
C. Online shopping
platforms
D. All of the above
41. A request sent to the database to retrieve or manipulate data is called a:
A. Query
B. Transaction
C. Record
D. Relation
42. Operation to get common tuples from two tables
A. Minus
B. Union
C. Cartesian Product
D. Intersection
43. In which case NULL cannot be assigned to ROLLNO?
A. When ROLLNO is zero
B. When ROLLNO
is not known
C. When ROLLNO is not
available
D. When ROLLNO is not
applicable
43.A. Foreign key in PROJECT ASSIGNED table
A. Reg_id
B. Proj_no
C. Both
D. None
44. Alternate key in STUDENT table
A. Rollno
B. Reg_id
C. Class
D. Name
45. To retrieve sale details of a particular customer
A. Customer, ccode
B. Sale, ccode
C. Customer and Sale, ccode
D.
Customer and Sale, saleid
46. Number of tuples in a relation is called
A. Entity
B. Column
C. Cardinality
D. None of the above
47. In a relation, attribute refers to
A. Entity
B. Row
C. Column
D. Both (b) and (c)
48. ______ is used to represent relationship between tables
A. Primary key
B. Foreign key
C. Unique key
D. Candidate key
49. Collection of logically related records are called
A. Information
B. Relation
C. Database
D. Tuple
50. Database schema refers to
A. Table name and fields
B.
Relationship among tables
C. Data
stored in tables
D. (a) and (b)
51. When database schema is defined, database state is
A. 0
B. 1
C. Null
D. Equal to degree
52. In RDBMS, R represents
A. Record
B. Relation
C. Relational
D. Referential
53. In a relation tuple represents a
A. Single cell
B. Single row
C. Single column
D. None
54. Which property is NOT observed in RDBMS?
a. Sequence of attributes is immaterial
b. Tuples can be duplicated
c. Attribute cannot have many values in one tuple
d. NULL represents unknown values
55. A tuple is a unique entity whereas attribute values can be duplicated
A. True
B. False
C. Depends upon type of record
D.
Depends upon database key
56. Which is a valid file system to store records?
A. Access
B. MySQL
C. CSV files
D. All of above
👉 SQL mcq for computer science
57. Which SQL command is used to create a table?
A. CREATE
B. INSERT
C. UPDATE
D. SELECT
CREATE is a DDL command used to define database structures.
58. Which SQL command is used to remove a table from database?
A. DELETE
B. DROP
C. REMOVE
D. CLEAR
DROP permanently removes database objects.
59. Which command is used to add data into a table?
A. INSERT
B. UPDATE
C. ADD
D. CREATE
60. Which SQL clause is used to filter records?
A. WHERE
B. ORDER BY
C. GROUP BY
D. HAVING
61. Which command modifies existing records?
A. ALTER
B. UPDATE
C. MODIFY
D. CHANGE
62. Which join returns all matching rows from both tables?
A. INNER JOIN
B. OUTER JOIN
C. CROSS JOIN
D. SELF JOIN
63. Which join returns all records from left table?
A. RIGHT JOIN
B. LEFT JOIN
C. FULL JOIN
D. CROSS JOIN
64. Which SQL keyword removes duplicate rows?
A. UNIQUE
B. DISTINCT
C. REMOVE
D. DELETE
65. Which clause groups rows with same values?
A. GROUP BY
B. ORDER BY
C. SORT BY
D. PARTITION
66. Which clause filters grouped records?
A. WHERE
B. HAVING
C. GROUP BY
D. ORDER BY
67. Which command modifies table structure?
A. UPDATE
B. ALTER
C. MODIFY
D. CHANGE
68. Which SQL function counts rows?
A. SUM
B. COUNT
C. TOTAL
D. NUMBER
69. Which function returns average value?
A. MEAN
B. AVG
C. AVERAGE
D. SUM
70. Which join produces Cartesian product?
A. CROSS JOIN
B. INNER JOIN
C. LEFT JOIN
D. RIGHT JOIN
71. Which SQL statement retrieves data?
A. FETCH
B. SELECT
C. GET
D. RETRIEVE
72. Normalization was introduced by:
A. Edgar F. Codd
B. Charles Bachman
C. Jim Gray
D. Larry Ellison
73. Normalization reduces:
A. Redundancy
B. Security
C. Speed
D. Storage
74. First Normal Form removes:
A. Multivalued attributes
B. Functional dependency
C. Transitive dependency
D. Partial dependency
75. Second Normal Form removes:
A. Partial dependency
B. Transitive dependency
C. Multivalued dependency
D. Join dependency
76. Third Normal Form removes:
A. Partial dependency
B. Transitive dependency
C. Multivalued dependency
D. Join dependency
77. BCNF is stronger version of:
A. 1NF
B. 2NF
C. 3NF
D. 4NF
78. Normalization improves:
A. Data integrity
B. Data redundancy
C. Data duplication
D. Data inconsistency
79. Normalization is mainly applied to:
A. Relational databases
B. Network databases
C. Hierarchical databases
D. File systems
80. Which normal form deals with multivalued dependency?
A. 2NF
B. 3NF
C. 4NF
D. BCNF
81. Join dependency is handled in:
A. 4NF
B. 5NF
C. 3NF
D. BCNF
82. ER model was proposed by:
A. Peter Chen
B. Edgar Codd
C. Charles Bachman
D. Jim Gray
83. Rectangle represents:
A. Attribute
B. Entity
C. Relationship
D. Key
84. Primary key attribute is:
A. Underlined
B. Bold
C. Italic
D. Double
85. Weak entity is represented by:
A. Double rectangle
B. Double oval
C. Diamond
D. Triangle
86. Relationship between entities is represented by:
A. Diamond
B. Rectangle
C. Oval
D. Line
87. Degree of relationship refers to:
A. Number of attributes
B. Number of entities involved
C. Number of tables
D. Number of rows
88. ACID stands for:
A. Atomicity Consistency Isolation Durability
B. Accuracy Consistency Integrity Durability
C. Atomic Consistency Integrity Data
D. Atomic Control Isolation Data
89. Atomicity means:
A. Transaction executes completely or not at all
B. Data is always correct
C. Data is isolated
D. Data is durable
90. Consistency ensures:
A. Database moves from one valid state to another
B. Data is stored permanently
C. Data is isolated
D. Transaction is atomic
91. Isolation means:
A. Transactions do not interfere with each other
B. Data is permanent
C. Data is redundant
D. Data is duplicated
92. Durability ensures:
A. Data persists after commit
B. Data is temporary
C. Data is duplicated
D. Data is isolated
93. Concurrency control ensures:
A. Data consistency in multi-user environment
B. Data redundancy
C. Data duplication
D. Data compression
94. Problem caused by concurrent transactions:
A. Lost update
B. Deadlock
C. Dirty read
D. All of the above
95. Deadlock occurs when:
A. Two transactions wait for each other
B. Transaction commits
C. Transaction rolls back
D. Transaction ends
96. Two-phase locking protocol ensures:
A. Serializability
B. Redundancy
C. Security
D. Integrity
97. Shared lock allows:
A. Multiple reads
B. Multiple writes
C. Delete operation
D. Update operation
98. Indexing improves:
A. Query performance
B. Data redundancy
C. Data inconsistency
D. Data duplication
99. Primary index is based on:
A. Primary key
B. Foreign key
C. Secondary key
D. Composite key
100. Dense index contains:
A. Index record for every search key value
B. Some search keys
C. Only primary keys
D. Only foreign keys
101. Sparse index contains:
A. Index entries for some records
B. All records
C. All keys
D. Only duplicates
102. Hashing technique is used for:
A. Fast data retrieval
B. Data deletion
C. Data normalization
D. Data compression
103. A table can have ___ foreign keys.
A. 1
B. 2
C. Many
D. Depends on RDBMS
104. In which of the following cases DML is not executed?
A. When new record is added
B. When existing record is modified
C. When existing attribute is modified
D. When records are deleted
105. Which is the correct difference between Primary key and Foreign key?
A. A table can have multiple primary key and single foreign key
B. A primary key cannot ignore NULL value but Foreign key can
C. A Primary key can have duplicate data but foreign key does not
D. None of the above
106. In SQL FROM clause is used to:
A. Define source table name while retrieving records
B. Define column name while retrieving records
C. Define criteria while retrieving records
D. Define values while inserting records
107. Which of the following is not an SQL aggregate function?
A. AVG
B. MAX
C. COUNT
D. All are aggregate function
108. Which of the following is not true about DDL?
A. The retrieval of information stored in database
B. The creation of schema object in database
C. The deletion of schema object
D. All are not true
109. DELETE FROM Book WHERE Price <= 2514;
This statement is a:
A. DDL
B. DML
C. DCL
D. None
110. Display all records of emp in descending order of ename and ascending order of dept.
A.
SELECT * FROM emp ORDER BY ename, dept DESC;
B.
SELECT * FROM emp ORDER BY ename, ORDER BY dept DESC;
C.
SELECT * FROM emp ORDER BY ename DESC, dept;
D.
SELECT * FROM emp WHERE ORDER BY ename, dept DESC;
111. Which of the following is not an SQL constraint?
A. IS NULL
B. Primary Key
C. Default
D. Check
112. Write SQL command to add a new column DOB.
A.
Alter table student modify DOB date;
B.
Alter table student add DOB date;
C.
Alter table student create DOB date;
D.
Alter table student new DOB date;
113. List different games offered by school.
A. Select Game from Student;
B.
Select Unique(Game) from Student;
C.
Select Distinct(Game) from Student;
D.
Select Game from student where Distinct(Game);
114. Display books with price between 150 and 200 and qty not null.
A. Price between 150 Or 200
B.
Price between 150 And 200 Or qty NOT NULL
C.
Price between 150 Or 200 And qty NOT NULL
D.
Price between 150 And 200 And qty IS NOT NULL
115. Value stored in VARCHAR(20) = “Keshav”
Value stored in CHAR(20) =
“Meenakshi”
Characters occupied:
A. 20,6
B. 6,20
C. 9,6
D. 6,9
116. SELECT DISTINCT Brand FROM Product;
What does it do?
A. Gives all tuples
B. Shows unique brand values
C. Shows repeated values
D. None
