• Home
  • SQL Server
    • Articles
    • T-SQL Puzzles
    • Output Puzzles
    • Interview Questions
    • Performance Tuning
    • SQL SERVER On Linux
    • Resources
  • SSRS
    • SSRS Articles
    • Interview Questions
  • SSAS
    • SSAS Articles
    • DAX
  • SQL Puzzles
  • Interview Questions
    • SQL Interview Questions
    • Data Interview Questions
  • Python Interview Puzzles
  • New Features(SQL SERVER)
    • SQL SERVER 2017
    • SQL SERVER 2016
    • SQL SERVER On Linux
  • Social
    • Expert Exchange
      • Top Expert in SQL
      • Yearly Award
      • Certifications
      • Achievement List
      • Top Expert of the Week
    • HackerRank (SQL)
    • StackOverflow
    • About Me
      • Contact Me
      • Blog Rules

Improving my SQL BI Skills

Improving my SQL BI Skills

Tag Archives: Server Interview Questions Book

SQL Server Interview Questions – Set 11 (10 Questions )

01 Friday Jul 2016

Posted by Pawan Kumar Khowal in Download SQL Interview Q's, SQL SERVER, SQL Server Interview Questions

≈ Leave a comment

Tags

Advanced SQL Interview Questions and Answers, Advanced SQL tutorial pdf, Download SQL Server Interview Question in PDF, Download SQL SERVER Interview questions, Download SQL Server Interview questions and answers, download sql server interview questions and answers pdf, download sql server interview questions by Pawan Khowal, download sql server interview questions by Pawan Kumar, download sql server interview questions by Pawan Kumar Khowal, Download T-SQL Interview Questions, Server Interview Questions Book, SQL Questions


SQL Server Interview Questions – Set 11 (10 Questions )

Sr No Download Download URL
17 SQL Server Interview Questions AND Answers [SET 11](10 Questions & Answers) Download

Question 1 : How do we get time difference between two date time variables in SQL Server?

Answer :

Query to get time difference between 2 date time variables


--


DECLARE @Start DATETIME = '6/24/2016 2:21'	
DECLARE @End DATETIME = '6/24/2016 12:02'
SELECT CONVERT(VARCHAR, @End - @Start, 108)  [ExactTime - Hr : Mins : SS]
GO

DECLARE @Start DATETIME = '6/18/2016 7:30'	
DECLARE @End DATETIME = '6/18/2016 16:37'
SELECT CAST((@End - @Start) AS TIME)  
[ExactTime - Hr : Mins : SS]
GO


--

Question 2 : How to get Time Part only from DateTime variable in Sql Server?

Answer :

https://msbiskills.com/2016/06/26/sql-puzzle-how-to-get-date-part-time-part-only-from-datetime-in-sql-server-multiple-methods/

Question 3 : Can you write a query to get file details of a database?

Answer :

Query to get Data and log file details of a database


--


USE TEMPDB
EXEC sp_helpfile
GO


USE Master
EXEC sp_helpfile
GO


--

TempDB Files (Data Files & Log Files)

TempDB Files (Data Files & Log Files)

Question 4 : Why index REBUILD does not reduce index fragmentation?

Answer :

DBAs use ALTER INDEX REBUILD to remove index fragmentation. In some cases, REBUILD does not remove this fragmentation. Now why it does not reduce index fragmentation. This case will appear when in the indexes are very small.

Now if an index is very small (that is less than 8 pages) it will use mixed extents. Therefore, it’ll appear as if there is still fragmentation remaining, as the host extent will contain pages from multiple indexes.

Because of this, and also the fact that in such a small index that fragmentation is typically negligible, you really should only be rebuilding indexes with a certain page threshold. It is best practices to rebuild fragmented indexes that are a minimum of 1000 pages.

Question 5 : How to move the TempDB to new drive when the drive is full?

Answer :

You will get below error when the tempDB is full.

The LOG FILE FOR DATABASE ‘tempdb’ IS FULL. Back up the TRANSACTION LOG FOR the DATABASE TO free Up SOME LOG SPACE

Script to move your temp database to new drive.


--


USE tempdb
GO
sp_helpfile
GO


USE MASTER
GO

ALTER DATABASE TempDB MODIFY FILE 
(NAME = tempdev, FILENAME = 'd:\Pawantempdb.mdf')
GO

ALTER DATABASE TempDB MODIFY FILE 
(NAME = templog, FILENAME = 'e:\Pawantemplog.ldf')
GO



--

When you execute above script you will see the message that query has run successfully. However, there will be no changes in how the temp database is configured. The location of the TempDB changed when SQL Server will restart services again. You will be able to see the changes only after the services are restarted.

Moving temp database to another file group which is on a different physical drive helps to improve database disk read.

Question 6 : How many tempDB data files you should have?

Answer :

Well it is a very difficult question to answer. People say different things about number of data files you should have in your tempDB.

As per Bod Ward’s (CTO-CSS Microsoft) Session in 2011.

a. If you have less than 8 Cores, then number of data files in tempDB should be equal to the number of cores.

b. If you have greater than 8 cores, then start with 8 data files in tempDB and if you still seeing tempdb contention than increase the data files in a block of 4.

You should not have too many data files. If you have too many data files and you have large memory spills that come out of tempDB then the performance can be slowed down.

Note – All the data files should be of the same size. Otherwise the largest size one will auto grow.

In SQL 2016 tempDB has following data files with same size.

TempDb Data & log Files - Pawan Khowal

TempDb Data & log Files – Pawan Khowal

Question 7 : How do you get count of logical cpu’s using SQL?

Answer :


--


SELECT scheduler_id, cpu_id, STATUS, is_online 
FROM sys.dm_os_schedulers 
WHERE status = 'VISIBLE ONLINE'
GO

SELECT cpu_count
FROM sys.dm_os_sys_info
GO


--

Question 8 : How to store pdf file in SQL Server?

Answer :

For this there are 2 options-

1. Create a column as type ‘blob’ in a table. Read the content of the file and save in ‘blob’ type column in a table.

2. Store them in a folder and establish the pointer to link them in the database.

Question 9 : What is the purpose of OPENXML clause SQL server stored procedure?

Answer :

Answer : OPENXML parses the XML data in SQL Server in an efficient manner. Its primary ability is to insert XML data to the RDB. It is also possible to query the data by using OpenXML. The path of the XML element needs to be specified by using ‘xpath’.

Example-

SampleXMLInWordFile


--

--Table Existance

IF OBJECT_ID ( N'[dbo].[Resources]' ) > 0
	DROP TABLE [dbo].[Resources]
GO


--Create Table Script

CREATE TABLE Resources
(
	[Data] XML	
)
GO

