Skip to main content

DBMS MCQS

 What is a database?

a. A collection of files stored on a computer

b. A structured collection of data organized for efficient retrieval

c. A type of computer program

d. A network of connected computers


Answer: b. A structured collection of data organized for efficient retrieval


Which of the following is NOT a type of database model?

a. Relational

b. NoSQL

c. Hierarchical

d. Algorithmic


Answer: d. Algorithmic


What is SQL an acronym for?

a. Structured Query Language

b. Sequential Query Language

c. System Query Language

d. Simplified Query Language


Answer: a. Structured Query Language


Which database model uses a schema-less approach and is suitable for handling unstructured data?

a. Relational

b. NoSQL

c. Hierarchical

d. Object-Oriented


Answer: b. NoSQL


What is a primary key in a relational database?

a. A key used for encryption

b. A unique identifier for each record in a table

c. A key used for foreign key relationships

d. A key that can be null


Answer: b. A unique identifier for each record in a table

What is the primary purpose of a database management system (DBMS)?


a) Data visualization

b) Data storage and retrieval

c) Web development

d) Graphic design


Answer: b Data storage and retrieval

Which SQL command is used to retrieve data from a database?

a. SELECT

b. UPDATE

c. DELETE

d. INSERT


Answer: a. SELECT


What is the purpose of the JOIN clause in SQL?

a. To add new records to a table

b. To update existing records in a table

c. To combine data from multiple tables

d. To delete records from a table


Answer: c. To combine data from multiple tables


Which type of database index is typically used to improve query performance on columns with high cardinality?

a. Primary index

b. Secondary index

c. Clustered index

d. Non-clustered index


Answer: d. Non-clustered index


In a relational database, what does ACID stand for?

a. Atomicity, Consistency, Integrity, Durability

b. Association, Concurrency, Inheritance, Design

c. Allocation, Configuration, Inversion, Deletion

d. Accumulation, Compatibility, Integration, Decryption


Answer: a. Atomicity, Consistency, Integrity, Durability


Which of the following is NOT a data type commonly used in SQL?

a. Integer

b. Boolean

c. String

d. Decimal


Answer: b. Boolean


What is the primary goal of data normalization in database design?

a) To minimize data redundancy

b) To increase data complexity

c) To enhance data visualization

d) To improve data retrieval speed


Answer: a) To minimize data redundancy

What is the purpose of the GROUP BY clause in SQL?

a. To order the result set in ascending order

b. To filter rows based on a condition

c. To group rows with the same values into summary rows

d. To perform mathematical calculations on numeric columns


Answer: c. To group rows with the same values into summary rows


Which SQL statement is used to add new records to a table?

a. SELECT

b. UPDATE

c. DELETE

d. INSERT


Answer: d. INSERT


What is normalization in the context of database design?

a. The process of simplifying complex SQL queries

b. The process of organizing data in a database to minimize redundancy

c. The process of encrypting sensitive data in a database

d. The process of creating backup copies of a database


Answer: b. The process of organizing data in a database to minimize redundancy


What is a foreign key in a relational database?

a. A key used for encryption

b. A key that uniquely identifies each record in a table

c. A key used to establish relationships between tables

d. A key that cannot be null


Answer: c. A key used to establish relationships between tables


What does CRUD stand for in the context of database operations?

a. Create, Read, Update, Delete

b. Compute, Render, Update, Display

c. Control, Record, Undo, Delete

d. Create, Render, Undo, Display


Answer: a. Create, Read, Update, Delete


Which SQL command is used to modify existing data in a database?

a. SELECT

b. UPDATE

c. DELETE

d. INSERT


Answer: b. UPDATE


What is the purpose of an index in a database?

a. To store large binary files

b. To enforce data integrity constraints

c. To improve data retrieval speed

d. To perform mathematical calculations


Answer: c. To improve data retrieval speed


Which type of SQL constraint ensures that a column does not contain NULL values?

a. PRIMARY KEY constraint

b. UNIQUE constraint

c. NOT NULL constraint

d. CHECK constraint


Answer: c. NOT NULL constraint


