Computer Knowledge
Database and SQL
4,213 Questions
Master structured query language commands, database joins, table constraints, and alias generation. This section covers relational database management concepts and query outputs essential for technical aptitude. These technical questions feature prominently in banking IT officer exams and computer knowledge sections.
SQL queries and aliasesDatabase table constraintsDatabase joins and transformationsStored procedures and functions
Database and SQL Questions
-
Update
-
Modify
-
Insert
-
All of the above
C
Correct answer
Explanation
Insert is used to insert a new row in a table - like insert in to table values (data1 , XYZ ) ; and length of the list is directly proportional to the insertion made.
-
8, 8
-
120, 8
-
960, 8
-
960, 120
C
Correct answer
Explanation
Natural join on Student and Enroll (sharing 'rollno'): Max tuples occur if every student is enrolled in all 8 courses (120 * 8 = 960). Min tuples occur if only the students present in Enroll are joined (8).
-
Attributes
-
Atomicity
-
Both (1) and (2)
-
None of above
B
Correct answer
Explanation
Atomicity means 'all or nothing' and 'may be all or nothing' in the transaction. ACID stands for ' Atomicity Consistency Isolation Durability '.
-
duplicate
-
public
-
private
-
primary
D
Correct answer
Explanation
Each row of the data in the table is uniquely identified by a Primary Key (PK).
-
Projection, selection and joining
-
Updating the data
-
Inserting new data in the tables
-
Deleting data from tables
A
Correct answer
Explanation
Projection is used to choose the columns in a table that you want, returned by your query. Selection is used to choose the rows in a table that you want, returned by a query. Joining is used to join different tables by creating logic between them.
-
foreign
-
refer
-
relation
-
duplicate
A
Correct answer
Explanation
Foreign Key (FK) is used to relate the multiple tables.
-
SELECT UNIQUE name from class.
-
SELECT name UNIQUE from class;
-
SELECT DISTINCT name from class.
-
SELECT name DISTINCT from name.
C
Correct answer
Explanation
DISTINCT statement is used for eliminating duplicate data in the row.
D
Correct answer
Explanation
In computer science as well as in SQL, the following operator precedence is standard. Every operator in every programming language has its priority.
A
Correct answer
Explanation
sort command change the order in a table.
-
tables
-
programs
-
actions
-
none of the above
C
Correct answer
Explanation
Decision tables are a structured way to represent complex logic by mapping specific conditions to the corresponding actions that should be taken.
-
Where
-
Having
-
Into
-
All of these
B
Correct answer
Explanation
Having is used along with GROUP BY clause to define a condition on the group.
-
Commit
-
Rollback
-
Savepoint
-
All of these
D
Correct answer
Explanation
Savepoint, commit, rollback, set transaction are TCL statements meaning Transaction Control statements which are used to manage the changes made by DML statements.
Savepoint , commit , rollback , set transaction are TCL statements meaning Transaction Control statements which are used to manage the changes made by DML statements. finally 5 option is correct.
-
Delete
-
Look-up
-
Insert
-
None of above
B
Correct answer
Explanation
To modify a record, one must first locate or look up the specific record in the database. Without finding the record first, you cannot perform a modification.
-
foreign key
-
secondary key
-
candidate key
-
composite key
A
Correct answer
Explanation
A foreign key is an attribute in one table that refers to the primary key of another table, establishing a relationship between the two.
-
fields & columns
-
rows & columns
-
rows & cells
-
None of above
B
Correct answer
Explanation
In database terminology, a table (or relation) is composed of rows (tuples) and columns (attributes). Fields are synonymous with columns, but rows and columns is the standard definition for a table structure.