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

Multiple choice accountancy accounting software - tally concept of entity and relationship designing and creating simple tables, forms, and queries objective in dbms

Which of the following statement is correct for queries object?
a. This object class allows a database designer to create the data tables with their respective field names.
b. This object class is meant to create the SQL compatible query statement with the help of Geometrical User Interface (GUI).

  1. Only a

  2. Only b

  3. Both a and b

  4. None of the above

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Queries object class is meant to create the SQL compatible query statement with or without the help of Graphic User Interface (GUI) to define tables, store data and retrieves both data and information.

Multiple choice accountancy accounting software - tally concept of entity and relationship designing and creating simple tables, forms, and queries objective in dbms

The record set of final SQL that relies upon preceding SQL statement, is collection of report-oriented information. 

  1. True

  2. False

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The record set of final SQL that relies upon preceding SQL statement, is collection of report-oriented information. This record set need be embedded in the report being produced.

Multiple choice accountancy accounting software - tally concept of entity and relationship designing and creating simple tables, forms, and queries objective in dbms

_________ are meant to create the SQL compatible query statement with or without the help of Graphic User Interface to define tables, store data and retrieve both data and information.

  1. Tables

  2. Queries

  3. Pages

  4. Reports

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Queries are the database objects used to retrieve, filter, and manipulate data from tables using SQL or graphical interfaces.

Multiple choice
  1. Using inline queries in a SqlCommand object

  2. Using Parameters to take inputs from users

  3. Injecting a SQL Statement as user input

  4. Installing a plugin to SQL Server Management Studio

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

SQL Injection is a security vulnerability where an attacker inputs malicious SQL statements into entry fields, forcing the database to execute unintended commands. Using parameterized queries is actually a defense against SQL injection, not the vulnerability itself.

Multiple choice
  1. Update only one row at a time

  2. Update multiple rows at a time

  3. Delete a row based on a where clause

  4. Update the current system time of the database

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The UPDATE statement can modify multiple rows at once if the WHERE clause matches multiple records, or if no WHERE clause is specified at all. It does not delete rows, which is the job of the DELETE statement.

Multiple choice
  1. Shorthand Query Language

  2. Structured Query Lines

  3. Structured Query Language

  4. Structured Query Lambda

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

SQL stands for Structured Query Language, which is the standard programming language used to manage and manipulate relational databases.

Multiple choice
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Constraints (such as NOT NULL, UNIQUE, or CHECK) are typically defined on columns to restrict the type of data that can go into them. While some constraints can be defined at the table level (involving multiple columns), they are not applied to individual rows.

Multiple choice
  1. DELETE

  2. DROP

  3. TRUNCATE

  4. REMOVE

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The DROP command is used to completely remove a table structure and all of its data from the database. DELETE and TRUNCATE remove rows from a table but keep the table structure intact.

Multiple choice
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

A subquery is a nested query placed inside another SQL statement (such as SELECT, INSERT, UPDATE, or DELETE) to return data that will be used by the outer query. It is not a command specifically designed to insert records.