What is the role of a DBA (Database Administrator) in database management?

a. Writing application code

b. Designing user interfaces

c. Managing and maintaining the database system

d. Analyzing market trends


Answer: c. Managing and maintaining the database system


Which SQL command is used to remove records from a table?

a. SELECT

b. UPDATE

c. DELETE

d. INSERT


Answer: c. DELETE


What is the purpose of the WHERE clause in SQL?

a. To specify the columns to be selected in a query

b. To specify the order of the result set

c. To filter rows based on a condition

d. To group rows by a specific column


Answer: c. To filter rows based on a condition

What is the primary purpose of a DBMS (Database Management System)?

a. To create user interfaces

b. To organize files on a computer

c. To manage and manipulate data in a structured way

d. To perform mathematical calculations


Answer: c. To manage and manipulate data in a structured way


In a relational database, what is a tuple?

a. A data type

b. A field name

c. A record or row

d. A database schema


Answer: c. A record or row


Which SQL command is used to modify the structure of a database table, such as adding a new column?

a. SELECT

b. UPDATE

c. ALTER

d. INSERT


Answer: c. ALTER


What is the purpose of the COMMIT statement in SQL?

a. To permanently save changes made to a database

b. To retrieve data from a database

c. To create a new database

d. To delete records from a database


Answer: a. To permanently save changes made to a database


What is an entity-relationship diagram (ERD) used for in database design?

a. To display the contents of a database table

b. To represent the relationships between entities in a database

c. To perform mathematical calculations

d. To generate SQL queries


Answer: b. To represent the relationships between entities in a database


Which of the following is a key characteristic of a NoSQL database?

a. Fixed schema

b. ACID compliance

c. Tabular data representation

d. Flexible schema


Answer: d. Flexible schema


What is the purpose of the ROLLBACK statement in SQL?

a. To permanently save changes made to a database

b. To undo changes made during a transaction

c. To create a new database

d. To retrieve data from a database


Answer: b. To undo changes made during a transaction


In a relational database, what is a foreign key constraint used for?

a. To enforce data integrity by ensuring that values in one column match values in another column

b. To automatically generate primary keys

c. To define the data type of a column

d. To create indexes for fast data retrieval


Answer: a. To enforce data integrity by ensuring that values in one column match values in another column


Which of the following SQL commands is used to delete a table's structure and data from a database?

a. TRUNCATE

b. DROP

c. DELETE

d. REMOVE


Answer: b. DROP


What is the purpose of the SELECT DISTINCT statement in SQL?

a. To update records in a table

b. To retrieve only unique values from a column

c. To insert new records into a table

d. To create a new table


Answer: b. To retrieve only unique values from a column


In a relational database, what is a primary key constraint used for?

a. To enforce data integrity by ensuring that values in one column match values in another column

b. To automatically generate unique identifiers for records

c. To define the data type of a column

d. To create indexes for fast data retrieval


Answer: b. To automatically generate unique identifiers for records


Which SQL command is used to combine rows from two or more tables based on a related column between them?

a. SELECT

b. JOIN

c. MERGE

d. APPEND


Answer: b. JOIN


What is the purpose of the ORDER BY clause in SQL?

a. To filter rows based on a condition

b. To group rows by a specific column

c. To specify the columns to be selected in a query

d. To sort the result set in ascending or descending order


Answer: d. To sort the result set in ascending or descending order


Which SQL command is used to add a new row of data to a table?

a. SELECT

b. UPDATE

c. INSERT

d. DELETE


Answer: c. INSERT


What is a database transaction?

a. A database schema

b. A sequence of SQL commands

c. A group of related database operations that are treated as a single unit

d. A database query


Answer: c. A group of related database operations that are treated as a single unit


Which of the following is NOT a type of database model?

a. Relational

b. Object-Oriented

c. Hierarchical

d. Distributed


Answer: d. Distributed


In a relational database, what is a view?

a. A type of database schema

b. A temporary table that stores query results

c. A way to hide sensitive data from users

d. A data type


Answer: b. A temporary table that stores query results


What is the purpose of the WHERE clause in an SQL DELETE statement?

