Return to site

Sqlpro Studio 1 0 169 – Powerful Database Manager Interview

broken image


  • SQL Tutorial
  1. Sqlpro Studio 1 0 169 – Powerful Database Manager Interview Example
  2. Sqlpro Studio 1 0 169 – Powerful Database Manager Interview Questions
  3. Sqlpro Studio 1 0 169 – Powerful Database Manager Interview Questions And Answers
  4. Sqlpro Studio 1 0 169 – Powerful Database Manager Interview Question And Answer
  • Advanced SQL
  • A simple, powerful database manager for macOS, iOS and Windows. Download Toggle Dropdown. No problem, SQLPro Studio supports most cloud based instances. Multiple result sets. Need to see the results for multiple tables at once? You can execute multiple queries and have the results for each displayed at the same time, including.
  • A RDBMS is a system that organizes data into tables called relations, which are further organized into columns (fields) and rows (often called tuples). The relational model allows data to be queried in a nearly unlimited number of ways, making it great for sorting through large volumes of data.
  • Azure Data Studio is an alternative way to SQL Server Management Studio (SSMS) which you can run only on windows machines to query, editing, and data development tasks. Azure Data Studio offers a modern editor experience to connect with a remote SQL Server database. It helps us to query and manage data across multiple sources with IntelliSense.

By this SQL Server DBA Interview Questions and answers, many students are got placed in many reputed companies with high package salary. So utilize our SQL Server DBA Interview Questions and answers to grow in your career. Q1) MS SQL Server Vs MySQL. Answer: MS SQL Server and MySQL both are used widely for enterprise database systems.

  • SQL Useful Resources
  • Selected Reading

Dear readers, these SQL Interview Questions have been designed specially to get you acquainted with the nature of questions you may encounter during your interview for the subject of SQL. As per my experience good interviewers hardly plan to ask any particular question during your interview, normally questions start with some basic concept of the subject and later they continue based on further discussion and what you answer:

What is the difference between SQL and MySQL or SQL Server?

SQL or Structured Query Language is a language; language that communicates with a relational database thus providing ways of manipulating and creating databases. MySQL and Microsoft's SQL Server both are relational database management systems that use SQL as their standard relational database language.

What is the difference between SQL and PL/SQL?

PL/SQL is a dialect of SQL that adds procedural features of programming languages in SQL. It was developed by Oracle Corporation in the early 90's to enhance the capabilities of SQL.

What are various DDL commands in SQL? Give brief description of their purposes.

Following are various DDL or Data Definition Language commands in SQL − Magic bullet suite latest version.

  • CREATE − it creates a new table, a view of a table, or other object in database.

  • ALTER − it modifies an existing database object, such as a table.

  • DROP − it deletes an entire table, a view of a table or other object in the database.

What are various DML commands in SQL? Give brief description of their purposes.

Following are various DML or Data Manipulation Language commands in SQL −

  • SELECT − it retrieves certain records from one or more tables.

  • INSERT − it creates a record.

  • UPDATE − it modifies records.

  • DELETE − it deletes records.

What are various DCL commands in SQL? Give brief description of their purposes.

Following are various DCL or Data Control Language commands in SQL −

  • GRANT − it gives a privilege to user.

  • REVOKE − it takes back privileges granted from user.

Can you sort a column using a column alias?

Yes. A column alias could be used in the ORDER BY clause.

Is a NULL value same as zero or a blank space? If not then what is the difference?

A NULL value is not same as zero or a blank space. A NULL value is a value which is ‘unavailable, unassigned, unknown or not applicable'. Whereas, zero is a number and blank space is a character.

Say True or False. Give explanation if False.

If a column value taking part in an arithmetic expression is NULL, then the result obtained would be NULLM.

If a table contains duplicate rows, does a query result display the duplicate values by default? How can you eliminate duplicate rows from a query result?

A query result displays all rows including the duplicate rows. To eliminate duplicate rows in the result, the DISTINCT keyword is used in the SELECT clause.

What is the purpose of the condition operators BETWEEN and IN?

The BETWEEN operator displays rows based on a range of values. The IN condition operator checks for values contained in a specific set of values.

How do you search for a value in a database table when you don't have the exact value to search for?

In such cases, the LIKE condition operator is used to select rows that match a character pattern. This is also called ‘wildcard' search.

What is the default ordering of data using the ORDER BY clause? How could it be changed?

The default sorting order is ascending. It can be changed using the DESC keyword, after the column name in the ORDER BY clause.

What are the specific uses of SQL functions?

SQL functions have the following uses −

  • Performing calculations on data

  • Modifying individual data items

  • Manipulating the output

  • Formatting dates and numbers

  • Converting data types

