MSSQL Objective Questions and Answers for Beginners Set-1
1. What does 'SQL' stand for in the context of database management systems?
Explanation: SQL stands for 'Structured Query Language', which is a standard language used for managing and manipulating relational databases.
2. What is the primary key in a database table?
Explanation: The primary key is a column or a set of columns in a table that uniquely identifies each row in the table. It ensures the integrity of the data and helps in efficient retrieval of data.
3. Which SQL keyword is used to retrieve data from a database table?
Explanation: The SELECT keyword is used to retrieve data from a database table. It allows you to specify the columns you want to retrieve and the conditions to filter the data.
4. How do you add a new record to a database table?
Explanation: The INSERT INTO statement is used to add a new record to a database table. You need to specify the table name and provide the values for the columns in the new record.
5. What is the purpose of the WHERE clause in an SQL query?
Explanation: The WHERE clause is used to filter the rows returned by an SQL query. It allows you to specify a condition, and only the rows that satisfy that condition will be included in the result set.
6. Which SQL function is used to find the maximum value in a column?
Explanation: The MAX() function is used to find the maximum value in a column. It is often used with numeric or date columns to retrieve the highest value in the specified column.
7. What does the SQL abbreviation "DDL" stand for?
Explanation: DDL stands for Data Definition Language. It is used to define, manage, and modify the structure of database objects such as tables, indexes, and constraints.
8. Which SQL statement is used to update existing records in a table?
Explanation: The UPDATE statement is used to modify existing records in a database table. It allows you to change the values of one or more columns in the selected rows.
9. What is the purpose of the SQL GROUP BY clause?
Explanation: The GROUP BY clause is used to group the result set based on the values in one or more columns. It is often used with aggregate functions like SUM, COUNT, AVG, etc
10. Which SQL function is used to count the number of rows in a table?
Explanation: The COUNT() function is used to count the number of rows in a table. It can also be used with the DISTINCT keyword to count the number of distinct values in a column.
11. What is the purpose of the SQL ORDER BY clause?
Explanation: The ORDER BY clause is used to sort the rows in the result set in ascending or descending order based on the values in one or more columns.
12. Which SQL statement is used to delete records from a table?
Explanation: The DELETE statement is used to remove records from a database table. It allows you to specify a condition to delete specific rows or delete all rows in the table.
13. What is the purpose of the SQL HAVING clause?
Explanation: The HAVING clause is used with the GROUP BY clause to filter the groups in the result set based on a condition. It is used with aggregate functions to filter grouped data.
14. Which SQL function is used to find the average value in a column?
Explanation: The AVG() function is used to calculate the average value of a column that contains numeric data. It returns the average as a decimal or floating-point number.
15. What is the purpose of the SQL JOIN clause?
Explanation: The JOIN clause is used to combine rows from two or more tables based on a related column between them. It allows you to retrieve data from multiple tables in a single query.
Rate Your Experience
: 89
: 1
Last updated in November, 2024
Quick Access