SQL Interview questions
SQL Interview questions
1. What is SQL?
SQL stands for structured query language which is a language
used to communicate with database.
3. What is a database?
A database is a collection of data stored in a computer system
that can be accessed by multiple users.
5. What is DBMS?
It is a software which is used to maintain and manage the
database.
6. What is a schema?
A collection of database structural elements such as tables,
stored procedures, indexes, functions, and triggers. It shows
the overall database architecture, specifies the relationships
between various objects of a database, and defines different
access permissions for them.
7. What is RDBMS?
Stands for relational database management system. Rdbms
store the data into the collection of tables. It is a type of dbms
which provides relational operations to manipulate the data
stored into the tables.
23. What types of SQL commands (or SQL subsets) do you know?
Data Definition Language (DDL) – to define and modify the
structure of a database.
Data Manipulation Language (DML) – to access, manipulate,
and modify data in a database.
Data Control Language (DCL) – to control user access to the
data in the database and give or revoke privileges to a specific
user or a group of users.
Transaction Control Language (TCL) – to control transactions
in a database.
Data Query Language (DQL) – to perform queries on the data
in a database to retrieve the necessary information from it.
26. Name the operator which is used in the query for appending
two strings?
In SQL for appending two strings, the” Concatenation
operator” is used and its symbol is” || “.
32. What is the meaning of function and what are the types of
functions.?
SQL functions are simple code snippets that are frequently
used and re-used in database systems for data processing and
manipulation. Functions are the measured values. It always
performs a specific task.
DELETE command is slower than While the TRUNCATE command is faster than
the identity TRUNCATE command. the DELETE command.
To use Delete you need DELETE To use Truncate on a table we need at least
permission on the table. ALTER permission on the table.
In the DROP command, table space is While the TRUNCATE command does not
freed from memory. free the table space from memory.
In the DROP command, a view of the While in this command, a view of the
table does not exist. table exists.
In the DROP command, undo space is While in this command, undo space is
not used. used but less than DELETE.
COMMIT permanently saves the changes ROLLBACK undo the changes made
made by the current transaction. by the current transaction.
The transaction cannot undo changes after Transaction reaches its previous
COMMIT execution. state after ROLLBACK.
SQL tells databases, what to do? PL/SQL tells databases how to do.
Unique Index
Clustered Index
Non-Clustered Index
Bit-Map Index
Normal Index
Composite Index
B-Tree Index
This clause can be used with the SELECT, This clause can only be used with the
UPDATE, and DELETE statements. SELECT statement.