What are the case manipulation functions of SQL? Which function returns the remainder in a division operation?

The MOD function returns the remainder in a division operation.

What is the purpose of the NVL function?

The NVL function converts a NULL value to an actual value.

What is the difference between the NVL and the NVL2 functions?

The NVL(exp1, exp2) function converts the source expression (or value) exp1 to the target expression (or value) exp2, if exp1 contains NULL. The return value has the same data type as that of exp1.

The NVL2(exp1, exp2, exp3) function checks the first expression exp1, if it is not null then, the second expression exp2 is returned. If the first expression exp1 is null, then the third expression exp3 is returned.

What is the use of the NULLIF function?

The NULLIF function compares two expressions. If they are equal, the function returns null. If they are not equal, the first expression is returned.

Discuss the syntax and use of the COALESCE function?

The COALESCE function has the expression COALESCE(exp1, exp2, …. expn)

It returns the first non-null expression given in the parameter list.

Which expressions or functions allow you to implement conditional processing in a SQL statement?

There are two ways to implement conditional processing or IF-THEN-ELSE logic in a SQL statement.

  • Using CASE expression

  • Using the DECODE function

You want to display a result query from joining two tables with 20 and 10 rows respectively. Erroneously you forget to write the WHERE clause. What would be the result?

The result would be the Cartesian product of two tables with 20 x 10 = 200 rows.

What is the difference between cross joins and natural joins?

The cross join produces the cross product or Cartesian product of two tables. The natural join is based on all the columns having same name and data types in both the tables.

What is the purpose of the group functions in SQL? Give some examples of group functions.

Group functions in SQL work on sets of rows and returns one result per group. Examples of group functions are AVG, COUNT, MAX, MIN, STDDEV, SUM, VARIANCE.

Say True or False. Give explanation if False.

By default the group functions consider only distinct values in the set.

By default, group functions consider all values including the duplicate values.

Sqlpro studio 1 0 169 – powerful database manager interview questions and answers
Say True or False. Give explanation if False.

The DISTINCT keyword allows a function consider only non-duplicate values.

Say True or False. Give explanation if False.

Movavi photo editor 5 2 1 – image editor pdf. All group functions ignore null values.

True.

Say True or False. Give explanation if False.

COUNT(*) returns the number of columns in a table.

False. COUNT(*) returns the number of rows in a table.

What's wrong in the following query?

It doesn't have a GROUP BY clause. The subject_code should be in the GROUP BY clause.

What's wrong in the following query?

The WHERE clause cannot be used to restrict groups. The HAVING clause should be used.

Say True or False. Give explanation if False.

Group functions cannot be nested.

False. Group functions can be nested to a depth of two.

Sqlpro Studio 1 0 169 – Powerful Database Manager Interview Example

What do you understand by a subquery? When is it used?

A subquery is a SELECT statement embedded in a clause of another SELECT statement. It is used when the inner query, or the subquery returns a value that is used by the outer query. It is very useful in selecting some rows in a table with a condition that depends on some data which is contained in the same table.

Say True or False. Give explanation if False.

A single row subquery returns only one row from the outer SELECT statement

False. A single row subquery returns only one row from the inner SELECT statement.

Say True or False. Give explanation if False.

A multiple row subquery returns more than one row from the inner SELECT statement.

Say True or False. Give explanation if False.

Multiple column subqueries return more than one column from the inner SELECT statement.

True.

What's wrong in the following query?

Here a single row operator = is used with a multiple row subquery.

What are the various multiple row comparison operators in SQL? What is the pupose of DML statements in SQL?

The DML statements are used to add new rows to a table, update or modify data in existing rows, or remove existing rows from a table.

Which statement is used to add a new row in a database table? Say True or False. Give explanation if False.

While inserting new rows in a table you must list values in the default order of the columns.

True.

How do you insert null values in a column while inserting data?

Null values can be inserted into a table by one of the following ways −

  • Implicitly by omitting the column from the column list.
  • Explicitly by specifying the NULL keyword in the VALUES clause.
Say True or False. Give explanation if False.

Sqlpro Studio 1 0 169 – Powerful Database Manager Interview Questions

INSERT statement does not allow copying rows from one table to another.

False. INSERT statement allows to add rows to a table copying rows from an existing table.

How do you copy rows from one table to another?

The INSERT statement can be used to add rows to a table by copying from another table. In this case, a subquery is used in the place of the VALUES clause.

What happens if you omit the WHERE clause in the UPDATE statement? Can you modify the rows in a table based on values from another table? Explain.
Sqlpro studio 1 0 169 – powerful database manager interview question and answer
Say True or False. Give explanation if False.

The DISTINCT keyword allows a function consider only non-duplicate values.