--Insert Data Script

INSERT INTO Resources
SELECT * FROM OPENROWSET (BULK 'E:\SampleXML.xml', SINGLE_BLOB) AS data
GO

DECLARE @XML AS XML, @hDoc AS INT

SELECT @XML = [Data] FROM Resources

EXEC sp_xml_preparedocument @hDoc OUTPUT, @XML

SELECT 
		*
FROM 
		OPENXML(@hDoc, '/resource-data/record')
WITH 
(
		 EmployeeId INT 'EmployeeID'
		,DateofJoining VARCHAR(100) 'DOJ'
		,Skills VARCHAR(200) 'Skills'
		,DomainExperience VARCHAR(100) 'DomainExperience'
		,Rating VARCHAR(2) 'Rating'
		,CommunicationsRating VARCHAR(1) 'CommunicationsRating'
		,GP VARCHAR(1) 'NAGP'
		,YearsOfExperience INT 'YearsOfExperience'
		,CurrentRole VARCHAR(100) 'CurrentRole'
		,PreviousCustomerExperience VARCHAR(100)   'PreviousCustomerExperience'
		,AvailableFromDate VARCHAR(10) 'AvailableFromDate'
)

EXEC sp_xml_removedocument @hDoc

--

Question 10 : What is the output of query 1 and query 2?


--

CREATE TABLE CrossJoin1
(
	a INT IDENTITY(1,1)
)
GO

INSERT INTO CrossJoin1 DEFAULT VALUES
GO 10

CREATE TABLE CrossJoin2
(
	a INT IDENTITY(1,1)
)
GO

-------------- QUERY 1 ----------------------

SELECT 
	CrossJoin1.*
FROM 
	CrossJoin1,CrossJoin2


-------------- QUERY 2 ----------------------

SELECT 
	CrossJoin1.*
FROM 
	CrossJoin1 CROSS JOIN CrossJoin2


--

Answer :

Both the queries will return 0 rows.

Thanks!That’s all folks; I hope you’ve enjoyed the article and I’ll see you soon with some more articles.

Pawan Kumar Khowal

MSBISKILLS.COM

Share this

  • LinkedIn
  • Facebook
  • Twitter
  • WhatsApp
  • Email

SQL Server Interview Questions – Set 10 (10 Questions )

23 Thursday Jun 2016

Posted by Pawan Kumar Khowal in Download SQL Interview Q's, SQL Concepts, SQL SERVER, SQL Server Interview Questions

≈ 1 Comment

Tags

Advanced SQL Interview Questions and Answers, Advanced SQL tutorial pdf, Download SQL Server Interview Question in PDF, Download SQL SERVER Interview questions, Download SQL Server Interview questions and answers, download sql server interview questions and answers pdf, download sql server interview questions by Pawan Khowal, download sql server interview questions by Pawan Kumar, download sql server interview questions by Pawan Kumar Khowal, Download T-SQL Interview Questions, Server Interview Questions Book, SQL Questions


SQL Server Interview Questions – Set 10 (10 Questions )

Sr No Download Download URL
16 SQL Server Interview Questions AND Answers [SET 10](10 Questions & Answers) Download

Question 1 : What is a CheckPoint?

Answer :

There are two built in automatic mechanisms SQL Server uses to scan the buffer cache periodically and writes any dirty pages to disk.
• The Lazy Writer
• Checkpoint process

Checkpoint

A checkpoint always writes out all pages that have changed (known as being marked dirty) since the last checkpoint, or since the page was read in from disk. It doesn’t matter whether the transaction that changed the page has committed or not. The page is written to disk regardless.

The goal of checkpoint is to reduce the amount of time Sql Server takes to perform rollforward and rollback operations.

The only exception is for tempDB, where data pages are not written to disk as part of a checkpoint. A checkpoint is only done for tempDB when the tempDB log file reaches 70% full – this is to prevent the tempDB log from growing if at all possible (note that a long-running transaction can still essentially hold the log hostage and prevent it from clearing, just like in a user database).

Checkpoint can be triggered from any of the below –

From a Manual Checkpoint


--


CheckPoint
GO


--

From a database or differential backup


--


ALTER DATABASE DBName SET TARGET_RECOVERY_TIME = target_recovery_time { SECONDS | MINUTES}
GO;


--

Automatically


--


EXEC [sp_configure] '[recovery interval]', 'seconds'
GO;

--

Example – Manual


--


CREATE TABLE tab 
(
	Id INT
)
GO

INSERT INTO tab VALUES (1), (2), (3)
GO


CHECKPOINT
GO


SELECT * FROM FN_DBLOG (NULL, NULL)
GO


--

Fn_db Log

Fn_db Log

Question 2 : What is a Lazy Writer?

Answer :

There are two built in automatic mechanisms SQL Server uses to scan the buffer cache periodically and writes any dirty pages to disk.
• The Lazy Writer
• Checkpoint process

The Lazy Writer

The function of LAZY WRITER is to release the buffer pool memory. When there is a memory pressure and more memory required e.g. for bringing in new pages to the cache. (Buffer Pool / Data Cache / Buffer Cache), Lazy writer releases the “coldest” pages from the buffer pool and makes more memory available for new pages to come in.

Cold Pages means least recently read or written, not accessed in recent time.

If lazy writer constantly has a lots of work to do, starting to purge pages that are not old at all you have a problem with buffer cache memory. You do not want page’s flow though the buffer cache like a free flowing water. You want them to stay there and be reused, read/written and rewritten again in-memory and not the disk which is slow compared to memory, as long as possible.

Question 3 : What is the difference between Lazy Writer and CheckPoint?

Answer :

They both write in-memory pages to the data files on the disk. But which pages, when, and do they release memory or not – there is the difference!

CHECKPOINT writes only dirty pages to the disk (dirty = changed in memory since the last checkpoint, not yet written/check pointed to disk), making them “clean”. Checkpoint does not release any memory, the pages STAY in memory, they are not removed from the buffer pool!

LAZY WRITER looks for least recently used (“cold” = least recently read or written, not accessed in recent time) pages in the buffer pool, and releases the memory taken by them. Lazy writer releases both dirty and clean pages. Clean pages can be released without writing to disk, but dirty pages must first be written to the disk (“flushed” to the disk and become “clean”) and then buffer pool memory can be released. So, total number of pages that lazy writer releases can be higher than the number of pages’ lazy writer writes to the data files, because “clean” pages can be released without writing them to disk. The final result of the lazy writer is less buffer pool memory used, therefore more memory available for the fresh pages in the buffer pool.

Checkpoint process is more efficient in writing to the disk because it can group subsequent pages into larger disk IOs, e.g. 128KB IO size. It internally uses WriteFileGather Windows API function.

