Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

What Function Catx Syntax Does?

Answer»

CATX SYNTAX CONCATENATE character strings remove trailing and leading BLANKS and INSERTS separators.

CATX syntax concatenate character strings remove trailing and leading blanks and inserts separators.

2.

Mention The Validation Tools Used In Sas?

Answer»

For DataSet : DATA SET name/ debug Data set: Name/stmtchk
For MACROS: OPTIONS: mprint mlogic symbolgen

For DataSet : Data set name/ debug Data set: Name/stmtchk
For Macros: Options: mprint mlogic symbolgen

3.

Explain How You Can Debug And Test Your Sas Program?

Answer»

You can DEBUG and TEST your SAS PROGRAM by using Obs=0 and SYSTEMS options to TRACE the program execution in log

You can debug and test your SAS program by using Obs=0 and systems options to trace the program execution in log

4.

In Sas Explain Which Statement Does Not Perform Automatic Conversions In Comparisons?

Answer»

In SAS, the “where” statement does not PERFORM AUTOMATIC CONVERSIONS in comparisons.

 

In SAS, the “where” statement does not perform automatic conversions in comparisons.

 

5.

Explain What Is Pdv?

Answer»

The logical area in the memory is REPRESENTED by PDV or Program DATA Vector. At the time, SAS creates a DATABASE of one OBSERVATION at a time. An input buffer is created at the time of compilation which holds a record from an external file. The PDV is created following the input buffer creation 

 

The logical area in the memory is represented by PDV or Program Data Vector. At the time, SAS creates a database of one observation at a time. An input buffer is created at the time of compilation which holds a record from an external file. The PDV is created following the input buffer creation 

 

6.

Explain What Is Data Step?

Answer»

The DATA STEP creates an SAS dataset which CARRIES the data along with a “data dictionary.” The data dictionary holds the information about the variables and their properties.

The Data step creates an SAS dataset which carries the data along with a “data dictionary.” The data dictionary holds the information about the variables and their properties.

7.

Explain What Is The Basic Structure Of Sas Programming?

Answer»

The BASIC STRUCTURE of SAS are
• Program Editor
• Explorer Window
LOG Window

The basic structure of SAS are
• Program Editor
• Explorer Window
• Log Window

8.

Explain What Is Sas? What Are The Functions Does It Performs?

Answer»

SAS means Statistical Analysis System, which is an integrated SET of SOFTWARE products.
• Information retrieval and DATA management
WRITING reports and graphics
• Statistical analysis, econometrics and data mining
BUSINESS planning, forecasting and decision support
• Operation research and Project management
• Quality Improvement
• Data Warehousing
• Application Development

SAS means Statistical Analysis System, which is an integrated set of software products.
• Information retrieval and data management
• Writing reports and graphics
• Statistical analysis, econometrics and data mining
• Business planning, forecasting and decision support
• Operation research and Project management
• Quality Improvement
• Data Warehousing
• Application Development

9.

Name Several Ways To Achieve Efficiency In Your Program.

Answer»

Efficiency and performance STRATEGIES can be CLASSIFIED into 5 different areas.
·CPU TIME
·Data Storage
· ELAPSED time
· Input/Output
· Memory CPU Time and Elapsed Time- BASE line measurements

Efficiency and performance strategies can be classified into 5 different areas.
·CPU time
·Data Storage
· Elapsed time
· Input/Output
· Memory CPU Time and Elapsed Time- Base line measurements

10.

If Reading A Variable Length File With Fixed Input, How Would You Prevent Sas From Reading The Next Record If The Last Variable Didn't Have A Value?

Answer»

By USING the option MISSOVER in the INFILE statement.If the INPUT of some data lines are shorter than others then we use TRUNCOVER option in the infile statement.

By using the option MISSOVER in the infile statement.If the input of some data lines are shorter than others then we use TRUNCOVER option in the infile statement.

11.

Are You Familiar With Special Input Delimiters? How Are They Used?

Answer»

DLM and DSD are the delimiters that I’ve used. They should be included in the infile statement. Comma separated values FILES or CSV files are a common type of file that can be used to read with the DSD option. DSD option treats TWO delimiters in a ROW as MISSING value.
DSD also ignores the delimiters enclosed in quotation MARKS.

DLM and DSD are the delimiters that I’ve used. They should be included in the infile statement. Comma separated values files or CSV files are a common type of file that can be used to read with the DSD option. DSD option treats two delimiters in a row as MISSING value.
DSD also ignores the delimiters enclosed in quotation marks.

