Informatics Practices
Identify the correct statement(s):
Statement 1 (S1): Char data type in MySQL stores fixed length strings.
Statement 2 (S2): Char data type stores string smaller than the maximum field size.
- (S1) : Correct, (S2) : Correct
- (S1): Incorrect, (S2) : Correct
- (S1): Correct, (S2) : Incorrect
- (S1) : Incorrect, (S2) : Incorrect
Answer
(S1): Correct, (S2) : Incorrect
Reason — The CHAR data type provides fixed-length memory storage. It specifies a fixed-length character string. If the input string is shorter, MySQL pads it with spaces to fill the fixed length. If the input string is longer, it is truncated to fit the fixed length.
Related Questions
…………… are words that have a special meaning in SQL.
- Keyword
- Literal
- Variable
- Table
Which of the following are DDL commands?
(A) Delete
(B) Create
(C) Update
(D) Alter
(E) Drop
- (B), (D) and (E)
- (A), (B) and (D)
- (B), (C) and (D)
- (A), (B) and (C)
Which of the following keywords is used to display non-repeated values in MySQL?
- Unique
- All
- Order by
- Distinct
The SQL statements always end with …………… .
- ,
- :
- ;
- "