Lazy writer can only write 8K pages. Therefore, checkpoint disk throughput is much better than lazy writer’s.

Question 4 : What is a Buffer Pool?

Answer :

A SQL Server buffer pool, also called an SQL Server buffer cache, is a place in system memory that is used for caching table and index data pages as they are modified or read from disk.

Pages are stored in buffers in a Buffer Pool. The buffers are hashed so that they can easily found by DB.

You can see what pages are currently in the buffer pool, and their status using the sys.dm_os_buffer_descriptors

Buffer Dscriptors

Buffer Dscriptors

Question 5 : What is a Log Flush?

Answer :

Log Flush also writes pages to disk. It writes pages from Log Cache into the Transactional log file (LDF). Once a transaction completes, Log Flush writes those pages (from Log Cache) to LDF file on disk.

Each and every transaction that results in data page changes, also incurs some Log Cache changes. At the end of each transaction (commit), these changes from Log Cache are flushed down to the physical file (LDF). So, in essence, the number of log flushes depend on number of transactions.

Note that SELECT statements do not result in any data page changes, so there are no changes to Log Cache, so no Log Flushes to Transactional Log file.

Question 6 : What is the Output of below statement?


--


CREATE TABLE Addy
(
	  ID SmallINT IDENTITY(1,1)
	, Name VARCHAR(5) DEFAULT 'Pawan'
	, 
)
GO

--

Answer :

You will not get any error when you execute the above statement. You will get “Command(s) completed successfully.”. This is a well know issue with the SQL Server.

Question 7 : Is there a way to Select Identity column without specifying Identity column name in the select list?

Answer :

I am not sure where we will get this kind of requirement. Yes, there are two ways to achieve this.

Solution 1 | IDENTITYCOL


--


CREATE TABLE Addy
(
	  ID SmallINT IDENTITY(1,1)
	, Name VARCHAR(5) DEFAULT 'Pawan'
	, 
)
GO

INSERT INTO Addy DEFAULT VALUES
GO 2

SELECT IDENTITYCOL, Name FROM Addy

--

Solution 2 | $IDENTITY


--


CREATE TABLE Addy1
(
	  ID SmallINT IDENTITY(1,1)
	, Name VARCHAR(5) DEFAULT 'Pawan'
	, 
)
GO

INSERT INTO Addy1 DEFAULT VALUES
GO 2

SELECT $IDENTITY, Name FROM Addy1


--

These are reserved words. Microsoft SQL Server uses reserved keywords for defining, manipulating, and accessing databases. Reserved keywords are part of the grammar of the Transact-SQL language that is used by SQL Server to parse and understand Transact-SQL statements and batches.

Although it is syntactically possible to use SQL Server reserved keywords as identifiers and object names in Transact-SQL scripts, you can do this only by using delimited identifiers.

Question 8 : What is the purpose of Resource DB in SQL Server?

Answer :

1. The Resource database is a read-only database that contains all the system objects that are included with SQL Server.

2. SQL Server system objects, such as sys.objects, are physically persisted in the Resource database, but they logically appear in the sys schema of every database.

3. The Resource database does not contain user data or user metadata.

4. The Resource database is used in upgrading to a new version of SQL Server an easier and faster procedure.

For details please refer below –

https://msbiskills.com/2015/09/07/sql-server-resource-database-deep-dive/

Question 9 : Provide Outputs of SQL Queries?


--


DECLARE @ NVARCHAR(6) = N'पवन'
SELECT @
GO


DECLARE @ NVARCHAR(6) = 'पवन'
SELECT @
GO


--

Answer :

Output of 1st Query –

पवन

Output of 2nd Query – The reason for this is we have not provided N before the initialization part.

???

Question 10 : What is a live lock? How it is different from Deadlock?

Answer :

A deadlock occurs when two processes compete for the same resources, but in an order which causes a stalemate. For example, A locks X, then tries to lock Y, while B has locked Y and tries to lock X. The key is that the two (or more) processes are preventing each other from doing anything.

A livelock occurs when there are overlapping shared locks that prevent another process from acquiring the exclusive lock it needs. The difference is that all of these overlapping processes continue to get their work done, so they are still “live” – only the victim is blocked until they are done. Which may be never on a busy enough, poorly designed system. 🙂 You may be able to overcome this situation by escalating the deadlock priority for your writers, but I’ll be honest, this isn’t a scenario I’ve seen very often, and I’ve worked with SQL Server since 2000.

That’s all folks; I hope you’ve enjoyed the article and I’ll see you soon with some more articles.

Thanks!

Pawan Kumar Khowal

Share this

  • LinkedIn
  • Facebook
  • Twitter
  • WhatsApp
  • Email

SQL Server Interview Questions – Set 9 (10 Questions )

17 Friday Jun 2016

Posted by Pawan Kumar Khowal in Download SQL Interview Q's, SQL Concepts, SQL Performance Tuning, SQL SERVER, SQL Server Interview Questions

≈ Leave a comment

Tags

Advanced SQL Interview Questions and Answers, Advanced SQL tutorial pdf, Download SQL Server Interview Question in PDF, Download SQL SERVER Interview questions, Download SQL Server Interview questions and answers, download sql server interview questions and answers pdf, download sql server interview questions by Pawan Khowal, download sql server interview questions by Pawan Kumar, download sql server interview questions by Pawan Kumar Khowal, Download T-SQL Interview Questions, Server Interview Questions Book, SQL Questions


SQL Server Interview Questions – Set 9 (10 Questions )

Sr No Download Download URL
13 SQL Server Interview Questions AND Answers [SET 9](10 Questions & Answers) Download

Question 1 : What is the first Version of SQL Server?

Answer :

Microsoft SQL Server is a relational database management system developed by Microsoft. The First version of SQL Server was released in 1989.

In 1988 Microsoft joined Ashton-Tate and Sybase to create a variant of Sybase SQL Server for IBM OS/2 (then developed jointly with Microsoft), which was released the following year. This was the first version of Microsoft SQL Server, and served as Microsoft’s entry to the enterprise-level database market, competing against Oracle, IBM, and later, Sybase.

SQL Server 4.2 was shipped in 1992, bundled with OS/2 version 1.3, followed by version 4.21 for Windows NT, released alongside Windows NT 3.1. SQL Server 6.0 was the first version designed for NT, and did not include any direction from Sybase.

