SQL Questions

Q:

SQL views can be used to hide?

A) Complicated SQL syntax B) Rows
C) Columns D) All of the above
 
Answer & Explanation Answer: D) All of the above

Explanation:

In SQL, a SQL view is a virtual table based on the result-set of an SQL statement. A view contains rows and columns, just like a real table.

 

SQL views can be used to hide rows and columns and complicated SQL syntax.

 

The fields in a view are fields from one or more real tables in the database.

Report Error

View Answer Report Error Discuss

Filed Under: SQL
Exam Prep: AIEEE , Bank Exams , CAT
Job Role: Analyst , Bank Clerk , Bank PO

3 4521
Q:

What are the properties and different Types of Sub-Queries?

Answer

Properties of Sub-Query


- A sub-query must be enclosed in the parenthesis.


- A sub-query must be put in the right hand of the comparison operator, and


- A sub-query cannot contain an ORDER-BY clause.


- A query can contain more than one sub-query.


Types of Sub-Query


- Single-row sub-query, where the sub-query returns only one row.


- Multiple-row sub-query, where the sub-query returns multiple rows,. and


- Multiple column sub-query, where the sub-query returns multiple columns

Report Error

View answer Workspace Report Error Discuss

Subject: SQL

1 4506
Q:

What operator tests column for the absence of data?

A) NOT operator B) IS NULL operator
C) EXISTS operator D) All of the above
 
Answer & Explanation Answer: B) IS NULL operator

Explanation:

SELECT "column_name"


FROM "table_name"


WHERE "column_name" IS NULL.

Report Error

View Answer Report Error Discuss

1 4291
Q:

How can you generate debugging output from PL/SQL?

Answer

Use the DBMS_OUTPUT package. Another possible method is to use the SHOW ERROR command.

Report Error

View answer Workspace Report Error Discuss

Subject: SQL

0 4275
Q:

What is the difference between JOIN and UNION?

Answer

SQL JOIN allows access to records of other table based on the given conditions between two tables.


Ex: If we are provided with the department ID of each employee, then we can use the department ID of the employee table to merge with the department ID of the department table to access department names.


UNION operation allows addition of 2 similar data sets to create a resulting set that contains all the data from the source data sets.


Ex: If we are provided with 2 employee tables of the same structure, we can UNION them to create a singular result that will contain all employee from both the table.

Report Error

View answer Workspace Report Error Discuss

Subject: SQL

1 4085
Q:

What is Log Shipping?

Answer

Log shipping is the process of automating the backup of database and transaction log files on a production SQL server, and then restoring them onto a standby server. Enterprise Editions only supports log shipping. In log shipping the transactional log file from one server is automatically updated into the backup database on the other server. If one server fails, the other server will have the same db and can be used this as the Disaster Recovery plan. The key feature of log shipping is that it will automatically backup transaction logs throughout the day and automatically restore them on the standby server at defined interval.

Report Error

View answer Workspace Report Error Discuss

Subject: SQL

0 3926
Q:

Which SQL keyword is used to sort the result-set?

A) ORDER B) ORDER BY
C) SORT BY D) SORT
 
Answer & Explanation Answer: B) ORDER BY

Explanation:

SQL keyword ORDER BY is used to sort the result-set.

Report Error

View Answer Report Error Discuss

Filed Under: SQL
Job Role: Analyst , Database Administration , IT Trainer

1 3867
Q:

How to rebuild Master Database?

Answer

Master database is system database and it contains information about running server's configuration. When SQL Server 2005 is installed it usually creates master, model, msdb, tempdb resource and distribution system database by default. Only Master database is th one which is absolutely must have database. Without Master database SQL Server cannot be started. This is the reason it is extremely important to backup Master database.


To rebuild the Master database, Run Setup.exe, verify, and repair a SQL Server instance, and rebuild the system databases. This procedure is most often used to rebuild the master database for a corrupted installation of SQL Server.

Report Error

View answer Workspace Report Error Discuss

Subject: SQL

0 3646