IT Questions and Answers :)

Friday, August 16, 2019

In T-SQL, very rarely would you need to use the following:

In T-SQL, very rarely would you need to use the following:

  • RIGHT JOIN
  • CTE
  • CURSOR
  • LEFT JOIN 

EXPLANATION

Specifies a temporary named result set, known as a common table expression (CTE). This is derived from a simple query and defined within the execution scope of a single SELECT, INSERT, UPDATE, DELETE or MERGE statement. This clause can also be used in a CREATE VIEW statement as part of its defining SELECT statement. A common table expression can include references to itself. This is referred to as a recursive common table expression.

Transact-SQL Syntax Conventions

Syntax

[ WITH <common_table_expression> [ ,...n ] ]  
  
<common_table_expression>::=  
    expression_name [ ( column_name [ ,...n ] ) ]  
    AS  
    ( CTE_query_definition ) 
 

T-SQL stands for Transact-SQL, and is Sybase & Microsoft’s proprietary extension.
T-SQL is a programming language and very similar to PL/SQL (in Oracle), one can create T-SQL units such as SQL Scripts, Stored Procedures, Functions, Types, Triggers, etc.
SQL DBA is entirely different track and requires different skills, and have altogether different carrier path. It deals with non-programming stuff usually, like installing SQL Server, maintaining databases, backup/restore, user security, etc, and much more stuff.
Thus you won't get more people/resources with both the skills.
For more details on T-SQL, SQL and database languages and tools check this blog post: What is SQL, PL/SQL, T-SQL and difference between them

Share:

Which of the following is true about a message transfer agent (MTA)?

Which of the following is true about a message transfer agent (MTA)?

  • Forwards incoming email to the right destination
  • Uses peer-to-peer application architecture
  • Implements only the server portion of SMTP
  • Implements only the client portion of SMTP 
Which of the following is true about a message transfer agent (MTA)?

EXPLANATION

Message transfer agent within Internet message handling services, a message transfer agent or mail transfer agent or mail relay is software that transfers electronic mail messages from one computer to another using a client–server application architecture. An MTA implements both the client and server portions of the Simple Mail Transfer Protocol.
A message transfer agent receives mail from either another MTA, a mail submission agent (MSA), or a mail user agent (MUA). The transmission details are specified by the Simple Mail Transfer Protocol (SMTP). When a recipient mailbox of a message is not hosted locally, the message is relayed, that is, forwarded to another MTA. Every time an MTA receives an email message, it adds a Received trace header field to the top of the header of the message,[4] thereby building a sequential record of MTAs handling the message. The process of choosing a target MTA for the next hop is also described in SMTP, but can usually be overridden by configuring the MTA software with specific routes.  


An MTA works in the background, while the user usually interacts directly with a mail user agent. One may distinguish initial submission as first passing through an MSA – port 587 is used for communication between an MUA and an MSA, while port 25 is used for communication between MTAs, or from an MSA to an MTA;[5] this distinction is first made in RFC 2476.
For recipients hosted locally, the final delivery of email to a recipient mailbox is the task of a message delivery agent (MDA). For this purpose the MTA transfers the message to the message handling service component of the message delivery agent (MDA). Upon final delivery, the Return-Path field is added to the envelope to record the return path.

 

Share:

Does your company use the form ID-10T is response to a users question?

Does your company use the form ID-10T is response to a users question?

  • Yes!
  • That is not nice!
  • We would like to!
  • No! 
Does your company use the form ID-10T is response to a users question?


EXPLANATION

ID-10-T error

ID-Ten-T error[11] (also seen as ID10T and ID107) is a masked jab at the user: when ID-Ten-T is spelled out it becomes ID10T ("IDIOT"). It is also known as a "Ten-T error" or "ID:10T error". The User Friendly comic strip presented this usage in a cartoon on 11 February 1999.[12]
In United States Navy and Army slang, the term has a similar meaning, though it's pronounced differently:
  • The navy pronounces ID10T as "eye dee ten tango".[13]
  • The army instead uses the word 1D10T which it pronounces as "one delta ten tango".

 


Share:

Which is faster? Inserting 1 Million rows of data or Updating 1 Million rows of data?

Which is faster? Inserting 1 Million rows of data or Updating 1 Million rows of data?

  • It depends
  • Updating
  • Inserting
  • Google it! 

EXPLANATION

INSERT is always faster because UPDATE necessarily requires a scan(whether aided by indexes or not) to find the individual row(s) to alter. By contrast, the database engine already has the next locations in each table allocated and identified for INSERT actionsand maintains this information in the control files.
INSERT is also faster than DELETE and INSERT as a substitute for UPDATE for two reasons: not only is the database required to _find_the rows to DELETE, but it must maintain the UNDO for BOTH the DELETE and INSERT actions in the redo logs. A DELETE will take just as long as an UPDATE by itself. Adding the additional INSERT afterwards only further increases the time differential. 



SQL> --create table juva as select * from dba_objects
SQL> truncate table juva
Table truncated.
Elapsed: 00:00:01.09
SQL> insert into juva select * from dba_objects
71238 rows created.
Elapsed: 00:00:02.12
SQL> commit
Commit complete.
Elapsed: 00:00:00.17
SQL> update juva set object_type = 'unknown'
71238 rows updated.
Elapsed: 00:00:05.97
SQL> commit
Commit complete.
Elapsed: 00:00:00.20

 
Share:

Who is the most important user of a database?

Who is the most important user of a database?

  • Payroll
  • The Database Administrator
  • Everyone
  • The current user with a problem 


EXPLANATION

 Short answer, from a DBA's point of view - Each person who logs into the database. A DB system is there to provide data to the end user. If users can't get their data the database is useless. "Important", in this case, is an extremely subjective term.

Share:

Popular Posts