SQL Interview Questions
SQL Interview Questions
SQL Interview Questions
2. What is RDBMS?
3. What is SQL?
SQL stands for Structured Query Language , and it is used to communicate with the
Database.
This is a standard language used to perform tasks such as retrieval, updation,
insertion and deletion of data from a database.
4. What is a Database?
9. What is a join?
A DB query is a code written in order to get the information back from the
database.
Query can be designed in such a way that it matched with our expectation of the
result set.
Simply, a question to the Database.
15. What is subquery?
A Non-Correlated sub query can be considered as independent query and the output of
subquery are substituted in the main query.
DELETE command is used to remove rows from the table, and WHERE clause can be used
for conditional set of parameters.
Commit and Rollback can be performed after delete statement.
TRUNCATE removes all rows from the table. Truncate operation cannot be rolled back.
Constraint can be used to specify the limit on the data type of table.
Constraint can be specified while creating or altering the table statement. Sample
of constraint are.
NOT NULL.
CHECK.
UNIQUE.
PRIMARY KEY.
FOREIGN KEY.
Data Integrity defines the accuracy and consistency of data stored in a database.
It can also define integrity constraints to enforce business rules on the data when
it is entered into the application or database.
Cross join defines as Cartesian product where number of rows in the first table
multiplied by number of rows in the second table.
UNION operator is used to combine the results of two tables, and it eliminates
duplicate rows from the tables.
MINUS operator is used to return rows from the first query but not from the second
query.
Matching records of first and second query and other rows from the first query will
be displayed as a result set.
TRUNCATE removes all the rows from the table, and it cannot be rolled back.
DROP command removes a table from the database and operation cannot be rolled back.
Aggregate functions are used to evaluate mathematical calculation and return single
values.
This can be calculated from the columns in a table.
29. How can you create an empty table from an existing table?
Example will be -.
31. What is the command used to fetch first 5 characters of the string?