12.

How Do You Read In The Variables That You Need?

Answer»

Using INPUT STATEMENT with the COLUMN POINTERS like @5/12-17 ETC.

Using Input statement with the column pointers like @5/12-17 etc.

13.

What Sas Statements Would You Code To Read An External Raw Data File To A Data Step?

Answer»

INFILE STATEMENT.

INFILE statement.

14.

How To Implement One-to-one, One-to-many And Many-to-many Relationships While Designing Tables?

Answer»

One-to-One relationship can be implemented as a single table and rarely as two tables with primary and foreign KEY relationships. One-to-Many relationships are implemented by SPLITTING the data into two tables with primary key and foreign key relationships. Many-to-Many relationships are implemented USING a junction table with the keys from both the tables forming the COMPOSITE primary key of the junction table.

One-to-One relationship can be implemented as a single table and rarely as two tables with primary and foreign key relationships. One-to-Many relationships are implemented by splitting the data into two tables with primary key and foreign key relationships. Many-to-Many relationships are implemented using a junction table with the keys from both the tables forming the composite primary key of the junction table.

15.

What Is Bcp? When Does It Used?

Answer»

BulkCopy is a tool USED to copy huge amount of DATA from tables and VIEWS. BCP does not copy the structures same as source to destination. BULK INSERT command helps to IMPORT a data file into a database table or view in a user-specified format.

BulkCopy is a tool used to copy huge amount of data from tables and views. BCP does not copy the structures same as source to destination. BULK INSERT command helps to import a data file into a database table or view in a user-specified format.

16.

Can Sql Servers Linked To Other Servers Like Oracle?

Answer»

SQL Server can be LINKED to any server provided it has OLE-DB provider from Microsoft to allow a LINK. E.g. Oracle has an OLE-DB provider for oracle that Microsoft PROVIDES to ADD it as linked server to SQL Server group.

SQL Server can be linked to any server provided it has OLE-DB provider from Microsoft to allow a link. E.g. Oracle has an OLE-DB provider for oracle that Microsoft provides to add it as linked server to SQL Server group.

17.

What Is A Table Called, If It Has Neither Cluster Nor Non-cluster Index? What Is It Used For?

Answer»

Unindexed table or Heap. Microsoft Press Books and Book on Line (BOL) refers it as Heap. A heap is a table that does not have a clustered INDEX and, therefore, the pages are not linked by pointers. The IAM pages are the only structures that link the pages in a table together. Unindexed tables are good for fast STORING of data. Many times it is better to DROP all INDEXES from table and then do bulk of inserts and to restore those indexes after that.

Unindexed table or Heap. Microsoft Press Books and Book on Line (BOL) refers it as Heap. A heap is a table that does not have a clustered index and, therefore, the pages are not linked by pointers. The IAM pages are the only structures that link the pages in a table together. Unindexed tables are good for fast storing of data. Many times it is better to drop all indexes from table and then do bulk of inserts and to restore those indexes after that.

18.

What Is A Scheduled Jobs Or What Is A Scheduled Tasks?

Answer»

Scheduled tasks let user automate processes that run on regular or predictable cycles. User can schedule administrative tasks, such as cube processing, to run during times of slow business activity. User can also determine the order in which tasks run by CREATING job steps within a SQL Server Agent job. E.g. back up database, Update STATS of Tables. Job steps give user control over flow of EXECUTION. If ONE job fails, user can configure SQL Server Agent to continue to run the remaining tasks or to stop execution.

Scheduled tasks let user automate processes that run on regular or predictable cycles. User can schedule administrative tasks, such as cube processing, to run during times of slow business activity. User can also determine the order in which tasks run by creating job steps within a SQL Server Agent job. E.g. back up database, Update Stats of Tables. Job steps give user control over flow of execution. If one job fails, user can configure SQL Server Agent to continue to run the remaining tasks or to stop execution.

19.

How To Get error And rowcount At The Same Time?

Answer»

If @@Rowcount is checked after Error checking statement then it will have 0 as the value of @@Recordcount as it would have been RESET. And if @@Recordcount is checked before the error-checking statement then @@Error would get reset. To get @@error and @@rowcount at the same time do both in same statement and store them in local variable.
SELECT @RC = @@ROWCOUNT, @ER = @@ERROR

