IT Questions and Answers :)

Friday, October 19, 2018

In Microsoft SQL Server, why does SELECT 1/2 return 0?

In Microsoft SQL Server, why does SELECT 1/2 return 0?

  • Numerator and denominator are both integers, so the result will be an integer
  • It doesn't - it returns 0.5
  • A bug in the code performing the division
  • A bug in the display in SSMS 

 
In Microsoft SQL Server, why does SELECT 1/2 return 0?

EXPLANATION

Due to the data type of the numerator and denominator being an "int", the return type is also assigned as an integer. While internally, the engine performs the calculation as 0.5, because the data type is an integer, the value gets converted to 0 and is returned as such.
Another way to say this is that the mathematical answer is 0.5 but because the system is only able to return an integer (whole number) the answer becomes 0 (the "whole number" in the answer).

Share:

Wednesday, October 17, 2018

Which of the following Windows console commands deletes a folder (c:\test), whether or not it is empty, without issuing any warnings?

Which of the following Windows console commands deletes a folder (c:\test), whether or not it is empty, without issuing any warnings?

  • rd test
  • rd test\* /q
  • del c:\test\*.* /s
  • rd c:\test /s /q 

Which of the following Windows console commands deletes a folder (c:\test), whether or not it is empty, without issuing any warnings?

EXPLANATION

The /s switch deletes ALL elements recursively inside the specified folder.
The /q switch is the silent mode, meaning there will be absolutely no warnings.
Caution

When you run rd /s in quiet mode, the entire directory tree is deleted without confirmation. Ensure that important files are moved or backed up before using the /q command-line option.
 
Share:

Thursday, October 11, 2018

What is the maximum number of devices that you can connect to a single USB 2.x controller?

What is the maximum number of devices that you can connect to a single USB 2.x controller?

  • 255
  • 31
  • 63
  • 127

What is the maximum number of devices that you can connect to a single USB 2.x controller?

EXPLANATION

Technically, a USB network is capable of supporting 128 nodes, though the USB controller itself is also a node.
In addition, any USB hubs, self-powered or bus-powered, count as additional nodes and reduce the number of nodes you can connect to the controller.
https://en.wikipedia.org/wiki/USB_hub#Physical_layout
 
Share:

Which of the following is NOT a daemon in Postfix?

Which of the following is NOT a daemon in Postfix?

  • qmgr
  • master
  •  crond
  • smtpd 

 
Which of the following is NOT a daemon in Postfix?

EXPLANATION

The crond daemon is a Linux daemon, not a Postfix daemon.
The master daemon is the brain of the Postfix mail system. It spawns all other daemons. The smtpd daemon (server) handles incoming connections. The qmgr daemon is the heart of the Postfix mail system. It processes and controls all messages in the mail queues.


Share:

Friday, September 28, 2018

At a Windows command prompt that is set to the root of the drive, which of the following commands will search the entire drive for all occurrences of the "Testing.docx" file?

At a Windows command prompt that is set to the root of the drive, which of the following commands will search the entire drive for all occurrences of the "Testing.docx" file?

  • DIR /ALL Testing.docx
  • DIR Testing.docx
  • DIR /S Testing.docx
  • DIR /R Testing.docx 

 
At a Windows command prompt that is set to the root of the drive, which of the following commands will search the entire drive for all occurrences of the "Testing.docx" file?

EXPLANATION

The directory command allows many flags, including the recursive search flag "/S".
This flag searches the current folder and all sub folders.
Share:

Thursday, September 27, 2018

What IEEE standard was Wired Equivalent Privacy first introduced?

What IEEE standard was Wired Equivalent Privacy first introduced?

  • 802.1x
  • 801.1a
  • 802
  • 802.11 


EXPLANATION

IEEE introduced WEP in the 802.11 standard but updated it in the 802.1x.

SOURCE

https://www.giac.org/paper/gsec/4214/wireless-security-ieee-80211-standards/106760
Share:

Wednesday, September 26, 2018

An initialization vector should be which of the following?

An initialization vector should be which of the following?

  • Repeatable and random
  • Unique and predictable
  • Unique and unpredicatable
  • Repeatable and unique 

 
An initialization vector should be which of the following?

EXPLANATION

An initialization vector (IV) should be unique and unpredictable. To prevent an attack,
an IV must not be repeated with a given key and should appear random.

SOURCE

https://en.wikipedia.org/wiki/Initialization_vector
Share:

Popular Posts