23 September, 2020
Ans: SQL is a language that is used to communicate with the database and this language supports operations like insertion, update, retrieval, and deletion.
Ans: SQL Server runs on port 1433. It can be changed from the Network Utility TCP/IP properties.
Ans: To hide a SQL Server instance, we need to make a change in SQL Server Configuration Manager. To do this launch SQL Server Configuration Manager and do the following: select the instance of SQL Server, right-click, and select Properties. After selecting properties you will just set Hide Instance to “Yes” and click OK or Apply. After the change is made, you need to restart the instance of SQL Server to not expose the name of the instance.
Ans: A clustered index is a special type of index that reorders the way records in the table are physically stored. Therefore the table can have only one clustered index. The leaf nodes of a clustered index contain the data pages.
A non clustered index is a special type of index in which the logical order of the index does not match the physical stored order of the rows on disk. The leaf node of a non clustered index does not consist of the data pages. Instead, the leaf nodes contain index rows.
Ans: The new commands are to TRY and CATCH.
Although they do not directly replace any specific command, in many respects the TRY and CATCH have been used over the RAISERROR command.
The TRY block is for the business logic and the CATCH logic is for capturing the error.
Ans: Both primary key and unique key enforces the uniqueness of the column on which they are defined. But by default primary key creates a clustered index on the column, where are unique creates a nonclustered index by default. Another major difference is that the primary key doesn't allow NULLs, but the unique key allows one NULL only.
If you want to enrich your career and become a professional in SQL Server, then visit Tekslate - a global online training platform: "SQL Server Training" This course will help you to achieve excellence in this domain.
Ans: Below are the list of properties relational table should have
Ans: They specify a search condition for a group or an aggregate. But the difference is that HAVING can be used only with the SELECT statement. HAVING is typically used in a GROUP BY clause. When GROUP BY is not used, HAVING behaves like a WHERE clause. Having Clause is basically used only with the GROUP BY function in a query whereas WHERE Clause is applied to each row before they are part of the GROUP BY function in a query.
Ans: ACID is used for evaluating application and database architecture. Below are the ACID properties –
Ans: This is the combination of fields/columns which are used to uniquely specify a row. The primary key has a unique constraint defined on the column and the value in the column cannot be NULL.
Ans: A table can have one of the following index configurations:
Ans: SQL Profiler is a graphical tool that allows system administrators to monitor events in an instance of Microsoft SQL Server. You can capture and save data about each event to a file or SQL Server table to analyze later. For example, you can monitor a production environment to see which stored procedures are hampering performances by executing too slowly.
Use SQL Profiler to monitor only the events in which you are interested. If traces are becoming too large, you can filter them based on the information you want, so that only a subset of the event data is collected. Monitoring too many events adds overhead to the server and the monitoring process and can cause the trace file or trace table to grow very large, especially when the monitoring process takes place over a long period of time.
Ans: The sp_MSforeachdb system stored procedure accepts the @Command parameter which can be issued against all databases. The '?' is used as a placeholder for the database name to issue the same command.
The alternative is to use a cursor to process specific commands against each database.
Ans: Hotfixes are software patches that were applied to live systems (the ones still running.) A hotfix is a single, cumulative package that includes one or more files used to address a problem in a software product (i.e. a software bug).
In Microsoft SQL SERVER context, hotfixes are small patches designed to address specific issues, most commonly to freshly-discovered security holes.
Ans: list of locks available in SQL Server –
Ans: In OLTP - online transaction processing systems relational database design uses the discipline of data modeling and generally follows the Codd rules of data normalization in order to ensure absolute data integrity. Using these rules complex information is broken down into its most simple structures (a table) where all of the individual atomic level elements relate to each other and satisfy the normalization rules.
Ans: The ability to issue a batch 'N number of times' based on the value following the GO command.
In some respects, this functionality replaces using a WHILE loop.
Ans: This command is basically used when a large processing of data has occurred. If a large number of deletions any modification or Bulk Copy into the tables has occurred, it has to update the indexes to take these changes into account. UPDATE_STATISTICS updates the indexes on these tables accordingly.
Ans: SQL Server agent plays an important role in the day-to-day tasks of a database administrator (DBA). It is often overlooked as one of the main tools for SQL Server management. Its purpose is to ease the implementation of tasks for the DBA, with its full-function scheduling engine, which allows you to schedule your own jobs and scripts.
Ans: SELECT * FROM table1 SELECT COUNT(*) FROM table1 SELECT rows FROM sysindexes WHERE id = OBJECT_ID(table1) AND did < 2
Ans: STUFF function is used to overwrite existing characters. Using this syntax, STUFF (string_expression, start, length, replacement_characters), string_expression is the string that will have characters substituted, a start is the starting position, the length is the number of characters in the string that are substituted, and replacement_characters are the new characters interjected into the string. REPLACE function to replace existing characters of all occurrences. Using the syntax REPLACE (string_expression, search_string, replacement_string), where every incidence of search_string found in the string_expression will be replaced with replacement_string.
Ans: Foreign key is used to establish a relationship between the columns of other tables. Foreign key relationship to be created between two tables by referencing a column of the table to the primary key of another table.
Ans: The two authentication modes of SQL server –