Question:- What is the difference between DROP and TRUNCATE commands?
Answer:- If a table is dropped, all things associated with that table are dropped as well. This includes the relationships defined on the table with other tables, access privileges, and grants that the table has, as well as the integrity checks and constraints. To create and use the table again in its original form, all the elements associated with the table need to be redefined. However, if a table is truncated, there are no such problems as mentioned above. The table retains its original structure.
Question:- What is a “TRIGGER” in SQL?
Answer:- The trigger can be defined as an automatic process that happens when an event occurs in the database server. It helps to maintain the integrity of the table. The trigger is activated when the commands, such as insert, update, and delete, are given. The syntax used to generate the trigger function is: CREATE TRIGGER trigger_name
Question:- Where are usernames and passwords stored in SQL Server?
Answer:- In SQL Server, usernames and passwords are stored in the main database in the sysxlogins table.
Question:- What are the types of relationships in SQL Server databases?
Answer:- Relationships are developed by interlinking the column of one table with the column of another table. There are three different types of relationships, which are as follows: • One-to-one relationship • Many-to-one relationship • Many-to-many relationship
Question:- What are the third-party tools that are used in SQL Server?
Answer:- The following is the list of third-party tools that are used in SQL Server: • SQL CHECK • SQL DOC 2 • SQL Backup 5 • SQL Prompt • Litespeed 5.0
Question:- How can you handle expectations in SQL Server?
Answer:- TRY and CATCH blocks handle exceptions in SQL Server. Put the SQL statement in the TRY block and write the code in the CATCH block to handle expectations. If there is an error in the code in the TRY block, then the control will automatically move to that CATCH block.
Question:- How many authentication modes are there in SQL Server? And what are they?
Answer:- Two authentication modes are available in SQL Server. They are: • Windows Authentication Mode: It allows authentication for Windows but not for SQL Server. • Mixed Mode: It allows both types of authentication—Windows and SQL Server.
Question:- What is a function in SQL Server?
Answer:- A function is an SQL Server database object. It is basically a set of SQL statements that allow input parameters, perform processing, and return results only. A function can only return a single value or table; the ability to insert, update, and delete records in database tables is not available.
Question:- Mention different types of replication in SQL Server?
Answer:- In SQL Server, three different types of replications are available: • Snapshot replication • Transactional replication • Merge replication
Question:- What is the COALESCE function?
Answer:- The COALESCE function takes a set of inputs and returns the first non-null value. Syntax: COALESCE(val1,val2,val3,……,nth val) Example: SELECT COALESCE(NULL, 1, 2, ‘MYSQL’) Output: 1
Question:- Can we link SQL Server with others?
Answer:- SQL Server allows the OLEDB provider, which provides the link, to connect to all databases. Example: Oracle, I have an OLEDB provider that has a link to connect with an SQL Server group.
Question:- SQL Server allows the OLEDB provider, which provides the link, to connect to all databases. Example: Oracle, I have an OLEDB provider that has a link to connect with an SQL Server group.
Answer:- SQL Server Agent plays an important role in the daily work of SQL Server administrators or DBAs. This is one of the important parts of SQL Server. The aim of the server agent is to easily implement tasks using a scheduler engine that enables the tasks to be performed at scheduled times. SQL Server Agent uses SQL Server to store scheduled management task information.
Question:- What do you know about magic tables in SQL Server?
Answer:- A magic table can be defined as a provisional logical table that is developed by an SQL Server for tasks such as insert, delete, or update (DML) operations. The operations recently performed on the rows are automatically stored in magic tables. Magic tables are not physical tables; they are just temporary internal tables.
Question:- What are some common clauses used with SELECT queries in SQL?
Answer:- There are many SELECT statement clauses in SQL. Some of the most commonly used clauses with SELECT queries are: • FROM The FROM clause defines the tables and views from which data can be interpreted. The tables and views listed must exist at the time the question is given. • WHERE The WHERE clause defines the parameters that are used to limit the contents of the results table. You can test for basic relationships or for relationships between a column and a series of columns using subselects. • GROUP BY The GROUP BY clause is commonly used for aggregate functions to produce a single outcome row for each set of unique values in a set of columns or expressions. • ORDER BY The ORDER BY clause helps in choosing the columns on which the table’s result should be sorted. • HAVING The HAVING clause filters the results of the GROUP BY clause by using an aggregate function.
