SQL Data Types Questions and Answers

SQL Data Types MCQs : This section focuses on the "Data Types" of the SQL. These Multiple Choice Questions (mcq) should be practiced to improve the SQL skills required for various interviews (campus interview, walk-in interview, company interview), placement, entrance exam and other competitive examinations.

1. Choose a data type to store weight of a person in kilograms with accuracy of 1 gram. As per wikipedia, Jon Brower Minnoch was the heaviest human ever recorded with a weight of 635kg.

A. NUMBER(3,3)
B. NUMBER(3,2)
C. NUMBER(6,2)
D. NUMBER(6,3)

View Answer


2. What is the maximum value that can be stored in NUMERIC(4,2)?

A. 9999.99
B. 99.9999
C. 99.99
D. 9.99

View Answer


3. Which of the following statements are TRUE?

A. Scale denotes number of digits allowed after decimal point
B. SQL performs rounding if user attempts to store a value that has higher scale than the data type
C. Both A and B
D. None of the above

View Answer


4. Determine data type for the given column? Column Name: Price ; Description: Cost of an item in rupees and paise ; Example: 200.21

A. VARCHAR2(50)
B. NUMBER
C. NUMBER(5,2)
D. NUMBER(6)

View Answer


5. Determine data type for the given column? Column Name: IFSC_Code ; Description: A 11 Character alphanumeric code that identifies a bank branch ; Example: SBIN0009044

A. VARCHAR2(50)
B. NUMBER
C. Char(11)
D. NUMBER(11)

View Answer


6. Determine the most suitable data type for the given column? Column Name: Profile_Image ; Description: Image of the employee

A. Clob
B. Blob
C. Varchar(100)
D. None of the above

View Answer


7.  This set of Database Questions & Answers focuses on SQL Data Types and Schemas Dates must be specified in the format

A. mm/dd/yy
B. yyyy/mm/dd
C. dd/mm/yy
D. yy/dd/mm

View Answer


8. The user defined data type can be created using

A. Create datatype
B. Create data
C. Create definetype
D. Create type

View Answer


9. Values of one type can be converted to another domain using which of the following ?

A. Cast
B. Drop type
C. Alter type
D. Convert

View Answer


10. In contemporary databases, the top level of the hierarchy consists of ______ each of which can contain _____

A. Catalogs, schemas
B. Schemas, catalogs
C. Alter typeEnvironment, schemas
D. Schemas, Environment

View Answer


11. Choose the most suitable data type in case multiple data types are possible for the column. Column Name: Gender ; Description: A single character; gender code, M or F Example: M

A. CHAR(11)
B. VARCHAR2(50)
C. CHAR(1)
D. VARCHAR2(1)

View Answer


12. Choose the most suitable data type in case multiple data types are possible for the column. Column Name: PIN_Code ; Description: Six digit numeric PIN code for any address in India ; Example: 560100

A. Integer
B. VARCHAR2(11)
C. CHAR(11)
D. Number(6)

View Answer


13. Choose the most suitable data type in case multiple data types are possible for the column. Column Name: Student_id ; Description: Unique number assigned to every Student ; Example: 100000

A. Integer
B. VARCHAR2(11)
C. CHAR(11)
D. Number(6)

View Answer


14. Choose the most suitable data type in case multiple data types are possible for the column.Column Name: Date_Of_Birth ; Description: Date of Birth of the employee ; Example: 1990/01/01

A. Timestamp
B. VARCHAR2(11)
C. Blob
D. Date

View Answer


15. Many current-generation database applications need to store photographs, or of the order megabytes and gigabytes using

A. Large-index type
B. Large-object type
C. Large-location type
D. Large-locator type

View Answer


16.  SQL allows comparison operations on the data types i.e.

A. Date
B. Timestamp
C. Time
D. All of the above

View Answer


17. Current date is returned by the method

A. system.date
B. current.date
C. machine.date
D. today.date

View Answer


18. Data types in SQL Server are organized into how many categories?

A. 6
B. 7
C. 8
D. 9

View Answer


19. You want to track date and time of the last write access per row?

A. Add TIMESTAMP column to the table
B. Add a DATETIME column to the table and assign getdate() as the default value
C. Add a DATETIME column to the table and write a trigger that sets its value
D. Add a UNIQUEIDENTIFIER column to the table and use it with SQL Server's built-in functions

View Answer


20. In case of SQL Server 2005, binary data type can hold:

A. Fixed-length binary data with a maximum of 6000 bytes.
B. Fixed-length binary data with a maximum of 3000 bytes.
C. Fixed-length binary data with a maximum of 1024 bytes.
D. Fixed-length binary data with a maximum of 8000 bytes.

View Answer





Also check :


Discussion



* You must be logged in to add comment.