पहले 10 प्रश्नों के उत्तर और हल यहीं खुले हैं; बाक़ी 15 के उत्तर और हल FliQi Question Bank app में।
भाषा
प्रश्न 1उत्तर + हल
Oracle में NUMBER प्रकार के स्तंभ की तुलना किसी वर्ण श्रृंखला से की जाए, तो अंतर्निहित रूपांतरण (implicit conversion) किस दिशा में होता है?
In Oracle, when a column of NUMBER type is compared with a character string, in which direction does the implicit conversion take place?
ANUMBER मान को वर्ण श्रृंखला में बदला जाता हैThe NUMBER value is converted to a character string
Bदोनों पक्ष DATE में बदले जाते हैंBoth sides are converted to DATE
Cकोई रूपांतरण नहीं होता और तुलना सदा असत्य रहती हैNo conversion occurs and the comparison is always false
Dवर्ण श्रृंखला को NUMBER में बदला जाता हैThe character string is converted to NUMBER
सही उत्तर / Answer: (D)
हल / Solution
वर्ण और संख्या की तुलना में Oracle वर्ण श्रृंखला को NUMBER में बदलता है, अर्थात संख्या की ओर झुकाव रहता है। इसी से WHERE sal = '5000' चल जाता है, पर श्रृंखला में अंक न हों तो क्रम-भंग की त्रुटि आती है। उल्टी दिशा नहीं होती, और DATE का यहाँ कोई प्रसंग नहीं। तुलना असत्य भी नहीं रहती। फिर भी भरोसेमंद लेखन में TO_NUMBER जैसे स्पष्ट रूपांतरण लिखना ही अच्छा माना जाता है।
In a comparison between character and numeric data Oracle converts the character string to NUMBER, so the bias is towards the number. This is why WHERE sal = '5000' works, though a string holding non-numeric characters raises a conversion error. The reverse direction does not happen, DATE has no part here, and the comparison is not simply false. Even so, writing an explicit TO_NUMBER is the safer practice.
प्रश्न 2उत्तर + हल
Oracle में DATE मान को वर्ण श्रृंखला (character string) में स्पष्ट रूपांतरण (explicit conversion) करने के लिए कौन-सा फलन प्रयुक्त होता है?
In Oracle, which function is used for the explicit conversion of a DATE value into a character string?
ATO_DATE
BTO_NUMBER
CNVL
DTO_CHAR
सही उत्तर / Answer: (D)
हल / Solution
TO_CHAR किसी DATE या संख्या को वर्ण श्रृंखला में बदलता है और उसके साथ format model देकर रूप भी तय किया जा सकता है, जैसे दिन-माह-वर्ष का क्रम। TO_DATE उलटा काम करता है — वर्ण श्रृंखला से DATE बनाता है। TO_NUMBER वर्ण श्रृंखला को संख्या में बदलता है। NVL रूपांतरण का फलन ही नहीं, वह NULL के बदले दूसरा मान देने के लिए है, इसलिए यहाँ अप्रासंगिक है।
TO_CHAR turns a DATE or a number into a character string, and a format model may be supplied with it to settle the appearance, such as the order of day, month and year. TO_DATE does the reverse, building a DATE from a character string, while TO_NUMBER converts a string into a number. NVL is not a conversion function at all; it substitutes a value for NULL, so it is irrelevant here.
प्रश्न 3उत्तर + हल
मानक SQL के BOOLEAN डेटा प्रकार का कोई स्तंभ कौन-कौन से मान धारण कर सकता है?
Which values can a column of the standard SQL BOOLEAN data type hold?
Aकेवल TRUE और FALSEOnly TRUE and FALSE
BTRUE, FALSE तथा UNKNOWN (NULL)TRUE, FALSE and UNKNOWN (NULL)
Cकेवल 0 और 1Only 0 and 1
DTRUE, FALSE तथा ERRORTRUE, FALSE and ERROR
सही उत्तर / Answer: (B)
हल / Solution
SQL का तर्क द्विमानी नहीं, त्रिमानी है, क्योंकि NULL किसी भी स्तंभ में आ सकता है। इसलिए BOOLEAN प्रकार के तीन मान माने जाते हैं — TRUE, FALSE और UNKNOWN, जहाँ UNKNOWN वही स्थिति है जो NULL से बनती है। केवल TRUE-FALSE वाला विकल्प NULL को भूल जाता है। 0 और 1 कुछ डेटाबेस के भीतरी रूप हैं, मानक के मान नहीं। ERROR नाम का कोई तार्किक मान SQL में नहीं है।
The logic of SQL is three-valued rather than two-valued, because NULL may appear in any column. A BOOLEAN type is therefore taken to have three values: TRUE, FALSE and UNKNOWN, where UNKNOWN is the state produced by a NULL. The option naming only TRUE and FALSE forgets NULL. The values 0 and 1 are internal forms used by certain databases, and SQL has no logical value called ERROR.
प्रश्न 4उत्तर + हल
मानक SQL के अनुसार NUMERIC(p, s) और DECIMAL(p, s) में अंतर क्या है?
According to the SQL standard, what is the difference between NUMERIC(p, s) and DECIMAL(p, s)?
ANUMERIC में precision ठीक वही रहती है जो घोषित की गई, DECIMAL में क्रियान्वयन उससे अधिक precision दे सकता हैNUMERIC keeps exactly the declared precision, while an implementation may give DECIMAL more precision than declared
BNUMERIC सन्निकट प्रकार है और DECIMAL यथातथ प्रकारNUMERIC is an approximate type and DECIMAL an exact type
CNUMERIC में scale नहीं लिखी जा सकतीThe scale cannot be written for NUMERIC
DDECIMAL में केवल पूर्णांक रखे जा सकते हैंOnly integers can be kept in DECIMAL
सही उत्तर / Answer: (A)
हल / Solution
दोनों यथातथ (exact) संख्यात्मक प्रकार हैं और व्यवहार में लगभग एक जैसे मिलते हैं, पर मानक में भेद है: NUMERIC को घोषित precision ठीक उतनी ही देनी होती है, जबकि DECIMAL में क्रियान्वयन कम से कम उतनी, आवश्यकता पड़े तो अधिक precision दे सकता है। अतः NUMERIC को सन्निकट प्रकार कहने वाला विकल्प ग़लत है। scale दोनों में लिखी जा सकती है, और DECIMAL में scale देकर दशमलव अंक भी रखे जाते हैं।
Both are exact numeric types and behave almost alike in practice, yet the standard draws a line: NUMERIC must be given exactly the declared precision, whereas for DECIMAL an implementation may supply at least that precision and more if it chooses. Calling NUMERIC an approximate type is therefore wrong. A scale may be written for either, and a DECIMAL with a scale does keep decimal digits.
प्रश्न 5उत्तर + हल
मानक SQL में FLOAT एक सन्निकट (approximate) संख्यात्मक प्रकार है। बैंक शेष जैसे मुद्रा मान के लिए यह अनुपयुक्त क्यों माना जाता है?
In standard SQL, FLOAT is an approximate numeric type. Why is it considered unsuitable for a monetary value such as a bank balance?
Aक्योंकि इसमें ऋणात्मक मान नहीं रखे जा सकतेBecause negative values cannot be kept in it
Bक्योंकि इसमें दशमलव अंक रखे ही नहीं जा सकतेBecause decimal digits cannot be kept in it at all
Cक्योंकि इस पर ORDER BY नहीं लगाया जा सकताBecause ORDER BY cannot be applied to it
Dक्योंकि संचित मान डाले गए मान से तनिक भिन्न हो सकता है, जिससे जोड़ और समानता की जाँच बिगड़ती हैBecause the stored value may differ slightly from the entered value, spoiling sums and equality tests
सही उत्तर / Answer: (D)
हल / Solution
सन्निकट प्रकार मान को द्विअंकी रूप में लगभग रखता है, इसलिए 0.1 जैसे अंश ठीक-ठीक नहीं बैठते और हज़ारों पंक्तियों का जोड़ पैसों में खिसक जाता है; समानता की जाँच भी अप्रत्याशित रूप से असफल होती है। इसीलिए मुद्रा के लिए यथातथ प्रकार DECIMAL या NUMBER निश्चित scale के साथ लिया जाता है। FLOAT में ऋणात्मक मान और दशमलव अंक दोनों रखे जा सकते हैं, और उस पर ORDER BY भी चलता है।
An approximate type keeps the value as a near binary equivalent, so fractions like 0.1 do not sit exactly, and a sum over thousands of rows drifts by paise, while equality tests fail unpredictably. Money is therefore stored in an exact type, DECIMAL or NUMBER with a settled scale. Negative values and decimal digits can both be kept in FLOAT, and ORDER BY works on it as well.
प्रश्न 6उत्तर + हल
Oracle में ANSI प्रकार INTEGER से स्तंभ बनाने पर वह भीतर किस प्रकार में बदल दिया जाता है?
In Oracle, when a column is created with the ANSI type INTEGER, which type is it internally converted to?
ANUMBER(10, 0)
BBINARY_DOUBLE
CNUMBER(38, 0)
DVARCHAR2(38)
सही उत्तर / Answer: (C)
हल / Solution
Oracle के अपने प्रकार सीमित हैं; ANSI और अन्य मानकों के नाम वह स्वीकार करके भीतर अपने प्रकार में बदल देता है। INTEGER, INT और SMALLINT तीनों NUMBER(38) यानी NUMBER(38, 0) बन जाते हैं, इसलिए घोषणा चाहे SMALLINT लिखी हो, हद वही बड़ी रहती है। NUMBER(10, 0) ऐसी कोई स्वतः बनने वाली समतुल्यता नहीं है। BINARY_DOUBLE सन्निकट प्रकार है और VARCHAR2 वर्ण प्रकार, दोनों का INTEGER से मेल नहीं।
Oracle has a limited set of native types; it accepts names from ANSI and other standards and converts them internally. INTEGER, INT and SMALLINT all become NUMBER(38), that is NUMBER(38, 0), so even a column declared SMALLINT carries that wide range. NUMBER(10, 0) is no such automatic equivalent. BINARY_DOUBLE is an approximate type and VARCHAR2 a character type, so neither matches INTEGER.
प्रश्न 7उत्तर + हल
MySQL में निम्न पूर्णांक प्रकारों में से कौन-सा सबसे अधिक संचयन स्थान (8 बाइट) लेता है?
In MySQL, which of the following integer types takes the most storage space (8 bytes)?
ATINYINT
BSMALLINT
CINT
DBIGINT
सही उत्तर / Answer: (D)
हल / Solution
MySQL में पूर्णांक प्रकारों का आकार बढ़ते क्रम में है — TINYINT एक बाइट, SMALLINT दो बाइट, MEDIUMINT तीन, INT चार और BIGINT आठ बाइट। अतः सबसे अधिक जगह BIGINT लेता है और उसी में सबसे बड़ी संख्याएँ आती हैं। चुनाव में कंजूसी समझदारी है: जितनी हद चाहिए उतना ही बड़ा प्रकार लें, क्योंकि बड़ा प्रकार हर पंक्ति में अतिरिक्त बाइट और सूचकांक में अतिरिक्त आकार जोड़ता है।
In MySQL the integer types rise in size as follows: TINYINT one byte, SMALLINT two bytes, MEDIUMINT three, INT four and BIGINT eight bytes. BIGINT therefore takes the most space and accommodates the largest values. Being frugal in the choice is wise: pick only the width the range demands, because a wider type adds extra bytes to every row and extra size to each index built on it.
प्रश्न 8उत्तर + हल
Oracle में RAW डेटा प्रकार की मुख्य विशेषता क्या है?
What is the main characteristic of the RAW data type in Oracle?
Aइसमें रखी सामग्री का वर्ण समुच्चय रूपांतरण नहीं किया जाताThe content kept in it is not subjected to character set conversion
Bइसमें रखी सामग्री स्वतः संपीडित (compress) हो जाती हैThe content kept in it is automatically compressed
Cयह केवल धनात्मक पूर्णांक रखता हैIt stores only positive integers
Dइस पर SUM और AVG जैसे समुच्चय फलन चलाए जा सकते हैंAggregate functions such as SUM and AVG can be run on it
सही उत्तर / Answer: (A)
हल / Solution
RAW द्विअंकी बाइटों का प्रकार है। वर्ण प्रकारों में डेटा एक तंत्र से दूसरे तंत्र में जाते समय वर्ण समुच्चय के अनुसार बदला जाता है, पर RAW में Oracle बाइटों की व्याख्या ही नहीं करता, इसलिए वे ज्यों के त्यों पहुँचते हैं — यही इसका मुख्य उपयोग है। संपीडन इसका गुण नहीं। यह पूर्णांक रखने का प्रकार नहीं, और बाइटों पर SUM या AVG का कोई अर्थ नहीं बनता।
RAW is a type for binary bytes. In character types the data is converted according to the character set when it moves from one system to another, but with RAW Oracle does not interpret the bytes at all, so they arrive unchanged; this is its main use. Compression is not a property of it. It is not a type for integers, and SUM or AVG make no sense over raw bytes.
प्रश्न 9उत्तर + हल
Oracle में NCLOB और CLOB में मूल अंतर क्या है?
In Oracle, what is the basic difference between NCLOB and CLOB?
ANCLOB राष्ट्रीय वर्ण समुच्चय (national character set) में सामग्री रखता है, CLOB डेटाबेस वर्ण समुच्चय मेंNCLOB keeps content in the national character set, CLOB in the database character set
BNCLOB द्विअंकी सामग्री रखता है, CLOB वर्ण सामग्रीNCLOB keeps binary content while CLOB keeps character content
CNCLOB में केवल संख्याएँ रखी जा सकती हैंOnly numbers can be kept in an NCLOB
DNCLOB का आकार 4000 बाइट तक सीमित हैAn NCLOB is limited to 4000 bytes in size
सही उत्तर / Answer: (A)
हल / Solution
दोनों बड़े वर्ण प्रकार हैं; फ़र्क़ वर्ण समुच्चय का है। CLOB डेटाबेस वर्ण समुच्चय में पाठ रखता है, जबकि NCLOB राष्ट्रीय वर्ण समुच्चय में, जो Unicode आधारित होता है और अनेक भाषाओं का पाठ सँभालता है। द्विअंकी सामग्री का प्रकार BLOB है, NCLOB नहीं, इसलिए NCLOB को द्विअंकी प्रकार बताने वाला विकल्प ग़लत है। NCLOB संख्या के लिए नहीं है और उसकी हद 4000 बाइट जैसी छोटी नहीं, LOB स्तर की बड़ी होती है।
Both are large character types; the difference lies in the character set. CLOB holds text in the database character set, whereas NCLOB holds it in the national character set, which is Unicode based and handles text of many languages. The type for binary content is BLOB and not NCLOB, so calling NCLOB a binary type is wrong. NCLOB is not meant for numbers, and its limit is of LOB size, not a mere 4000 bytes.
प्रश्न 10उत्तर + हल
किसी विद्यार्थी की स्कैन की गई छायाचित्र फ़ाइल (photograph) को तालिका के एक स्तंभ में रखना है। सबसे उपयुक्त डेटा प्रकार कौन-सा है?
A student's scanned photograph file is to be kept in a column of a table. Which is the most appropriate data type?
ABLOB
BCLOB
CVARCHAR2
DNUMBER
सही उत्तर / Answer: (A)
हल / Solution
छायाचित्र द्विअंकी (binary) सामग्री है, और बड़े द्विअंकी वस्तु के लिए बना प्रकार BLOB यानी Binary Large Object है, जो गीगाबाइट स्तर तक की फ़ाइल रख सकता है। CLOB भी बड़ा प्रकार है, पर वह वर्ण सामग्री के लिए है, इसलिए चित्र के बाइट उसमें बिगड़ सकते हैं। VARCHAR2 की लंबाई सीमित है और वह भी वर्ण प्रकार है। NUMBER केवल संख्या रखता है।
A photograph is binary content, and the type built for a large binary object is BLOB, which can hold files running into gigabytes. CLOB is a large type as well, but it is meant for character content, so the bytes of an image may be corrupted in it. VARCHAR2 is limited in length and is likewise a character type, while NUMBER holds only numeric values.
आगे के 15 प्रश्नों के उत्तर और हल app मेंFliQi Question Bank — अभ्यास, हल और आपकी प्रगति
Oracle में NUMBER(5, -2) जैसी ऋणात्मक scale वाली घोषणा का क्या अर्थ है?
In Oracle, what does a declaration with a negative scale, such as NUMBER(5, -2), mean?
Aमान दशमलव बिंदु के दाईं ओर दो अंक तक पूर्णांकित होता हैThe value is rounded to two digits to the right of the decimal point
Bस्तंभ में केवल ऋणात्मक संख्याएँ रखी जा सकती हैंOnly negative numbers can be kept in the column
Cऐसी घोषणा Oracle में मान्य नहीं हैSuch a declaration is not valid in Oracle
Dमान दशमलव बिंदु के बाईं ओर दो अंक तक, अर्थात निकटतम सैकड़े तक पूर्णांकित होता हैThe value is rounded two digits to the left of the decimal point, that is, to the nearest hundred
Oracle में जब तुलना के दोनों पक्ष CHAR प्रकार के हों और उनकी लंबाई अलग-अलग हो, तो कौन-सी तुलना विधि (comparison semantics) लागू होती है?
In Oracle, when both sides of a comparison are of CHAR type but of different lengths, which comparison semantics is applied?
ANon-padded तुलना — लंबाई का अंतर भी असमानता बनाता हैNon-padded comparison — a difference in length also makes them unequal
Bतुलना से पहले दोनों मान NUMBER में बदले जाते हैंBoth values are converted to NUMBER before comparison
CBlank-padded तुलना — छोटे मान को रिक्त स्थान से बढ़ाकर बराबर किया जाता हैBlank-padded comparison — the shorter value is extended with blanks to equal length
Dतुलना अवैध है और त्रुटि आती हैThe comparison is invalid and raises an error