The Latest entry to the list is SQL Server 2016. Please find the history below.
(Ref – https://en.wikipedia.org/wiki/Microsoft_SQL_Server)

SQL Server History - Version Details

SQL Server History – Version Details

Question 2 : What is the maximum number of parameters we can declare in a Stored Procedure or Function in SQL Server 2016?

Answer :

The maximum number of parameters we can declare in a stored procedure or function is 2100. The value of each declared parameter must be supplied by the user when the procedure is called unless a default value for the parameter is defined or the value is set to equal another parameter.

Question 3 : What is a Latch?

Answer :

Latches are lightweight synchronization primitives that are used by the SQL Server engine to guarantee consistency of in-memory structures including; index, data pages and internal structures such as non-leaf pages in a B-Tree.

Latched are first introduced in SQL 7.0 for Data Pages. Well there are three types of latches in SQL Server.

• IO Latches
• Buffer Latches (BUF)
• Non-Buffer Latches (Non-BUF)

IO Latches & Buffer Latches (BUF)

SQL Server uses buffer latches to protect pages in the buffer pool and I/O latches to protect pages not yet loaded into the buffer pool. Whenever data is written to or read from a page in the SQL Server buffer pool a worker thread must first acquire a buffer latch for the page. There are various buffer latch types available for accessing pages in the buffer pool including exclusive latch (PAGELATCH_EX) and shared latch (PAGELATCH_SH).

Non-Buffer latches-

Latches are also used to protect access to internal memory structures other than buffer pool pages; these are known as Non-Buffer latches.

Latches are only controlled by SQL Server Engine. You can see the waiting times introduced with these types of latches in the DMV sys.dm_os_wait_stats in the following picture.

Latch Stats - Pawan Kumar Khowal

Latch Stats – Pawan Kumar Khowal

Question 4 : What is the difference between Latch and Lock?

Answer :

Latches are internal to the SQL engine and are used to provide memory consistency, whereas locks are used by SQL Server to provide logical transactional consistency. The following table compares latches to locks:

Structure Purpose Controlled by Performance cost Exposed by
Latch Guarantee consistency of in-memory structures. SQL Server engine only. Performance cost is low. To allow for maximum concurrency and provide maximum performance, latches are held only for the duration of the physical operation on the in-memory structure, unlike locks which are held for the duration of the logical transaction. sys.dm_os_wait_stats (Transact-SQL)

(http://go.microsoft.com/fwlink/p/?LinkId=212508)
– Provides information on PAGELATCH, PAGEIOLATCH and LATCH wait types (LATCH_EX, LATCH_SH is used to group all non-buffer latch waits).

•sys.dm_os_latch_stats

(Transact-SQL) (http://go.microsoft.com/fwlink/p/?LinkId=212510)
–
Provides detailed information about non-buffer latch waits.

•sys.dm_os_latch_stats

(Transact-SQL) (http://go.microsoft.com/fwlink/p/?LinkId=223167)

– This DMV provides aggregated waits for each index, which is very useful for troubleshooting latch related performance issues.

Structure Purpose Controlled by Performance cost Exposed by
Lock Guarantee consistency of transactions. Can be controlled by user. Performance cost is high relative to latches as locks must be held for the duration of the transaction. sys.dm_tran_locks

(Transact-SQL) (http://go.microsoft.com/fwlink/p/?LinkId=179926).

•sys.dm_exec_sessions

(Transact-SQL) (http://go.microsoft.com/fwlink/p/?LinkId=182932).

Note
For more information about querying SQL Server to obtain information about transaction locks see Displaying Locking Information (Database Engine) (http://go.microsoft.com/fwlink/p/?LinkId=212519).

Question 5 : What are Spinlocks?

Answer :

Spinlocks are lightweight synchronization primitives which are used to protect access to data structures. Spinlocks are not unique to SQL Server. They are generally used when it is expected that access to a given data structure will need to be held for a very short period of time.

When a thread attempting to acquire a spinlock is unable to obtain access it executes in a loop periodically checking to determine if the resource is available instead of immediately yielding. After some period of time a thread waiting on a spinlock will yield before it is able to acquire the resource in order to allow other threads running on the same CPU to execute. This is known as a backoff.

On any busy high concurrency system, it is normal to see active contention on frequently accessed structures that are protected by spinlocks.

This is only considered problematic when the contention is such that it introduces significant CPU overhead.

Spinlock statistics are exposed by the sys.dm_os_spinlock_stats Dynamic Management View (DMV) within SQL Server. For example, this query yields the following output:

SYS.DM_OS_SPINLOCK_STATS


--


SELECT * FROM SYS.DM_OS_SPINLOCK_STATS
ORDER BY SPINS DESC

--

SpinLock Stats - Pawan Kumar Khowal

SpinLock Stats – Pawan Kumar Khowal

Question 6 : What is the difference between a Latch and a Spinlock?

Answer :

SQL Server utilizes spinlocks to protect access to some of its internal data structures. These are used within the engine to serialize access to certain data structures in a similar fashion to latches.

The main difference between a latch and a spinlock is the fact that spinlocks will spin (execute a loop) for a period of time checking for availability of a data structure while a thread attempting to acquire access to a structure protected by a latch will immediately yield if the resource is not available.

Yielding requires context switching of a thread off the CPU so that another thread can execute. This is a relatively expensive operation and for resources that are held for a very short duration it is more efficient overall to allow a thread to execute in a loop periodically checking for availability of the resource.

Question 7 : What is a SSD?

Answer :

A solid-state drive (SSD, also known as a solid-state disk although it contains neither an actual disk nor a drive motor to spin a disk) is a solid-state storage device that uses integrated circuit assemblies as memory to store data persistently.

SSDs don’t have any moving parts so when a read or write occurs I/O latency will be almost zero. The latency in a spinning drive comes from two things:
• Moving the disk head to the right track on the disk surface (known as the seek time)
• Waiting for the disk to spin to the right point on the track (known as the rotational latency)


This means that SSDs provide a big performance boost when there’s an I/O bottleneck.


Also note that SSD performance can start to degrade as the drive gets really full.

Question 8 : What you mean by CXPACKET?

Answer :

It is a common wait type. CXPACKET means there are queries running in parallel in our servers and we will always see CXPACKET waits for a parallel query. CXPACKET waits does NOT mean that we have a problematic parallelism. You have to dig deeper to determine whether you have an issue or not. The first thing one should look at is whether you expect parallelism for the query that’s using it. Shall explain this in detail in one of the upcoming posts.

Question 9 : Are views quicker than a SELECT Queries?

Answer :

View can be used for the following purposes:

  • To focus, simplify, and customize the perception each user has of the database.
  • As a security mechanism by allowing users to access data through the view, without granting the users permissions to directly access the underlying base tables.
  • To provide a backward compatible interface to emulate a table whose schema has changed.

Simple views are expanded inline & They DO NOT directly contribute to performance improvements. However, indexed views can dramatically improve performance. Indexed views have lot of restrictions, so be careful while using.

Question 10 :


--


SELECT ROUND( 109.87 , - 1 ) , ROUND( 104.99 , - 1 ) , ROUND( 150 , - 2 ) 

SELECT ROUND(748.58, -1)  , ROUND(748.58, -2), 	ROUND(751.58, -2)	

SELECT ROUND(444, -1) ,  ROUND(444, -2) , ROUND(748.58, -0), ROUND(748.58, -4)

--

Answer :

ROUND always returns a value. If length is negative and larger than the number of digits before the decimal point, ROUND returns 0.

Example Result
ROUND(748.58, -4) 0

ROUND returns a rounded numeric_expression, regardless of data type, when length is a negative number.

Example Result
ROUND(748.58, -1) 750.00
ROUND(748.58, -2) 700.00
ROUND(748.58, -3) Results in an arithmetic overflow, because 748.58 defaults to decimal(5,2), which cannot return 1000.00.To round up to 4 digits, change the data type of the input. For example: SELECT ROUND(CAST (748.58 AS decimal (6,2)),-3); 1000.00
(No column name) (No column name) (No column name)
110.00 100.00 200
(No column name) (No column name) (No column name)
750.00 700.00 800.00
(No column name) (No column name) (No column name) (No column name)
440 400 749.00 0.00
Round Function with -ve Values

Round Function with -ve Values

That’s all folks; I hope you’ve enjoyed the article and I’ll see you soon with some more articles.

Thanks!

Pawan Kumar Khowal

MSBISKills.com

Share this

  • LinkedIn
  • Facebook
  • Twitter
  • WhatsApp
  • Email

SQL Server Interview Questions – Set 8 (10 Questions )

13 Monday Jun 2016

Posted by Pawan Kumar Khowal in Download SQL Interview Q's, SQL Concepts, SQL SERVER, SQL Server Interview Questions

≈ Leave a comment

Tags

Advanced SQL Interview Questions and Answers, Advanced SQL tutorial pdf, Download SQL Server Interview Question in PDF, Download SQL SERVER Interview questions, Download SQL Server Interview questions and answers, download sql server interview questions and answers pdf, download sql server interview questions by Pawan Khowal, download sql server interview questions by Pawan Kumar, download sql server interview questions by Pawan Kumar Khowal, Download T-SQL Interview Questions, Server Interview Questions Book, SQL Questions


SQL Server Interview Questions – Set 8 (10 Questions )

Sr No Download Download URL
13 SQL Server Interview Questions AND Answers [SET 8](10 Questions & Answers) Download

Question 1 : Can you tell me the difference between Name Node and Data Node?

Answer :

This question belongs to Big Data. Differences below-

NameNode
• NameNode is the centrepiece of HDFS.
• NameNode is also known as the Master
• NameNode only stores the metadata of HDFS – the directory tree of all files in the file system, and tracks the files across the cluster.
• NameNode does not store the actual data or the dataset. The data itself is actually stored in the DataNodes.
• NameNode knows the list of the blocks and its location for any given file in HDFS. With this information NameNode knows how to construct the file from blocks.
• NameNode is so critical to HDFS and when the NameNode is down, HDFS/Hadoop cluster is inaccessible and considered down.
• NameNode is a single point of failure in Hadoop cluster.
• NameNode is usually configured with a lot of memory (RAM). Because the block locations are help in main memory.

DataNode
• DataNode is responsible for storing the actual data in HDFS.
• DataNode is also known as the Slave
• NameNode and DataNode are in constant communication.
• When a DataNode starts up it announce itself to the NameNode along with the list of blocks it is responsible for.
• When a DataNode is down, it does not affect the availability of data or the cluster. NameNode will arrange for replication for the blocks managed by the DataNode that is not available.
• DataNode is usually configured with a lot of hard disk space. Because the actual data is stored in the DataNode.

Question 2 : Can you tell internal objects SQL Server Engine created inside TempDB?

Answer :

Internal Object in TempDB are
• Sorts
• Worktables
• WorkFiles
• VersionStore

Sorts-
Consider this as a workspace memory or Query memory. Whenever the operation was not fit in the memory it spills to tempDB. In case of Index sorting, it is spilled to User DB unless you specify the option “SORT _IN_TEMPDB”. It is technically not a work table. They use Uniform Extents for storage.

Worktables
Worktables are temporary rowsets. SQL Engine will call an internal routine to build a table. They are same as Temporary tables just like developers create using Create Table command. These are just pages in tempDB and they have –ve object ids. They use Mixed Extents.

Worktables are used for below operations-

• XML Documents
• Spool Operators
• Hash Match
• Exchange Spill
• Merge Join
• LOB Variables
• Cursors
• Service Broker

WorkFiles
WorkFiles are only used for one purpose that is temporary storage for Hashing. They use Uniform Extents

Version Store
They are used for Snapshot isolation including RCSI DB option. It is also used for online index rebuilding operations, triggers and MARS. Internally these extents are marked as “Version Store”.

Question 3 : How SQL Server gets SELECT Count(*) – Will it always use Table Scan every time?

Answer :

SELECT COUNT(*) will always use the smallest index structure that contains the total number of rows. The Optimizer will do a leaf level scan of the smallest nonclustered index for count(*) as well as count(not-nullable column)

Obviously if there is not index then the SQL optimizer will have to use table Scan.

Example – Table Scan


--

CREATE TABLE COUNTSTAR
(
	ID INT IDENTITY(1,1)
)
GO

INSERT INTO COUNTSTAR DEFAULT VALUES
GO 10000

SELECT COUNT(*) FROM COUNTSTAR

--

Execution Plan for the above query

Execution Plan - Table Scan

Execution Plan – Table Scan

Example – Index Scan


--

CREATE TABLE COUNTSTARIndex
(
	 ID  INT IDENTITY(1,1) PRIMARY KEY
	,ID0 INT DEFAULT 0
	,ID1 BIGINT DEFAULT 1
	,ID2 VARCHAR(10) DEFAULT 'Pawan'
)
GO

INSERT INTO COUNTSTARIndex DEFAULT VALUES
GO 10000

CREATE NONCLUSTERED INDEX Ix_ID0 ON COUNTSTARIndex(ID0)
GO

CREATE NONCLUSTERED INDEX Ix_ID1 ON COUNTSTARIndex(ID1)
GO

CREATE NONCLUSTERED INDEX Ix_ID2 ON COUNTSTARIndex(ID2)
GO

SELECT COUNT(*) FROM COUNTSTARIndex

--

Execution Plan for the above query

Execution Plan - Index Scan ( Smallest Structure )

Execution Plan – Index Scan ( Smallest Structure )

Question 4 : What is the Output of below Query?


--

CREATE TABLE # (a INT, b INT);

--

Answer :

The Output of the above query will be “Command Executed Successfully”.

Question 5 : What is the Output of below Queries?


--

CREATE TABLE food (a INT, b INT);

select a, b from food order by a, b;
select a, b from food order by 1, 2;

select a, b, count(*) from food group by a, b;
select a, b, count(*) from food group by 1, 2;

--

Answer :

First 3 queries will be executed successfully and provide data to the end user.Last query will return below error.

“Msg 164, Level 15, State 1, Line 7 Each GROUP BY expression must contain at least one column that is not an outer reference.”

Question 6 : Can you tell me the purpose of NTILE ranking function in SQL Server?

Answer :

The NTILE ranking function distributes the rows in an ordered partition into a specified number of groups. The groups are numbered, starting at one. For each row, NTILE returns the number of the group to which the row belongs.

Example


--

CREATE TABLE EmpRangers
(
     EmpId INT
    ,EmpName VARCHAR(10)
    ,Salary INT
)
GO

INSERT INTO EmpRangers
VALUES
(1,'a',1000),
(2,'b',900),
(3,'c',100),
(4,'d',1100),
(5,'e',1300),
(6,'f',700),
(7,'g',330),
(8,'h',800),
(9,'i',500),
(10,'j',340),
(11,'k',600),
(12,'l',700),
(13,'m',1000)
GO

INSERT INTO EmpRangers
VALUES (14,'n',1800)
GO

-- Query with Ntile ranking function

SELECT
             Salary
            ,NTILE(3) OVER (ORDER BY Salary) Grouper
    FROM
            EmpRangers

--

Question 7 : You have got a table. You have to write a SELECT query which will fetch alternate rows from the table starting with first row?

Answer :

We can use % mod here to get alternate rows.

Example


--

CREATE TABLE EmpRangers
(
     EmpId INT
    ,EmpName VARCHAR(10)
    ,Salary INT
)
GO

INSERT INTO EmpRangers
VALUES
(1,'a',1000),
(2,'b',900),
(3,'c',100),
(4,'d',1100),
(5,'e',1300),
(6,'f',700),
(7,'g',330),
(8,'h',800),
(9,'i',500),
(10,'j',340),
(11,'k',600),
(12,'l',700),
(13,'m',1000)
GO

SELECT EmpId,EmpName,Salary FROM EmpRangers
WHERE EmpId % 2 <> 0
GO

--

Question 8 : Can you tell me how many triggers can we create on a table?

Answer :

We can create 1 Instead of Trigger and Multiple After Triggers on a table. Also note that we can only create Instead of Triggers on a view.

Question 9 : How many kinds of database files present in SQL Server?

Answer :

There are three basic types of database files present in SQL Server Database-
• Primary data file ( Extension – mdf )
• Secondary data file ( Extension – ndf )
• Log file ( Extension – ldf )

Primary data files
This data file is mandatory whenever you create a new database, this file contains all the startup parameter of a database when SQL Server try to bring database online or when you create a new database on SQL Server. The common/recommended extension of primary data files is “.mdf” and it holds the system objects of a database such as tables, store procedures, views and functions.

Secondary data files
These are optional user defined data files; they hold user defined database objects such as tables, store procedures, views and functions. There could be multiple secondary files of a database. The common/recommended extension used for Secondary data files is “.ndf”

Log Files
Log files contain transactional information of a database’s day to day processing and are very important for database recovery process. All the transaction sequence and information is stored in these files. Every database has to have one log file in order to be operational.

DataFiles in SQL Server

DataFiles in SQL Server

Question 10 : What are Niladic functions in SQL Server?

Answer :

Niladic functions are functions that do not accept any parameters, are specified without parentheses, and return only one result.. “Nil” means nothing or null, and “adic” when is prefixed, means arguments.

Example


--

SELECT  CURRENT_TIMESTAMP
SELECT  CURRENT_USER
SELECT  SESSION_USER
SELECT  SYSTEM_USER
SELECT  USER

--

That’s all folks; I hope you’ve enjoyed the article and I’ll see you soon with some more articles.

Thanks!

Pawan Kumar Khowal

MSBISKills.com

Share this

  • LinkedIn
  • Facebook
  • Twitter
  • WhatsApp
  • Email

SQL Server Interview Questions – Set 7 (10 Questions )

12 Sunday Jun 2016

Posted by Pawan Kumar Khowal in Download SQL Interview Q's, SQL SERVER, SQL Server Interview Questions

≈ Leave a comment

Tags

Advanced SQL Interview Questions and Answers, Advanced SQL tutorial pdf, Download SQL Server Interview Question in PDF, Download SQL SERVER Interview questions, Download SQL Server Interview questions and answers, download sql server interview questions and answers pdf, download sql server interview questions by Pawan Khowal, download sql server interview questions by Pawan Kumar, download sql server interview questions by Pawan Kumar Khowal, Download T-SQL Interview Questions, Server Interview Questions Book, SQL Questions


SQL Server Interview Questions – Set 7 (10 Questions )

Sr No Download Download URL
12 SQL Server Interview Questions AND Answers [SET 7](10 Questions & Answers) Download

Question 1 : What are Ghost Rows in an Index in SQL Server?

Answer :

At leaf level of an index we have actual data rows. Now when these rows are deleted, they’re marked as ghost records.
This means that the row stays on the page but a bit is changed in the row header to indicate that the row is really a ghost.

The page header also reflects the number of ghost records on a page.

When user fires the delete command, SQL returns to the user much faster because it does not have to wait for the records to be deleted physically. Internally they are marked as “ghosted”.

Ghost records are present only in the index leaf nodes.
The ghost records can be cleaned up in 3 ways:
• If a record of the same key value as the deleted record is inserted
• If the page needs to be split, the ghost records will be handled
• The Ghost clean-up task (scheduled to run once every 5 seconds). It asynchronously removes them from the leaf level of the index. This same thread carries out the automatic shrinking of databases if you have that option set.

The Ghost cleanup process divides the “ghost pages” into 2 categories:
• Hot Pages (frequently visited by scanning processes)
• Cold Pages

The Ghost cleanup thread is able to retrieve the list of Cold pages from the DBTABLE for that database, or the PFS Page for that interval. The cleanup task cleans up a maximum of 10 ghost pages at a time. Also, while searching for the ghost pages, if it covers 10 PFS Pages, it yields.
As far as hot ghost pages are concerned, the ghost cleanup strives to keep the number of such pages below a specified limit. Also, if the thread cleans up 10 hot ghost pages, it yields. However, if the number of hot ghost pages is above the specified (hard-coded) limit, the task runs non-stop till the count comes down below the threshold value.
If there is no CPU usage on the system, the Ghost cleanup task runs till there are no more ghost pages to clean up.
One of the most common (and quickest) resolutions for a ghost records issue is to restart SQL Server.

Question 2 : How temp DB is created or algorithm used to create tempDB?

Answer :

Creation / Birth of tempDB uses below algorithm-

1. First Master DB is open
2. Second Open Model DB
3. TempDB is created using Model DB properties
 Engine will first lock model DB and tempDB
 Connections are allowed at this point to the engine, since master DB is already gone.
 User DBs are started to recover
 Create the primary DB file for tempDB based on the properties of master
 Copy extents from model to primary DB file including objects
 Fix up primary DB file for tempDB
 Create the primary transaction log file
 Create and attach other files
 Notify that tempDB is ready
4. If the above process fails, we will shut down the server

Question 3 : What is Spatial Index?

Answer :

SQL Server’s spatial data type allows us to store spatial objects and make them available to an application.
SQL Server supports two spatial data types:

Geometry: Stores the X and Y coordinates that represents lines, points, or polygons.
Geography: Stores the latitude and longitude coordinates that represent lines, points, or polygons.

SQL Server uses a B+ tree structure, which is a variation of the B-tree index. B-tree is nothing but a data structure that keeps data sorted to support search operations, sequential access, and data modifications such as inserts and deletes. SQL Server spatial indexes are built on top of the B+ tree structure, which allows the indexes to use that structure and its access methods. The spatial indexes also use the fundamental principles of XML indexing. XML indexing was introduced in SQL Server 2005 and supports two basic types of indexes: primary and secondary. The primary XML index is a B+ tree that essentially contains one row for each node in the XML instance.
So how does SQL Server implement the spatial index? As already mentioned, SQL Server starts with a B+ tree structure, which organizes data into a linear fashion. Because of this, the indexes must have a way to represent the two-dimensional spatial information as linear data. For this, SQL Server uses a process referred to as the hierarchical uniform decomposition of space. When the index is created, the database engine decomposes, or refactors, the space into a collection of axes aligned along a four-level grid hierarchy.

https://msdn.microsoft.com/en-IN/library/bb895265.aspx

Question 4 : What is the default recursion level for a CTE in SQL SERVER?

Answer :

1. The default maximum recursion depth of a CTE is 100 and if your query go beyond that an error occurs.

2. One can control the maximum recursion depth using the MAXRECURSION query hint (a value between 1 and 32767) and if your query go beyond that an error occurs.

3. If one wants to go ahead without limit can use the MAXRECURSION query hint (a value of 0). In this case we may crash our server due to an infinite loop. So your code should have manually control the execution otherwise it will go into the infinite loop.

Example


--

WITH Looper AS
(
    SELECT 0 AS Levels

    UNION ALL

    SELECT (x.Levels + 1) AS RecursionLevel
    FROM Looper x
    WHERE (x.Levels + 1) <= 200
)
SELECT * FROM Looper
OPTION (MAXRECURSION 200)



--

Question 5 : Can you explain me Halloween Problem?

Answer :

As per Wikipedia (https://en.wikipedia.org/wiki/Halloween_Problem ) Halloween Problem refers to a phenomenon in databases in which an update operation causes a change in the physical location of a row, potentially allowing the row to be visited more than once during the operation. This could even cause an infinite loop in some cases where updates continually place the updated record ahead of the scan performing the update operation.

The potential for this database error was first discovered by Don Chamberlin, Pat Selinger, and Morton Astrahan in 1976, on Halloween day while working on a query that was supposed to give a ten percent raise to every employee who earned less than $25,000. This query would run successfully, with no errors, but when finished all the employees in the database earned at least $25,000, because it kept giving them a raise until they reached that level. The expectation was that the query would iterate over each of the employee records with a salary less than $25,000 precisely once. In fact, because even updated records were visible to the query execution engine and so continued to match the query’s criteria, salary records were matching multiple times and each time being given a 10% raise until they were all greater than $25,000.

SQL Optimizer uses a Spool Operator to overcome Halloween protection.

Example


--

CREATE TABLE testHalloween
(
	 a SMALLINT PRIMARY KEY
	,b INT
	,c INT
)
GO

INSERT INTO testHalloween VALUES
(1,1,1),
(2,2,2),
(3,3,3)
GO

CREATE NONCLUSTERED INDEX Ix_c ON testHalloween(c)
GO

--Optimizer will add a Table Spool for Halloween Protection

UPDATE testHalloween 
SET c = c * 2
FROM testHalloween WITH ( INDEX ( Ix_c ) )
WHERE c < 3
GO


--

Question 6 : Is it true that stored procedures compiled when they are created?

Answer :

No, it is NOT true that stored procedures compiled when they are created.

Stored procedure gets compiled when they get executed on the first RUN. When the user fires an EXEC or EXECUTE proc command first time, then the stored procedure gets complied.

You can easily check this using following steps-

Create an SP and check if you get anything in SQL Profiler. In the second step execute the stored procedure and then check the profiler. The events you should be checking are given below-
1. SP:CacheHit
2. SP:CacheInsert
3. SP:CacheMiss
4. SP:CacheRemove

Question 7 : Can we create a Trigger on a View?

Answer :

Yes, we can create a trigger on View. View can be simple or updateable.

We can only create “Instead of Trigger” on a view separately for each of the INSERT, UPDATE, DELETE operation.

INSTEAD OF triggers can be defined on either tables or views; however, INSTEAD OF triggers are most useful for extending the types of updates a view can support. For example, INSTEAD OF triggers can provide the logic to modify multiple base tables through a view or to modify base tables that contain the following columns:-

1. timestamp data type
2. Computed columns
3. Identity columns

Question 8 : Why Truncate Command is faster than Delete Command if we are removing all data from the table?

Answer :

DELETE and TRUNCATE statements can be used to delete all data from the table.
DELETE is a logged operation on a per row basis. This means that the deletion of each row gets logged and physically deleted.

TRUNCATE is also a logged operation (Fully & Efficiently logged), but in a different way. A TRUNCATE TABLE operation does a wholesale delete of all data in the table. The individual records are not deleted one-by-one, instead the data pages comprising the table are simply deallocated. The allocations are unhooked from the table and put onto a queue to be deallocated by a background task called the deferred-drop task. The deferred-drop task does the deallocations instead of them being done as part of the regular transaction so that no locks need to be acquired while deallocating entire extents.

The deallocation of data pages means that your data rows still actually exist in the data pages, but the extents have been marked as empty for reuse. This is what makes TRUNCATE a faster operation to perform over DELETE.

Question 9 : What kind of triggers are “DDL triggers”?

Answer :

There are 2 kinds of Triggers in SQL Server
• Instead of Triggers
• After Triggers

DDL triggers are implemented as AFTER triggers, which means the operation occurs and is then caught in the trigger (and optionally rolled-back, if you put a ROLLBACK statement in the trigger body).

This means they’re not quite as lightweight as you might think. DDL triggers are relatively expensive in nature. What would be better in this case is to specifically GRANT or DENY the ALTER permission. DDL triggers allow you to perform auditing of who did what, so I’m not saying they’re without use – just be careful.

Question 10 : How to find a column usage across a SQL Server DB?

Answer :

If changes need to be made to a column it is necessary to perform some impact assessment in order to determine what objects will be affected, meaning that SQL table column dependencies within a SQL Server database need to be found.

One of the ways is to use a SYSCOMMENTS table. It is a table which contains entries for each view, rule, default, trigger, CHECK constraint, DEFAULT constraint, and stored procedure. The column TEXT in the syscomments table contains the actual code for all these objects, and knowing it you can write a code to check the dependencies:

Example


--

SELECT Name
FROM syscomments c 
JOIN sysobjects o on c.id = o.id 
WHERE TEXT LIKE '%Person%' AND TEXT LIKE '%FirstName%'


--

The query above is used to determine which objects use the FirstName column of the Person table.

This is just a simplified example that contain some basic information. The downside with this method is that it will return all objects that merely mention words “Person” and “FirstName” without actually making a reference to Person.FirstName column

That’s all folks; I hope you’ve enjoyed the article and I’ll see you soon with some more articles.

Thanks!

Pawan Kumar Khowal

MSBISKills.com

Share this

  • LinkedIn
  • Facebook
  • Twitter
  • WhatsApp
  • Email

Blog Stats

  • 1,097,352 hits

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 1,131 other subscribers

Pawan Khowal

502 SQL Puzzles with answers

Achievement - 500 PuzzlesJuly 18, 2018
The big day is here. Finally presented 500+ puzzles for SQL community.

200 SQL Server Puzzle with Answers

The Big DayAugust 19, 2016
The big day is here. Completed 200 SQL Puzzles today

Archives

June 2023
M T W T F S S
 1234
567891011
12131415161718
19202122232425
2627282930  
« Oct    

Top Articles

  • pawankkmr.wordpress.com/2…
  • pawankkmr.wordpress.com/2…
  • pawankkmr.wordpress.com/2…
  • pawankkmr.wordpress.com/2…
  • pawankkmr.wordpress.com/2…

Archives

  • October 2020 (29)
  • September 2018 (2)
  • August 2018 (6)
  • July 2018 (25)
  • June 2018 (22)
  • May 2018 (24)
  • April 2018 (33)
  • March 2018 (35)
  • February 2018 (53)
  • January 2018 (48)
  • December 2017 (32)
  • November 2017 (2)
  • October 2017 (20)
  • August 2017 (8)
  • June 2017 (2)
  • March 2017 (1)
  • February 2017 (18)
  • January 2017 (2)
  • December 2016 (5)
  • November 2016 (23)
  • October 2016 (2)
  • September 2016 (14)
  • August 2016 (6)
  • July 2016 (22)
  • June 2016 (27)
  • May 2016 (15)
  • April 2016 (7)
  • March 2016 (5)
  • February 2016 (7)
  • December 2015 (4)
  • October 2015 (23)
  • September 2015 (31)
  • August 2015 (14)
  • July 2015 (16)
  • June 2015 (29)
  • May 2015 (25)
  • April 2015 (44)
  • March 2015 (47)
  • November 2012 (1)
  • July 2012 (8)
  • September 2010 (26)
  • August 2010 (125)
  • July 2010 (2)

Article Categories

  • Analysis Services (6)
    • DAX (6)
  • Data (2)
    • Data warehousing (2)
  • Integration Services (2)
  • Magazines (3)
  • Python (29)
  • Reporting Services (4)
  • SQL SERVER (820)
    • Download SQL Interview Q's (212)
    • SQL Concepts (323)
    • SQL Performance Tuning (155)
    • SQL Puzzles (331)
    • SQL SERVER 2017 Linux (6)
    • SQL Server Interview Questions (308)
    • SQL SERVER Puzzles (332)
    • T SQL Puzzles (547)
    • Tricky SQL Queries (439)
  • UI (30)
    • ASP.NET (5)
    • C# (13)
    • CSS (9)
    • OOPS (3)
  • Uncategorized (5)

Recent Posts

  • Python | The Print and Divide Puzzle October 30, 2020
  • Python | Count consecutive 1’s from a list of 0’s and 1’s October 30, 2020
  • Python | How to convert a number into a list of its digits October 26, 2020
  • Python | Validate an IP Address-IPV6(Internet Protocol version 6) October 26, 2020
  • Python | Print the first non-recurring element in a list October 26, 2020
  • Python | Print the most recurring element in a list October 26, 2020
  • Python | Find the cumulative sum of elements in a list October 26, 2020
  • Python | Check a character is present in a string or not October 26, 2020
  • Python | Check whether a string is palindrome or not October 26, 2020
  • Python | Find the missing number in the array of Ints October 26, 2020
  • Python | How would you delete duplicates in a list October 26, 2020
  • Python | Check whether an array is Monotonic or not October 26, 2020
  • Python | Check whether a number is prime or not October 26, 2020
  • Python | Print list of prime numbers up to a number October 26, 2020
  • Python | Print elements from odd positions in a list October 26, 2020
  • Python | Print positions of a string present in another string October 26, 2020
  • Python | How to sort an array in ascending order October 26, 2020
  • Python | How to reverse an array October 26, 2020
  • Python | Find un-common words from two strings October 26, 2020
  • Python | How to convert a string to a list October 26, 2020
  • Python | Find unique words from a string October 26, 2020
  • Python | Calculate average word length from a string October 26, 2020
  • Python | Find common words from two strings October 26, 2020
  • Python | Find the number of times a substring present in a string October 26, 2020
  • Python | Find maximum value from a list October 26, 2020
  • Python | How to find GCF of two numbers October 26, 2020
  • Python | How to find LCM of two numbers October 26, 2020
  • Python | How to convert a list to a string October 26, 2020
  • Python | Replace NONE by its previous NON None value October 26, 2020
  • Microsoft SQL Server 2019 | Features added to SQL Server on Linux September 26, 2018

Create a website or blog at WordPress.com

  • Follow Following
    • Improving my SQL BI Skills
    • Join 231 other followers
    • Already have a WordPress.com account? Log in now.
    • Improving my SQL BI Skills
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar
 

Loading Comments...
 

You must be logged in to post a comment.