Back to Dashboard

Database Management

Complete Subject Question Bank

Subject Overview
Prepare for SQL and relational database questions. Covers table creation, data constraints, standard JOIN queries, data manipulation (CRUD), and aggregation functions.
01 Rdbms Concepts#1

Tom has designed a payroll software for XYZ technology.The sofware will store the salary details into the database and later he can retreive the same for future references. Tom falls under which category of user.

A
Application Programmer
B
Database Administrator
C
End User
D
System Analyst

Tom writes application code that stores and retrieves data — he is an Application Programmer.

01 Rdbms Concepts#2

In SQL is a case sensitive language and the data stored inside the table are case in-sensitive. Say true or false?

A
TRUE
B
FALSE

SQL keywords are case-insensitive; data values are case-sensitive by default in most RDBMS.

01 Rdbms Concepts#3

Which of the following is not a valid relational database?

A
XML Database
B
Oracle
C
MySQL
D
PostgreSQL

XML databases are hierarchical/document stores, not relational databases.

01 Rdbms Concepts#4

Database is a shared collection of logically unrelated data, designed to meet the needs of an organization. State True or False.

A
TRUE
B
FALSE

A database is a collection of logically RELATED data — the statement is false.

01 Rdbms Concepts#5

Which of the following represents the degree of the relation?

A
Number of attributes (columns)
B
Number of tuples (rows)
C
Number of tables
D
Number of keys

The degree of a relation is its number of attributes.

03 Data Definition Language#6

A table consists of ______ primary keys.

A
1
B
2
C
Multiple
D
0

Each table has exactly one primary key (which may be composite).

03 Data Definition Language#7

We need to ensure that the amount withdrawn should be less then the credit card limit amount, to ensure this integrity what type constraint will be used?

A
Table level CHECK constraint
B
NOT NULL constraint
C
UNIQUE constraint
D
PRIMARY KEY constraint

A CHECK constraint enforces domain integrity rules like withdrawal limits.

03 Data Definition Language#8

Which of the following options is not correct?

A
alter table emp drop column_name;
B
alter table emp drop column salary;
C
alter table emp add column salary number;
D
alter table emp modify salary varchar(20);

The correct syntax is ALTER TABLE emp DROP COLUMN salary; — missing the COLUMN keyword.

03 Data Definition Language#9

An emp table contains fields employ name, desig and salary. How do you drop column salary?

A
alter table emp drop column salary;
B
drop column salary from emp;
C
alter emp drop salary;
D
delete column salary from emp;

The correct DDL is: ALTER TABLE emp DROP COLUMN salary;

03 Data Definition Language#10

Which of the following is not modification of the database

A
XML Database
B
Oracle
C
MySQL
D
PostgreSQL

XML databases are hierarchical/document stores, not relational databases.

03 Data Definition Language#11

In a relational database a referential integrity constraint can be done using

A
Foreign Key
B
Primary Key
C
CHECK constraint
D
UNIQUE constraint

Foreign Keys enforce referential integrity between tables.

03 Data Definition Language#12

___________ removes data from the table, but structure remains the same.

A
TRUNCATE
B
DROP
C
DELETE
D
ALTER

TRUNCATE removes all rows but preserves the table structure; it is a DDL command.

03 Data Definition Language#13

A relational database consists of a collection of

A
Tables (relations)
B
Objects
C
Files
D
Documents

A relational database organises data into tables (relations).

03 Data Definition Language#14

Column header is referred as

A
Attribute
B
Tuple
C
Domain
D
Relation

A column header in a relational table is called an attribute.

04 Data Manipulation Language#15

Consider the below table structure: Column Name DataType Constraint Empname Varchar(20) Not Null EmpId int(10) PK Phoneno bigint(10) Not Null insert into employee(empid,empname)values('123','John'); When we issue the above insert command and if the statement fails, what would be the reason.

A
Value for phoneno is missing.
B
empid value should be given without single quotes.
C
The statement will execute successfully.
D
The empname value should be given without single quotes.

phoneno has a NOT NULL constraint so it must be provided. empid is numeric so no quotes needed — that part is actually correct; the real issue is only the missing phoneno value.

04 Data Manipulation Language#16

Examine the structure of the STUDENT table: Column Name DataType Constraint Stud_id int(3) PK Name Varchar(20) Not Null Address Varchar(30) DOB Date Which statement inserts a new row into the STUDENT table?

A
INSERT INTO student VALUES(101, 'Smith', '15-JAN-1990', 'New York');
B
INSERT INTO student(stud_id, name) VALUES(101, 'Smith');
C
INSERT INTO student VALUES(101);
D
INSERT INTO student(name) VALUES('Smith');

Providing all column values in the correct order satisfies the table constraints.

04 Data Manipulation Language#17

State True or False. COMMIT ends the current transaction by making all pending data changes permanent.

A
TRUE
B
FALSE

COMMIT permanently saves all changes made in the current transaction.

04 Data Manipulation Language#18

Merge is not supported by MySQL. The other possible way of doing the work of merge statement, is by using ON DUPLICATE KEY UPDATE in the insert statement. State TRUE or FALSE.

A
True
B
False

MySQL uses INSERT ... ON DUPLICATE KEY UPDATE as an alternative to MERGE.

04 Data Manipulation Language#19

Which of the below is a reference option for deleting rows from a table?

A
ON DELETE CASCADE
B
ON DELETE RESTRICT
C
ON DELETE SET NULL
D
ON DELETE NO ACTION

ON DELETE CASCADE automatically deletes child rows when the parent row is deleted.

04 Data Manipulation Language#20

To remove a relation from SQL database, we use ___________ command.

A
DROP
B
DELETE
C
TRUNCATE
D
ALTER

DROP TABLE removes the entire table structure and data from the database.

Key Topics to Study

Based on our question bank analysis, master these concepts to score high in Database Management.

SQLTableConstraintJoinQueryInsertDeleteAggregate
Recommended

Success Primer Exam

Test your knowledge under real exam conditions with our curated mock assessment.

Start Preparing for Primers
Watch Walkthroughs!