If @@Rowcount is checked after Error checking statement then it will have 0 as the value of @@Recordcount as it would have been reset. And if @@Recordcount is checked before the error-checking statement then @@Error would get reset. To get @@error and @@rowcount at the same time do both in same statement and store them in local variable.
SELECT @RC = @@ROWCOUNT, @ER = @@ERROR

20.

What Is Not Null Constraint?

Answer»

A NOT NULL constraint enforces that the COLUMN will not ACCEPT null values. The not null constraints are USED to enforce DOMAIN integrity, as the check constraints.

A NOT NULL constraint enforces that the column will not accept null values. The not null constraints are used to enforce domain integrity, as the check constraints.

21.

What Is Check Constraint?

Answer»

A CHECK constraint is USED to LIMIT the values that can be placed in a COLUMN. The check CONSTRAINTS are used to enforce domain integrity.

A CHECK constraint is used to limit the values that can be placed in a column. The check constraints are used to enforce domain integrity.

22.

What Is Foreign Key?

Answer»

A FOREIGN KEY constraint prevents any actions that would destroy links between tables with the CORRESPONDING data values. A foreign key in one table points to a primary key in another table. Foreign keys prevent actions that would LEAVE ROWS with foreign key values when there are no primary keys with that value. The foreign key constraints are used to ENFORCE referential integrity.

A FOREIGN KEY constraint prevents any actions that would destroy links between tables with the corresponding data values. A foreign key in one table points to a primary key in another table. Foreign keys prevent actions that would leave rows with foreign key values when there are no primary keys with that value. The foreign key constraints are used to enforce referential integrity.

23.

What Is Unique Key Constraint?

Answer»

A UNIQUE constraint enforces the UNIQUENESS of the values in a set of columns, so no DUPLICATE values are entered. The unique key constraints are used to enforce ENTITY integrity as the PRIMARY key constraints.

A UNIQUE constraint enforces the uniqueness of the values in a set of columns, so no duplicate values are entered. The unique key constraints are used to enforce entity integrity as the primary key constraints.

24.

What Is Primary Key?

Answer»

A PRIMARY KEY constraint is a unique IDENTIFIER for a ROW within a database table. EVERY table should have a primary key constraint to uniquely identify each row and only one primary key constraint can be created for each table. The primary key constraints are used to ENFORCE entity integrity.

A PRIMARY KEY constraint is a unique identifier for a row within a database table. Every table should have a primary key constraint to uniquely identify each row and only one primary key constraint can be created for each table. The primary key constraints are used to enforce entity integrity.

25.

What Is The Difference Between A Local And A Global Temporary Table?

Answer»

A local temporary table exists only for the duration of a connection or, if defined inside a compound statement, for the duration of the compound statement.
A GLOBAL temporary table remains in the database permanently, but the rows EXIST only within a GIVEN connection. When connection is closed, the DATA in the global temporary table disappears. HOWEVER, the table definition remains with the database for access when database is opened next time.

A local temporary table exists only for the duration of a connection or, if defined inside a compound statement, for the duration of the compound statement.
A global temporary table remains in the database permanently, but the rows exist only within a given connection. When connection is closed, the data in the global temporary table disappears. However, the table definition remains with the database for access when database is opened next time.

26.

Name 3 Ways To Get An Accurate Count Of The Number Of Records In A Table?

Answer»
  1. SELECT * FROM TABLE1 
  2. SELECT COUNT(*) FROM table1 
  3. SELECT ROWS FROM sysindexes WHERE ID = OBJECT_ID(table1) AND indid < 2

27.

What Is Log Shipping?

Answer»

LOG shipping is the process of automating the backup of database and transaction log files on a production SQL server, and then restoring them onto a STANDBY server. Enterprise Editions only supports log shipping. In log shipping the transactional log file from one server is automatically updated into the backup database on the other server. If one server fails, the other server will have the same db and can be USED this as the Disaster RECOVERY plan. The key feature of log shipping is that it will automatically backup transaction logs throughout the day and automatically restore them on the standby server at defined interval.

Log shipping is the process of automating the backup of database and transaction log files on a production SQL server, and then restoring them onto a standby server. Enterprise Editions only supports log shipping. In log shipping the transactional log file from one server is automatically updated into the backup database on the other server. If one server fails, the other server will have the same db and can be used this as the Disaster Recovery plan. The key feature of log shipping is that it will automatically backup transaction logs throughout the day and automatically restore them on the standby server at defined interval.

28.

Can A Stored Procedure Call Itself Or Recursive Stored Procedure? How Much Level Sp Nesting Is Possible?