Say True or False. Give explanation if False.

Movavi photo editor 5 2 1 – image editor pdf. All group functions ignore null values.

True.

Say True or False. Give explanation if False.

COUNT(*) returns the number of columns in a table.

False. COUNT(*) returns the number of rows in a table.

What's wrong in the following query?

It doesn't have a GROUP BY clause. The subject_code should be in the GROUP BY clause.

What's wrong in the following query?

The WHERE clause cannot be used to restrict groups. The HAVING clause should be used.

Say True or False. Give explanation if False.

Group functions cannot be nested.

False. Group functions can be nested to a depth of two.

Sqlpro Studio 1 0 169 – Powerful Database Manager Interview Example

What do you understand by a subquery? When is it used?

A subquery is a SELECT statement embedded in a clause of another SELECT statement. It is used when the inner query, or the subquery returns a value that is used by the outer query. It is very useful in selecting some rows in a table with a condition that depends on some data which is contained in the same table.

Say True or False. Give explanation if False.

A single row subquery returns only one row from the outer SELECT statement

False. A single row subquery returns only one row from the inner SELECT statement.

Say True or False. Give explanation if False.

A multiple row subquery returns more than one row from the inner SELECT statement.

Say True or False. Give explanation if False.

Multiple column subqueries return more than one column from the inner SELECT statement.

True.

What's wrong in the following query?

Here a single row operator = is used with a multiple row subquery.

What are the various multiple row comparison operators in SQL? What is the pupose of DML statements in SQL?

The DML statements are used to add new rows to a table, update or modify data in existing rows, or remove existing rows from a table.

Which statement is used to add a new row in a database table? Say True or False. Give explanation if False.

While inserting new rows in a table you must list values in the default order of the columns.

True.

How do you insert null values in a column while inserting data?

Null values can be inserted into a table by one of the following ways −

  • Implicitly by omitting the column from the column list.
  • Explicitly by specifying the NULL keyword in the VALUES clause.
Say True or False. Give explanation if False.

Sqlpro Studio 1 0 169 – Powerful Database Manager Interview Questions

INSERT statement does not allow copying rows from one table to another.

False. INSERT statement allows to add rows to a table copying rows from an existing table.

How do you copy rows from one table to another?

The INSERT statement can be used to add rows to a table by copying from another table. In this case, a subquery is used in the place of the VALUES clause.

What happens if you omit the WHERE clause in the UPDATE statement? Can you modify the rows in a table based on values from another table? Explain.

Yes. Use of subqueries in UPDATE statements allow you to update rows in a table based on values from another table.

Say True or False. Give explanation if False.

The DELETE statement is used to delete a table from the database.

False. The DELETE statement is used for removing existing rows from a table.

What happens if you omit the WHERE clause in a delete statement? Can you remove rows from a table based on values from another table? Explain.

Yes, subqueries can be used to remove rows from a table based on values from another table.

Say True or False. Give explanation if False.

Attempting to delete a record with a value attached to an integrity constraint, returns an error.

Say True or False. Give explanation if False.

You can use a subquery in an INSERT statement.

True.

What is the purpose of the MERGE statement in SQL?

The MERGE statement allows conditional update or insertion of data into a database table. It performs an UPDATE if the rows exists, or an INSERT if the row does not exist.

Say True or False. Give explanation if False.

A DDL statement or a DCL statement is automatically committed.

What is the difference between VARCHAR2 AND CHAR datatypes?

VARCHAR2 represents variable length character data, whereas CHAR represents fixed length character data.

Say True or False. Give explanation if False.

A DROP TABLE statement can be rolled back.

False. A DROP TABLE statement cannot be rolled back.

Which SQL statement is used to add, modify or drop columns in a database table? What is a view? Why should you use a view?

A view is a logical snapshot based on a table or another view. It is used for −

Sqlpro Studio 1 0 169 – Powerful Database Manager Interview Questions And Answers

  • Restricting access to data;
  • Making complex queries simple;
  • Ensuring data independency;
  • Providing different views of same data.

Sqlpro Studio 1 0 169 – Powerful Database Manager Interview Question And Answer

Say True or False. Give explanation if False.

A view doesn't have data of its own.

What is Next ?

Further you can go through your past assignments you have done with the subject and make sure you are able to speak confidently on them. If you are fresher then interviewer does not expect you will answer very complex questions, rather you have to make your basics concepts very strong.

Second it really doesn't matter much if you could not answer few questions but it matters that whatever you answered, you must have answered with confidence. So just feel confident during your interview. We at tutorialspoint wish you best luck to have a good interviewer and all the very best for your future endeavor. Cheers :-)

sql_questions_answers.htm




broken image