Search the Blog

Monday, October 14, 2019

Sql Server DBA Interview Question more than 1000

Question 1. What Is The Difference Between Lock, Block And Deadlock?


Solution -


Lock: DB engine locks the rows / page / table to access 
the data which is worked upon according to the query.
Block: When one process blocks the resources of another
process then the situation occured is called blocking. Blocking can be identified by using the following query
SELECT * FROM sys.dm_exec_requests 
where blocked <> 0
SELECT * FROM master..sysprocesses 
where blocked <> 0

Deadlock: When something happens as follows:
 Error 1205 is reported by SQL Server for deadlock.

Question 2. what is the sequence of SQL statement are processed in SQL Server?



Solution - The clauses of the select are processed in 

the following sequence
  1. FROM clause
  2. WHERE clause
  3. GROUP BY clause
  4. HAVING clause
  5. SELECT clause
  6. ORDER BY clause
  7. TOP clause

Question 3. on which TCP/IP port does SQL Server run?

Solution - By default SQL Server runs on port 1433. 
But according to requirement is can be changed such as we have more than one instance of SQL Server, 
Then  differenet port can be assigned to different Instances

Thursday, October 10, 2019

SQL Server constraint

CHECK constraint

A CHECK constraint can be applied to a column in a table to limit the values that can be placed in a column. Check constraint is to enforce integrity.

Sql Server Check Contraints Applicable query
After this if we used to insert the following query

insert into employees values(0,'Sawan','Chauan',24567)

Then following Output Message will be diplayed.
if SQL Constraints fails then following output will be displayed

Second Example of Query

SQL Server Check Constraints

When we try to insert the following -
Check Contraints complete query SQL server 2017
Then we will receive the above error



TRY----CATCH constructs

To handles exceptions by writing scripts inside the TRY block and error handling in the CATCH block

Wednesday, October 9, 2019

Indexes in Python

Indexing is a standard feature of most programming languages. Java, Python, C#, C++, and C all have syntax like E[i] whereby an item with index i can be reference in E (which might be a character string, an array of numbers etc). 
Python Indexes


Python goes further beyond, it is possible to refer to chunks  of a sequence instead of indexing items one at a time. This feature in python is called slicing a sequence. Other techniques, like split and join, make it easy to take apart strings and assemble lists of strings into a new strings . In the same way that hand tools allow people to cut, shape, reshape, and put together wood into furniture, slicing, split, and join operations form the “carpentry” of Python’s text processing tasks. Even more powerful methods, notabe regular expressions, could be likened to the power tools of text and string processing. This post only covers the basic techniques, leaving regular expressions and other more advance libraries of software as later topics to explore. Working with slices particularly in Python’s syntax for slices, takes some getting used to. With regular practice, it becomes easy to write expressions that take apart sequences in creative ways and use operators to assemble slices into a new sequences. For strings slicing is only the beginning. String methods provide ways to search, replace, trim and form new strings from sequences of strings.

Following three methods are used to get the data in python via indexing
  1    loc() Only for lables
  2    iloc()  only for integer
  3    ix()  for both label and and integer.


Pandas Indexing with jupyter complete tutorialk to underatnd the concept and learning

Pandas Indexing with jupyter complete tutorial to understnd the concept and learning of data science

Pandas Indexing with jupyter complete tutorial to understnd the concept and learning of data science  for beginner

Pandas Indexing with jupyter complete tutorial to understnd the concept and learning of data science  for beginner and fresher

Pythan index with jupyter complete tutorial with example





Translate