SlideShare a Scribd company logo
1 of 20
KAASHIV INFOTECH
The Asia, India, Tamil Nadu Book Of Record
Holders
SQL SERVER –Booklet 12
- Gives you the interview tips in SQL Server
SQL SERVER Interview Questions-2014
KAASHIV INFOTECH
Welcomes you to the Expert Voice Corner
Mr.J.Venkatesan Prabu
Venkatesan Prabu Jayakantham (venkat) has more than 8 years experience in the Microsoft
Technologies such as VB.Net, ASP.Net, C#.net, SSIS, SSAS, ADO.Net, etc., He is the Managing
Director of KAASHIVINFOTECH (http://www.kaashivinfotech.com/),a software company in
Chennai. Before that, he worked in HCL Technologies (India and Australia) for six years as
Project Lead. As a service motive, Venkat contributed more than 700 articles which is read by
the developers in 170 countries (400 developers per day)
(http://venkattechnicalblog.blogspot.com/). Aligned with KaaShiv InfoTech’s mission,he met
more than 20,000 young minds and spreaded Microsoft Technologies / Career guidance
programs. Venkat won many awards in his career, which includes Prestigious Microsoft MVP
(Most Valuable Professional) award for the years 2008,2009,2010,2011,2012,2013 and won
many awards. List of other awards in his career,
Microsoft certified Smart .Net Candidate in 2004
Most valuable member for dotnetspider site in 2007
HCL SQL Subject Matter expert (SME - SQL Server) for the year (2008,2009)
HCL Special contribution award winner on Dotnet skills for year(2008) HCL SQL
Knowledge Champion for the year 2009
Mind Cracker MVP on SQLServer –2010 for the year 2010,2011
INETA champion - Gold Member – 2010 for the year 2010 HCL Service Contribution
Award for the year 2010
Leading Lights "Rising Star" award from Common Wealth Bank, Australia for the year
2010
TECHNICAL CERTIFICATION
Cisco certified Network Associate (CCNA) – 2004
 Microsoft Certified Application Developer (MCAD) – 2005
ACKNOWLEDGEMENT
I would like to thank my family members for their support and encouragement. Without
their support it would be impossible for me to publish this e-book. I would also like to
thank my KaaShiv InfoTech team for their support to publish this e-book.
DISCLAIMER
All rights reserved. No part of this book may be copied, adapted, abridged or stored in
any retrieval system, computer system, photographic or other system or transmitted in any
form or by any means without the prior written permission of the copyright holders. Any
breach will entail legal action and permission without further notice.
1. What is Cross Join?
A cross join that does not have a WHERE clause produces the Cartesian
product of the tables involved in the join. The size of a Cartesian product result set is the
number of rows in the first table multiplied by the number of rows in the second table.
The common example is when company wants to combine each product with a pricing
table to analyze each product at each price.
.
2. How do SQL server 2000 and XML linked? Can XML be used to access data?
FOR XML (ROW, AUTO, EXPLICIT)
You can execute SQL queries against existing relational databases to return
results as XML rather than standard rowsets. These queries can be executed directly or
from within stored procedures. To retrieve XML results, use the FOR XML clause of the
SELECT statement and specify an XML mode of RAW, AUTO, or EXPLICIT.
OPENXML
OPENXML is a Transact-SQL keyword that provides a relational/rowset view
over an in-memory XML document. OPENXML is a rowset provider similar to a table
or a view. OPENXML provides a way to access XML data within the Transact-SQL
context by transferring data from an XML document into the relational tables.
Thus, OPENXML allows you to manage an XML document and its interaction with the
relational environment.
3.What command do we use to rename a db?
sp_renamedb ‘oldname’ , ‘newname’
If someone is using db it will not accept sp_renmaedb. In that case first bring db
to single user using sp_dboptions. Use sp_renamedb to rename database. Use sp_dboptions
to bring database to multi user mode.
4. What are the different types of replication? Explain.
The SQL Server 2000-supported replication types are as follows:
Transactional
Snapshot
Merge
Snapshot replication distributes data exactly as it appears at a specific moment in time and
does not monitor for updates to the data. Snapshot replication is best used as a method for
replicating data those changes infrequently or where the most up-to-date values (low
latency) are not a requirement. When synchronization occurs, the entire snapshot is
generated and sent to Subscribers.
Transactional replication, an initial snapshot of data is applied at Subscribers, and then
when data modifications are made at the Publisher, the individual transactions are captured
and propagated to Subscribers.
Merge replication is the process of distributing data from Publisher to
Subscribers, allowing the Publisher and Subscribers to make updates while connected or
disconnected, and then merging the updates between sites when they are connected.
5. What are the OS services that the SQL Server installation adds?
MS SQL SERVER SERVICE, SQL AGENT SERVICE, DTC (Distribution transac co-
ordinator)
6. What are three SQL keywords used to change or set someone’s permissions?
GRANT, DENY, and REVOKE.
7. What does it mean to have quoted identifier on? What are the implications of having
it off?
When SET QUOTED_IDENTIFIER is ON, identifiers can be delimited by double
quotation marks, and literals must be delimited by single quotation marks. When SET
QUOTED_IDENTIFIER is OFF, identifiers cannot be quoted and must follow all Transact-
SQL rules for identifiers.
8. What is the STUFF function and how does it differ from the REPLACE function?
STUFF function to overwrite existing characters. Using this
syntax, STUFF(string_expression, start, length, replacement_characters), string_expression
is the string that will have characters substituted, start is the starting position, 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 occurance. Using this
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.
9. How many rows are returned by these two select statements?
2 and 2
Each select statement actually returns 2 rows. You can use this script to check this:
create table mytable( id int identity(1,1), mychar varchar(20))
go
insert mytable select null
insert mytable select ''
insert mytable select ' '
go
set ansi_nulls on
set ansi_null_dflt_on on
select * from mytable
where mychar is not null
select * from mytable
where mychar <> '' and mychar is not null
select * from mytable
where mychar <> ' ' and mychar is not null
select * from mytable where mychar = ''
select * from mytable where mychar = ' '
set ansi_null_dflt_on off
set ansi_nulls off
go
drop table mytable
10. If you run this, what does it return?
select applock_mode('public', 'SalesApp', 'Transaction')
The type of lock being held by an application that requested it.
This command returns the lock mode held by an application that was requested with the
sp_getapplock procedure.
insert mytable select ''
insert mytable select ' '
select * from mytable where mychar = ''
select * from mytable where mychar = ' '
11. How will you map objects to a relational database ? How will you map class
inheritance to relational data model ?
Due to impedance mismatch between object and relational technology you need to
understand the process of mapping classes (objects) and their relationships to tables and
relationships between them in a database. Classes represent both behavior and data whereas
relational database tables just implement data. Database schemas have keys (primary keys to
uniquely identify rows and foreign keys to maintain relationships between rows) whereas
object schema does not have keys and instead use references to implement relationships to
other objects.
12. What is a view ? Why will you use a view? What is an aggregate function ?
View is a precompiled SQL query, which is used to select data from one or more tables. A
view is like a table but it doesn’t physically take any space (i.e. not materialized).
Views are used for
Providing inherent security by exposing only the data that is needed to be shown to the end
user.
Enabling re-use of SQL statements.
Allows changes to the underlying tables to be hidden from clients, aiding maintenance of
the database schema (i.e. encapsulation)
Views with multiple joins and filters can dramatically degrade performance because views
contain no data and any retrieval needs to be processed.
The solution for this is to use materialized views or create de-normalized tables to store
data. This technique is quite handy in overnight batch processes where a large chunk of
data needs to be processed. Normalized data can be read and inserted into some temporary
denormalized table and processed with efficiency.
13. What is a database trigger ?
A trigger is a fragment of code that you tell to run before or after a table is modified. There
are typically three triggering EVENTS that cause trigger to 'fire':
INSERT event (as a new record is being inserted into the database).
UPDATE event (as a record is being changed).
DELETE event (as a record is being deleted).
Triggers can restrict access to specific data, perform logging, or audit access to data.
INTERNSHIP IN KAASHIV INFOTECH
-Best internship provider in Chennai
Web Application Designing
Project Documentation
Live Inhouse
Application Development
Windows ADO.NET Application
Template Designing-Live Template Designing, CSS
14. How can you keep track of all your database changes ?
If you want to keep track of all changes to a particular record, such as who
modified the record, what kind of modification took place, and when the record
modification occurred then you can use triggers because you can capture every
action that occurred on a particular table. For example, an INSERT trigger would
fire when a particular database table has a record inserted.
15. What is the difference between “Stored Procedure” and “Function”?
A procedure can have both input and output parameters, but a function can only
have input parameters.
Inside a procedure we can use DML (INSERT/UPDATE/DELETE) statements. But
inside a function we can't use DML statements.
KaaShiv InfoTech Offers Best Inpant Training in Chennai.
The training at KAASHIV INFOTECH focus on developing the
technical oriented concepts that turn graduates into employable assets. Handled only by
professionals from MNC companies, we know how to equip you with strong technologies
fundamentals.
INPLANT TRAINING SCHEDULE FOR CSE/IT/MCA STUDENTS
Day Programme
Day 1 BigData (Practical Demos)
Day 2
Windows 8 App Development (Practical
Demos)
Day 3
Ethical Hacking (Facebook
Hack,Server/Website Hacking(20
Attacks)
Day 4
Cloud Computing (Live Server
Demo,Live Pjt Implementation)
Day 5
CCNA (-Networking-Router
Configurations Practical Demo)
INPLANT TRAINING SCHEDULE FOR ELECTRONIC/ELECTRICAL/EIE
STUDENTS:
Day Programme
Day 1 Embedded System (Embedded Program Designing ,Chip Burning)
Day 2
Wireless System (Device Designing,Controlling Fans with Wireless
Sensors)
Day 3 CCNA (-Networking-Router Configurations Practical Demo)
Day 4 Ethical Hacking (Facebook Hack,Server/Website Hacking(20 Attacks)
Day 5 Matlab (Capture Image,Processing, Animate Images-Practical Demos)
MECHANICAL/CIVIL INPLANT TRAINING SCHEDULE:
Day Programme
Day 1 Aircraft Designing
Day 2 Vehicle Movement in
Airports
Day 3 3D Packaging Designs
Day 4 3D Modeling
Day 5 3D Window Shading
Tags:
inplanttraining in chennai,Best inplanttraining Program in Chennai
Anna Nagar,Best and Effective inplanttraining Program in Chennai at Anna
Nagar ,inplanttraining Program for Engineering Students , inplanttraining Program for
Arts and Science Students , inplanttraining Program for BE Students , inplanttraining
Program for Information Technology Students ,inplanttraining Program in Chennai , Best
and Effective inplanttraining Program in Chennai,Best and good inplanttraining Program
in Chennai,inplanttraining Program for Computer Science Students, inplanttraining
Program for Electronics and Communication Students,inplanttraining Program for
Electrical and Electronics Students , inplanttraining Program for Engineering Studentsin
anna nagar , inplanttraining Program for Arts and Science Students in anna
nagar,Effective inplanttraining Program,Effective and Free inplanttraining Program,best
inplanttraining in chennai near rountana,best inplanttraining for engineering students in
chennai,best inplanttraining in anna nagar,inplanttraining for arts and science students in
tamil nadu,best inplanttraining for arts and science students in anna nagar near
rountana,best inplanttraining for ug graduates,best inplanttraining for pg graduates,best
inplanttraining for b.e/b.tech students,best inplanttraining for ug graduates in
chennai,best inplanttraining for ug graduates in anna nagar,best inplanttraining for ug
graduates in tamil nadu,best inplanttraining for pg graduates in chennai,
best inplanttraining for pg graduates in anna nagar,best inplanttraining for pg graduates in
tamil nadu,inplanttraining for cse students,inplanttraining for it students,inplanttraining for
ece students,inplanttraining for eee students,inplanttraining on android in
chennai,inplanttraining on java in chennai,inplanttraining on embedded systems in
chennai,inplanttraining on matlab in chennai,inplanttraining on .net in
chennai,inplanttraining on android in anna nagar,inplanttraining on java in anna
nagar,inplanttraining on embedded systems in anna nagar,inplanttraining on matlab in anna
nagar,inplanttraining on .net in anna nagar,best summer inplanttraining for arts and science
ug graduates in chennai,best summer inplanttraining for arts and science pg graduates in
chennai,best summer inplanttraining for engineering ug graduates in chennai,best summer
inplanttraining for engineering pg graduates in chennai,best summer inplanttraining for arts
and science ug graduates in anna nagar,best summer inplanttraining for arts and science pg
graduates in anna nagar,best summer inplanttraining for engineering ug graduates in anna
nagar,best summer inplanttraining for engineering pg graduates in anna nagar,best
inplanttraining for mba graduates in chennai,best inplanttraining fo mca graduates in
chennai,best inplanttraining for mba graduates in anna nagar,best inplanttraining for mca
graduates in anna nagar,best summer inplanttraining for mba graduates in chennai,best
summer inplanttraining for mca graduates in chennai,best summer inplanttraining for mba
graduates in anna nagar, best summer inplanttraining for mba graduates near rountana,best
summer inplanttraining for mca graduates near rountana
Address:
KAASHIV INFO TECH
Shivanantha Building,
X41, 5th Floor,2nd Avenue,
(Near Ayyappan Temple)
Anna Nagar, Chennai = 600040.
Send Us Your Request Email To arun@kaashivinfotech.com,
kaashiv.info@gmail.com,
venkat@kaashivinfotech.com
Contact Number : 9840678906 ;; 9003718877 ;; 9962345637 ;
Visit our other websites:
http://inplanttrainingchennai.com/ - Inplant Training Portal
http://inplanttrainingchennai.com/ - Internship Portal
jobsanddumps.com – Job Portal
https://plus.google.com/u/0/108546120202591604585
https://plus.google.com/u/0/b/110228862465265998202/dashboard/overview
https://plus.google.com/u/0/b/117408505876070870512/dashboard/overview
https://plus.google.com/u/0/b/104468163439231303834/dashboard/overview
https://plus.google.com/u/0/b/117640664472494971423/dashboard/overview
KaaShiv InfoTech Facebook Page
https://www.facebook.com/KaaShivInfoTech
Inplant Training Program in Chennai
https://www.facebook.com/pages/Inplant-Training-Program-in-
Chennai/1402097696706380
Internship in Chennai
https://www.facebook.com/pages/Internship-in-Chennai-
KaaShiv/1446147235603704
Inplant Training
https://www.facebook.com/pages/Inplant-Training/256116284550327

More Related Content

What's hot

Doctrine 2 - Introduction
Doctrine 2 - IntroductionDoctrine 2 - Introduction
Doctrine 2 - Introduction
Diego Lewin
 
Sql interview-question-part-9
Sql interview-question-part-9Sql interview-question-part-9
Sql interview-question-part-9
kaashiv1
 

What's hot (16)

Doctrine 2 - Introduction
Doctrine 2 - IntroductionDoctrine 2 - Introduction
Doctrine 2 - Introduction
 
PL/SQL Interview Questions
PL/SQL Interview QuestionsPL/SQL Interview Questions
PL/SQL Interview Questions
 
Sql
SqlSql
Sql
 
SQL interview questions by jeetendra mandal - part 4
SQL interview questions by jeetendra mandal - part 4SQL interview questions by jeetendra mandal - part 4
SQL interview questions by jeetendra mandal - part 4
 
Oracle developer interview questions(entry level)
Oracle developer interview questions(entry level)Oracle developer interview questions(entry level)
Oracle developer interview questions(entry level)
 
T-SQL Overview
T-SQL OverviewT-SQL Overview
T-SQL Overview
 
PLSQL Standards and Best Practices
PLSQL Standards and Best PracticesPLSQL Standards and Best Practices
PLSQL Standards and Best Practices
 
PATTERNS07 - Data Representation in C#
PATTERNS07 - Data Representation in C#PATTERNS07 - Data Representation in C#
PATTERNS07 - Data Representation in C#
 
Dbms Interview Question And Answer
Dbms Interview Question And AnswerDbms Interview Question And Answer
Dbms Interview Question And Answer
 
SQL interview questions jeetendra mandal - part 5
SQL interview questions jeetendra mandal - part 5SQL interview questions jeetendra mandal - part 5
SQL interview questions jeetendra mandal - part 5
 
Oracle SQL Training in Chennai, Tambaram
Oracle SQL Training in Chennai, TambaramOracle SQL Training in Chennai, Tambaram
Oracle SQL Training in Chennai, Tambaram
 
MySQL 8.0 Features -- Oracle CodeOne 2019, All Things Open 2019
MySQL 8.0 Features -- Oracle CodeOne 2019, All Things Open 2019MySQL 8.0 Features -- Oracle CodeOne 2019, All Things Open 2019
MySQL 8.0 Features -- Oracle CodeOne 2019, All Things Open 2019
 
Sql 2009
Sql 2009Sql 2009
Sql 2009
 
Datamigration
DatamigrationDatamigration
Datamigration
 
SQL interview questions by Jeetendra Mandal - part 2
SQL interview questions by Jeetendra Mandal - part 2SQL interview questions by Jeetendra Mandal - part 2
SQL interview questions by Jeetendra Mandal - part 2
 
Sql interview-question-part-9
Sql interview-question-part-9Sql interview-question-part-9
Sql interview-question-part-9
 

Viewers also liked (11)

Sql interview question part 9
Sql interview question part 9Sql interview question part 9
Sql interview question part 9
 
Sql interview question part 1
Sql interview question part 1Sql interview question part 1
Sql interview question part 1
 
Sql interview question part 2
Sql interview question part 2Sql interview question part 2
Sql interview question part 2
 
Sql interview question part 7
Sql interview question part 7Sql interview question part 7
Sql interview question part 7
 
Ebook11
Ebook11Ebook11
Ebook11
 
Sql interview-question-part-6
Sql interview-question-part-6Sql interview-question-part-6
Sql interview-question-part-6
 
Ebook9
Ebook9Ebook9
Ebook9
 
Ebook1
Ebook1Ebook1
Ebook1
 
Ebook6
Ebook6Ebook6
Ebook6
 
Sql interview question part 3
Sql interview question part 3Sql interview question part 3
Sql interview question part 3
 
Kaashiv SQL Server Interview Questions Presentation
Kaashiv SQL Server Interview Questions PresentationKaashiv SQL Server Interview Questions Presentation
Kaashiv SQL Server Interview Questions Presentation
 

Similar to Sql interview question part 12

Sql interview question part 5
Sql interview question part 5Sql interview question part 5
Sql interview question part 5
kaashiv1
 
Sql interview question part 2
Sql interview question part 2Sql interview question part 2
Sql interview question part 2
kaashiv1
 
Sql interview question part 4
Sql interview question part 4Sql interview question part 4
Sql interview question part 4
kaashiv1
 
Introduction to sql server
Introduction to sql serverIntroduction to sql server
Introduction to sql server
Vinay Thota
 
Lecture on DBMS & MySQL.pdf v. C. .
Lecture on DBMS & MySQL.pdf v.  C.     .Lecture on DBMS & MySQL.pdf v.  C.     .
Lecture on DBMS & MySQL.pdf v. C. .
MayankSinghRawat6
 

Similar to Sql interview question part 12 (20)

Sql interview question part 5
Sql interview question part 5Sql interview question part 5
Sql interview question part 5
 
Sql interview question part 2
Sql interview question part 2Sql interview question part 2
Sql interview question part 2
 
Ebook2
Ebook2Ebook2
Ebook2
 
Ebook6
Ebook6Ebook6
Ebook6
 
Sql interview question part 6
Sql interview question part 6Sql interview question part 6
Sql interview question part 6
 
Sql interview-question-part-6
Sql interview-question-part-6Sql interview-question-part-6
Sql interview-question-part-6
 
Sql interview question part 8
Sql interview question part 8Sql interview question part 8
Sql interview question part 8
 
Ebook8
Ebook8Ebook8
Ebook8
 
Sql interview question part 4
Sql interview question part 4Sql interview question part 4
Sql interview question part 4
 
Ebook4
Ebook4Ebook4
Ebook4
 
Sql interview question part 4
Sql interview question part 4Sql interview question part 4
Sql interview question part 4
 
Sql interview question part 10
Sql interview question part 10Sql interview question part 10
Sql interview question part 10
 
Ebook10
Ebook10Ebook10
Ebook10
 
Introduction to sql server
Introduction to sql serverIntroduction to sql server
Introduction to sql server
 
Sql interview question part 1
Sql interview question part 1Sql interview question part 1
Sql interview question part 1
 
Sql good practices
Sql good practicesSql good practices
Sql good practices
 
SQL for interview
SQL for interviewSQL for interview
SQL for interview
 
Stretch db sql server 2016 (sn0028)
Stretch db   sql server 2016 (sn0028)Stretch db   sql server 2016 (sn0028)
Stretch db sql server 2016 (sn0028)
 
Lecture on DBMS & MySQL.pdf v. C. .
Lecture on DBMS & MySQL.pdf v.  C.     .Lecture on DBMS & MySQL.pdf v.  C.     .
Lecture on DBMS & MySQL.pdf v. C. .
 
A Review of Data Access Optimization Techniques in a Distributed Database Man...
A Review of Data Access Optimization Techniques in a Distributed Database Man...A Review of Data Access Optimization Techniques in a Distributed Database Man...
A Review of Data Access Optimization Techniques in a Distributed Database Man...
 

Recently uploaded

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 

Sql interview question part 12

  • 1. KAASHIV INFOTECH The Asia, India, Tamil Nadu Book Of Record Holders SQL SERVER –Booklet 12 - Gives you the interview tips in SQL Server SQL SERVER Interview Questions-2014
  • 2. KAASHIV INFOTECH Welcomes you to the Expert Voice Corner Mr.J.Venkatesan Prabu Venkatesan Prabu Jayakantham (venkat) has more than 8 years experience in the Microsoft Technologies such as VB.Net, ASP.Net, C#.net, SSIS, SSAS, ADO.Net, etc., He is the Managing Director of KAASHIVINFOTECH (http://www.kaashivinfotech.com/),a software company in Chennai. Before that, he worked in HCL Technologies (India and Australia) for six years as Project Lead. As a service motive, Venkat contributed more than 700 articles which is read by the developers in 170 countries (400 developers per day) (http://venkattechnicalblog.blogspot.com/). Aligned with KaaShiv InfoTech’s mission,he met more than 20,000 young minds and spreaded Microsoft Technologies / Career guidance programs. Venkat won many awards in his career, which includes Prestigious Microsoft MVP (Most Valuable Professional) award for the years 2008,2009,2010,2011,2012,2013 and won many awards. List of other awards in his career,
  • 3. Microsoft certified Smart .Net Candidate in 2004 Most valuable member for dotnetspider site in 2007 HCL SQL Subject Matter expert (SME - SQL Server) for the year (2008,2009) HCL Special contribution award winner on Dotnet skills for year(2008) HCL SQL Knowledge Champion for the year 2009 Mind Cracker MVP on SQLServer –2010 for the year 2010,2011 INETA champion - Gold Member – 2010 for the year 2010 HCL Service Contribution Award for the year 2010 Leading Lights "Rising Star" award from Common Wealth Bank, Australia for the year 2010 TECHNICAL CERTIFICATION Cisco certified Network Associate (CCNA) – 2004  Microsoft Certified Application Developer (MCAD) – 2005
  • 4. ACKNOWLEDGEMENT I would like to thank my family members for their support and encouragement. Without their support it would be impossible for me to publish this e-book. I would also like to thank my KaaShiv InfoTech team for their support to publish this e-book. DISCLAIMER All rights reserved. No part of this book may be copied, adapted, abridged or stored in any retrieval system, computer system, photographic or other system or transmitted in any form or by any means without the prior written permission of the copyright holders. Any breach will entail legal action and permission without further notice.
  • 5. 1. What is Cross Join? A cross join that does not have a WHERE clause produces the Cartesian product of the tables involved in the join. The size of a Cartesian product result set is the number of rows in the first table multiplied by the number of rows in the second table. The common example is when company wants to combine each product with a pricing table to analyze each product at each price. . 2. How do SQL server 2000 and XML linked? Can XML be used to access data? FOR XML (ROW, AUTO, EXPLICIT) You can execute SQL queries against existing relational databases to return results as XML rather than standard rowsets. These queries can be executed directly or from within stored procedures. To retrieve XML results, use the FOR XML clause of the SELECT statement and specify an XML mode of RAW, AUTO, or EXPLICIT. OPENXML OPENXML is a Transact-SQL keyword that provides a relational/rowset view over an in-memory XML document. OPENXML is a rowset provider similar to a table or a view. OPENXML provides a way to access XML data within the Transact-SQL context by transferring data from an XML document into the relational tables. Thus, OPENXML allows you to manage an XML document and its interaction with the relational environment.
  • 6. 3.What command do we use to rename a db? sp_renamedb ‘oldname’ , ‘newname’ If someone is using db it will not accept sp_renmaedb. In that case first bring db to single user using sp_dboptions. Use sp_renamedb to rename database. Use sp_dboptions to bring database to multi user mode. 4. What are the different types of replication? Explain. The SQL Server 2000-supported replication types are as follows: Transactional Snapshot Merge Snapshot replication distributes data exactly as it appears at a specific moment in time and does not monitor for updates to the data. Snapshot replication is best used as a method for replicating data those changes infrequently or where the most up-to-date values (low latency) are not a requirement. When synchronization occurs, the entire snapshot is generated and sent to Subscribers. Transactional replication, an initial snapshot of data is applied at Subscribers, and then when data modifications are made at the Publisher, the individual transactions are captured and propagated to Subscribers. Merge replication is the process of distributing data from Publisher to Subscribers, allowing the Publisher and Subscribers to make updates while connected or disconnected, and then merging the updates between sites when they are connected.
  • 7. 5. What are the OS services that the SQL Server installation adds? MS SQL SERVER SERVICE, SQL AGENT SERVICE, DTC (Distribution transac co- ordinator) 6. What are three SQL keywords used to change or set someone’s permissions? GRANT, DENY, and REVOKE. 7. What does it mean to have quoted identifier on? What are the implications of having it off? When SET QUOTED_IDENTIFIER is ON, identifiers can be delimited by double quotation marks, and literals must be delimited by single quotation marks. When SET QUOTED_IDENTIFIER is OFF, identifiers cannot be quoted and must follow all Transact- SQL rules for identifiers. 8. What is the STUFF function and how does it differ from the REPLACE function? STUFF function to overwrite existing characters. Using this syntax, STUFF(string_expression, start, length, replacement_characters), string_expression is the string that will have characters substituted, start is the starting position, 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 occurance. Using this 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.
  • 8. 9. How many rows are returned by these two select statements? 2 and 2 Each select statement actually returns 2 rows. You can use this script to check this: create table mytable( id int identity(1,1), mychar varchar(20)) go insert mytable select null insert mytable select '' insert mytable select ' ' go set ansi_nulls on set ansi_null_dflt_on on select * from mytable where mychar is not null select * from mytable where mychar <> '' and mychar is not null select * from mytable where mychar <> ' ' and mychar is not null select * from mytable where mychar = '' select * from mytable where mychar = ' ' set ansi_null_dflt_on off set ansi_nulls off go drop table mytable
  • 9. 10. If you run this, what does it return? select applock_mode('public', 'SalesApp', 'Transaction') The type of lock being held by an application that requested it. This command returns the lock mode held by an application that was requested with the sp_getapplock procedure. insert mytable select '' insert mytable select ' ' select * from mytable where mychar = '' select * from mytable where mychar = ' '
  • 10. 11. How will you map objects to a relational database ? How will you map class inheritance to relational data model ? Due to impedance mismatch between object and relational technology you need to understand the process of mapping classes (objects) and their relationships to tables and relationships between them in a database. Classes represent both behavior and data whereas relational database tables just implement data. Database schemas have keys (primary keys to uniquely identify rows and foreign keys to maintain relationships between rows) whereas object schema does not have keys and instead use references to implement relationships to other objects.
  • 11. 12. What is a view ? Why will you use a view? What is an aggregate function ? View is a precompiled SQL query, which is used to select data from one or more tables. A view is like a table but it doesn’t physically take any space (i.e. not materialized). Views are used for Providing inherent security by exposing only the data that is needed to be shown to the end user. Enabling re-use of SQL statements. Allows changes to the underlying tables to be hidden from clients, aiding maintenance of the database schema (i.e. encapsulation) Views with multiple joins and filters can dramatically degrade performance because views contain no data and any retrieval needs to be processed. The solution for this is to use materialized views or create de-normalized tables to store data. This technique is quite handy in overnight batch processes where a large chunk of data needs to be processed. Normalized data can be read and inserted into some temporary denormalized table and processed with efficiency. 13. What is a database trigger ? A trigger is a fragment of code that you tell to run before or after a table is modified. There are typically three triggering EVENTS that cause trigger to 'fire': INSERT event (as a new record is being inserted into the database). UPDATE event (as a record is being changed). DELETE event (as a record is being deleted). Triggers can restrict access to specific data, perform logging, or audit access to data.
  • 12. INTERNSHIP IN KAASHIV INFOTECH -Best internship provider in Chennai Web Application Designing Project Documentation Live Inhouse Application Development Windows ADO.NET Application Template Designing-Live Template Designing, CSS 14. How can you keep track of all your database changes ? If you want to keep track of all changes to a particular record, such as who modified the record, what kind of modification took place, and when the record modification occurred then you can use triggers because you can capture every action that occurred on a particular table. For example, an INSERT trigger would fire when a particular database table has a record inserted. 15. What is the difference between “Stored Procedure” and “Function”? A procedure can have both input and output parameters, but a function can only have input parameters. Inside a procedure we can use DML (INSERT/UPDATE/DELETE) statements. But inside a function we can't use DML statements.
  • 13. KaaShiv InfoTech Offers Best Inpant Training in Chennai. The training at KAASHIV INFOTECH focus on developing the technical oriented concepts that turn graduates into employable assets. Handled only by professionals from MNC companies, we know how to equip you with strong technologies fundamentals. INPLANT TRAINING SCHEDULE FOR CSE/IT/MCA STUDENTS Day Programme Day 1 BigData (Practical Demos) Day 2 Windows 8 App Development (Practical Demos) Day 3 Ethical Hacking (Facebook Hack,Server/Website Hacking(20 Attacks) Day 4 Cloud Computing (Live Server Demo,Live Pjt Implementation) Day 5 CCNA (-Networking-Router Configurations Practical Demo)
  • 14. INPLANT TRAINING SCHEDULE FOR ELECTRONIC/ELECTRICAL/EIE STUDENTS: Day Programme Day 1 Embedded System (Embedded Program Designing ,Chip Burning) Day 2 Wireless System (Device Designing,Controlling Fans with Wireless Sensors) Day 3 CCNA (-Networking-Router Configurations Practical Demo) Day 4 Ethical Hacking (Facebook Hack,Server/Website Hacking(20 Attacks) Day 5 Matlab (Capture Image,Processing, Animate Images-Practical Demos)
  • 15. MECHANICAL/CIVIL INPLANT TRAINING SCHEDULE: Day Programme Day 1 Aircraft Designing Day 2 Vehicle Movement in Airports Day 3 3D Packaging Designs Day 4 3D Modeling Day 5 3D Window Shading
  • 16. Tags: inplanttraining in chennai,Best inplanttraining Program in Chennai Anna Nagar,Best and Effective inplanttraining Program in Chennai at Anna Nagar ,inplanttraining Program for Engineering Students , inplanttraining Program for Arts and Science Students , inplanttraining Program for BE Students , inplanttraining Program for Information Technology Students ,inplanttraining Program in Chennai , Best and Effective inplanttraining Program in Chennai,Best and good inplanttraining Program in Chennai,inplanttraining Program for Computer Science Students, inplanttraining Program for Electronics and Communication Students,inplanttraining Program for Electrical and Electronics Students , inplanttraining Program for Engineering Studentsin anna nagar , inplanttraining Program for Arts and Science Students in anna nagar,Effective inplanttraining Program,Effective and Free inplanttraining Program,best inplanttraining in chennai near rountana,best inplanttraining for engineering students in chennai,best inplanttraining in anna nagar,inplanttraining for arts and science students in tamil nadu,best inplanttraining for arts and science students in anna nagar near rountana,best inplanttraining for ug graduates,best inplanttraining for pg graduates,best inplanttraining for b.e/b.tech students,best inplanttraining for ug graduates in chennai,best inplanttraining for ug graduates in anna nagar,best inplanttraining for ug graduates in tamil nadu,best inplanttraining for pg graduates in chennai,
  • 17. best inplanttraining for pg graduates in anna nagar,best inplanttraining for pg graduates in tamil nadu,inplanttraining for cse students,inplanttraining for it students,inplanttraining for ece students,inplanttraining for eee students,inplanttraining on android in chennai,inplanttraining on java in chennai,inplanttraining on embedded systems in chennai,inplanttraining on matlab in chennai,inplanttraining on .net in chennai,inplanttraining on android in anna nagar,inplanttraining on java in anna nagar,inplanttraining on embedded systems in anna nagar,inplanttraining on matlab in anna nagar,inplanttraining on .net in anna nagar,best summer inplanttraining for arts and science ug graduates in chennai,best summer inplanttraining for arts and science pg graduates in chennai,best summer inplanttraining for engineering ug graduates in chennai,best summer inplanttraining for engineering pg graduates in chennai,best summer inplanttraining for arts and science ug graduates in anna nagar,best summer inplanttraining for arts and science pg graduates in anna nagar,best summer inplanttraining for engineering ug graduates in anna nagar,best summer inplanttraining for engineering pg graduates in anna nagar,best inplanttraining for mba graduates in chennai,best inplanttraining fo mca graduates in chennai,best inplanttraining for mba graduates in anna nagar,best inplanttraining for mca graduates in anna nagar,best summer inplanttraining for mba graduates in chennai,best summer inplanttraining for mca graduates in chennai,best summer inplanttraining for mba graduates in anna nagar, best summer inplanttraining for mba graduates near rountana,best summer inplanttraining for mca graduates near rountana
  • 18. Address: KAASHIV INFO TECH Shivanantha Building, X41, 5th Floor,2nd Avenue, (Near Ayyappan Temple) Anna Nagar, Chennai = 600040. Send Us Your Request Email To arun@kaashivinfotech.com, kaashiv.info@gmail.com, venkat@kaashivinfotech.com Contact Number : 9840678906 ;; 9003718877 ;; 9962345637 ; Visit our other websites: http://inplanttrainingchennai.com/ - Inplant Training Portal http://inplanttrainingchennai.com/ - Internship Portal jobsanddumps.com – Job Portal https://plus.google.com/u/0/108546120202591604585 https://plus.google.com/u/0/b/110228862465265998202/dashboard/overview https://plus.google.com/u/0/b/117408505876070870512/dashboard/overview
  • 19. https://plus.google.com/u/0/b/104468163439231303834/dashboard/overview https://plus.google.com/u/0/b/117640664472494971423/dashboard/overview KaaShiv InfoTech Facebook Page https://www.facebook.com/KaaShivInfoTech Inplant Training Program in Chennai https://www.facebook.com/pages/Inplant-Training-Program-in- Chennai/1402097696706380 Internship in Chennai https://www.facebook.com/pages/Internship-in-Chennai- KaaShiv/1446147235603704