Answer»

Yes. Because Transact-SQL supports recursion, you can WRITE stored procedures that call themselves. Recursion can be DEFINED as a method of problem SOLVING wherein the solution is arrived at by repetitively applying it to SUBSETS of the problem. A common application of recursive logic is to perform numeric computations that lend themselves to repetitive evaluation by the same processing steps. Stored procedures are nested when one stored procedure calls another or executes managed code by referencing a CLR routine, type, or aggregate. You can nest stored procedures and managed code references up to 32 levels.

Yes. Because Transact-SQL supports recursion, you can write stored procedures that call themselves. Recursion can be defined as a method of problem solving wherein the solution is arrived at by repetitively applying it to subsets of the problem. A common application of recursive logic is to perform numeric computations that lend themselves to repetitive evaluation by the same processing steps. Stored procedures are nested when one stored procedure calls another or executes managed code by referencing a CLR routine, type, or aggregate. You can nest stored procedures and managed code references up to 32 levels.

29.

What Is Sql Server Agent?

Answer»

SQL Server agent plays an important role in the day-to-day tasks of a database administrator (DBA). It is OFTEN overlooked as ONE of the main tools for SQL Server management. Its purpose is to ease the implementation of tasks for the DBA, with its FULL- function scheduling engine, which ALLOWS you to schedule your own jobs and scripts.

SQL Server agent plays an important role in the day-to-day tasks of a database administrator (DBA). It is often overlooked as one of the main tools for SQL Server management. Its purpose is to ease the implementation of tasks for the DBA, with its full- function scheduling engine, which allows you to schedule your own jobs and scripts.

30.

What Are The Authentication Modes In Sql Server? How Can It Be Changed?

Answer»

Windows MODE and Mixed Mode - SQL and Windows. To change authentication mode in SQL Server click START, PROGRAMS, Microsoft SQL Server and click SQL Enterprise Manager to run SQL Enterprise Manager from the Microsoft SQL Server program group. Select the server then from the Tools menu select SQL Server Configuration Properties, and choose the Security page.

Windows mode and Mixed Mode - SQL and Windows. To change authentication mode in SQL Server click Start, Programs, Microsoft SQL Server and click SQL Enterprise Manager to run SQL Enterprise Manager from the Microsoft SQL Server program group. Select the server then from the Tools menu select SQL Server Configuration Properties, and choose the Security page.

31.

What Are The Properties And Different Types Of Sub-queries?

Answer»

PROPERTIES of Sub-Query

  • A sub-query must be ENCLOSED in the parenthesis.
  • A sub-query must be put in the right hand of the comparison operator, and
  • A sub-query cannot contain an ORDER-BY clause.
  • A query can contain more than one sub-query.

Types of Sub-Query

  • Single-row sub-query, where the sub-query returns only one row.
  • Multiple-row sub-query, where the sub-query returns multiple ROWS,. and
  • Multiple COLUMN sub-query, where the sub-query returns multiple columns

Properties of Sub-Query

Types of Sub-Query

32.

What Is The Difference Between A Having Clause And A Where Clause?

Answer»

They SPECIFY a search condition for a group or an aggregate. But the difference is that HAVING can be used only with the SELECT STATEMENT. HAVING is TYPICALLY used in a GROUP BY clause. When GROUP BY is not used, HAVING behaves like a WHERE clause. Having Clause is BASICALLY used only with the GROUP BY function in a query whereas WHERE Clause is applied to each row before they are part of the GROUP BY function in a query.

They specify a search condition for a group or an aggregate. But the difference is that HAVING can be used only with the SELECT statement. HAVING is typically used in a GROUP BY clause. When GROUP BY is not used, HAVING behaves like a WHERE clause. Having Clause is basically used only with the GROUP BY function in a query whereas WHERE Clause is applied to each row before they are part of the GROUP BY function in a query.

33.

When Is The Use Of Update_statistics Command?

Answer»

This COMMAND is basically used when a large processing of DATA has occurred. If a large amount of deletions any modification or BULK Copy into the tables has occurred, it has to update the indexes to take these changes into account. UPDATE_STATISTICS updates the indexes on these tables ACCORDINGLY.

This command is basically used when a large processing of data has occurred. If a large amount of deletions any modification or Bulk Copy into the tables has occurred, it has to update the indexes to take these changes into account. UPDATE_STATISTICS updates the indexes on these tables accordingly.

34.

