PrepAway - Latest Free Exam Questions & Answers

Which of the above-mentioned lines has an error?

Consider the case of a fruit juice company. The company manufactures fruit juices and supplies them to
wholesalers. The Database Designer creates a table named Production. The code is given below:
1.CREATE Table Production
2.(Fruit_type VarChar,
3.Fruit_name Char(20),
4.Quantity Int(3))
Which of the above-mentioned lines has an error?

PrepAway - Latest Free Exam Questions & Answers

A.
Line 3

B.
Line 2

C.
Line 1

D.
Line 4

Explanation:
In line 2, Fruit_type is declared as VarChar. A VarChar datatype should always specify the maximum length of
the column. However, in this case, the maximum length has not been specified.

5 Comments on “Which of the above-mentioned lines has an error?

  1. Max says:

    It’s D. Paste in SSMS 2012 and line 4 has an error under Int(3). I don’t think you can specify a precision for an int, but you can leave off the max length for a varchar, and it defaults to a length of 1.




    0



    0
  2. ajay says:

    Consider the case of a fruit juice company. The company manufactures fruit juices and supplies
    them to wholesalers. The Database Designer creates a table named Production. The code is given
    below:
    1. CREATE Table Production
    2. 2.(Fruit_type VarChar,
    3. Fruit_name Char(20),
    4. Quantity Int(3))
    Which of the above-mentioned lines has an error?
    A. Line 3
    B. Line 2
    C. Line 1
    D. Line 4
    Correct Answer: B




    0



    0

Leave a Reply