a. To specify the columns to be deleted

b. To specify the order of the result set

c. To filter rows to be deleted based on a condition

d. To group rows by a specific column


Answer: c. To filter rows to be deleted based on a condition


Which SQL command is used to change data in a table?

a. ALTER

b. DELETE

c. UPDATE

d. INSERT


Answer: c. UPDATE


In a relational database, what is a schema?

a. A database user

b. A sequence of SQL statements

c. A collection of database objects (tables, views, etc.) organized by a user

d. A data type


Answer: c. A collection of database objects (tables, views, etc.) organized by a user


Which of the following is a benefit of using a stored procedure in a database?

a. Improved data retrieval performance

b. Reduced data redundancy

c. Easier data modeling

d. Code reusability and security


Answer: d. Code reusability and security


In the context of database transactions, what does ACID stand for?

a. Atomicity, Concurrency, Integrity, Durability

b. Association, Compatibility, Integration, Decryption

c. Allocation, Configuration, Inversion, Deletion

d. Accumulation, Control, Inheritance, Design


Answer: a. Atomicity, Concurrency, Integrity, Durability


Which of the following is a type of SQL constraint that enforces uniqueness for values in a column or set of columns?

a. PRIMARY KEY constraint

b. FOREIGN KEY constraint

c. UNIQUE constraint

d. CHECK constraint


Answer: c. UNIQUE constraint


What is the purpose of the GROUP BY clause in SQL?

a. To order the result set in ascending order

b. To filter rows based on a condition

c. To group rows by a specific column for aggregation

d. To create a temporary table


Answer: c. To group rows by a specific column for aggregation


In a relational database, what does a "one-to-many" relationship between two tables mean?

a. Each row in the first table corresponds to one row in the second table.

b. Each row in the second table corresponds to one row in the first table.

c. Many rows in the first table can correspond to many rows in the second table.

d. Each row in the first table corresponds to many rows in the second table.


Answer: b. Each row in the second table corresponds to one row in the first table.


What is the purpose of the INDEX in a database?

a. To store large binary files

b. To enforce data integrity constraints

c. To improve data retrieval performance

d. To perform mathematical calculations


Answer: c. To improve data retrieval performance




Comments

Popular posts from this blog

Software Process Model(SPM)

  Explain spiral development model with advantages and disadvantages The Spiral Development Model is a risk-driven software development approach that combines iterative and waterfall models. It involves repeated cycles (or spirals) to incrementally refine the software project. Each spiral consists of four major phases: Planning , Risk Analysis , Engineering , and Evaluation .                                                           Fig: Spiral Software development model Phases in the Spiral Model: Planning : Requirements are gathered and objectives are set for the project. Risk Analysis : Risks are identified, analyzed, and mitigation strategies are developed. Develop/Engineering : The actual development and testing of the product take place. Evaluation : Stakeholders/users review the progress and provide feedback, inf...

Solution of NEB model quetions

 solution to model questions are : 

DBMS-SQL

SQL DDL and DML Examples Examples of DDL (Data Definition Language) and DML (Data Manipulation Language) commands in SQL. DDL (Data Definition Language) Examples: 1. Create a new database: CREATE DATABASE SchoolDB;  2. Create a table: CREATE TABLE Students ( StudentID INT PRIMARY KEY, FirstName VARCHAR(50), LastName VARCHAR(50), Age INT );  3. Alter a table to add a new column: ALTER TABLE Students ADD Email VARCHAR(100);  4. Drop a table: DROP TABLE Students;  5. Rename a table: ALTER TABLE OldTableName RENAME TO NewTableName;  DML (Data Manipulation Language) Examples: 1. Insert data into a table:  INSERT INTO Students (StudentID, FirstName, LastName, Age) VALUES (1, 'John', 'Doe', 20);  2. Update data in a table: UPDATE Students SET Age = 21 WHERE StudentID = 1;  3. Delete data from a table: DELETE FROM Students WHERE StudentID = 1;  4. Select data from a table: SELECT * FROM Students;  5. Select data with conditions: SELECT FirstName...