What Is Difference Between Delete And Truncate Commands?

Answer»

Delete command removes the rows from a table based on the condition that we provide with a WHERE clause. Truncate will actually REMOVE all the rows from a table and there will be no data in the table after we run the truncate command.
TRUNCATE:

  1. TRUNCATE is faster and uses FEWER system and transaction log resources than DELETE.
  2. TRUNCATE removes the data by deallocating the data pages used to store the table's data, and only the PAGE deallocations are recorded in the transaction log.
  3. TRUNCATE removes all rows from a table, but the table STRUCTURE, its columns, constraints, indexes and so on, remains. The counter used by an identity for new rows is reset to the seed for the column.
  4. You cannot use TRUNCATE TABLE on a table referenced by a FOREIGN KEY constraint. Because TRUNCATE TABLE is not logged, it cannot activate a trigger.
  5. TRUNCATE cannot be rolled back.
  6. TRUNCATE is DDL Command.
  7. TRUNCATE Resets identity of the table

DELETE:

  1. DELETE removes rows one at a time and records an entry in the transaction log for each deleted row.
  2. If you want to retain the identity counter, use DELETE instead. If you want to remove table definition and its data, use the DROP TABLE statement.
  3. DELETE Can be used with or without a WHERE clause
  4. DELETE Activates Triggers.
  5. DELETE can be rolled back.
  6. DELETE is DML Command.
  7. DELETE does not reset identity of the table.

Note: DELETE and TRUNCATE both can be rolled back when surrounded by TRANSACTION if the current session is not closed. If TRUNCATE is written in Query Editor surrounded by TRANSACTION and if session is closed, it can not be rolled back but DELETE can be rolled back.

 

Delete command removes the rows from a table based on the condition that we provide with a WHERE clause. Truncate will actually remove all the rows from a table and there will be no data in the table after we run the truncate command.
TRUNCATE:

DELETE:

Note: DELETE and TRUNCATE both can be rolled back when surrounded by TRANSACTION if the current session is not closed. If TRUNCATE is written in Query Editor surrounded by TRANSACTION and if session is closed, it can not be rolled back but DELETE can be rolled back.

 

35.

What's The Difference Between A Primary Key And A Unique Key?

Answer»

Both primary key and UNIQUE key enforces uniqueness of the column on which they are defined. But by default primary key creates a clustered index on the column, where are unique creates a NONCLUSTERED index by default. Another MAJOR difference is that, primary key doesn't allow NULLS, but unique key allows one NULL only.

Both primary key and unique key enforces uniqueness of the column on which they are defined. But by default primary key creates a clustered index on the column, where are unique creates a nonclustered index by default. Another major difference is that, primary key doesn't allow NULLs, but unique key allows one NULL only.

36.

What Is Oltp (online Transaction Processing)?

Answer»

In OLTP - online transaction PROCESSING systems relational database design use the discipline of data modeling and generally follow the Codd RULES of data normalization in order to ensure absolute data integrity. Using these rules complex information is broken down into its most simple structures (a table) where all of the individual atomic LEVEL ELEMENTS relate to each other and SATISFY the normalization rules.

In OLTP - online transaction processing systems relational database design use the discipline of data modeling and generally follow the Codd rules of data normalization in order to ensure absolute data integrity. Using these rules complex information is broken down into its most simple structures (a table) where all of the individual atomic level elements relate to each other and satisfy the normalization rules.

37.

What Are Different Types Of Collation Sensitivity?

Answer»
  1. Case sensitivity - A and a, B and b, ETC.
  2. Accent sensitivity
  3. Kana Sensitivity - When Japanese kana CHARACTERS Hiragana and Katakana are treated DIFFERENTLY, it is called Kana sensitive.
  4. WIDTH sensitivity - A single-byte character (half-width) and the same character represented as a double-byte character (full-width) are treated differently than it is width sensitive.

38.

What Are The Different Index Configurations A Table Can Have?

Answer»

A table can have one of the following INDEX CONFIGURATIONS:

  • No indexes
  • A clustered index
  • A clustered index and MANY nonclustered indexes
  • A nonclustered index
  • Many nonclustered indexes

A table can have one of the following index configurations:

39.

Which Tcp/ip Port Does Sql Server Run On? How Can It Be Changed?

Answer»

SQL Server runs on PORT 1433. It can be CHANGED from the Network Utility TCP/IP properties.

SQL Server runs on port 1433. It can be changed from the Network Utility TCP/IP properties.