Database - Introduction to SQL - Discussion

Discussion :: Introduction to SQL - General Questions (Q.No.21)

21. 

Which of the following do you need to consider when you make a table in SQL?

[A]. Data types
[B]. Primary keys
[C]. Default values
[D]. All of the above.

Answer: Option D

Explanation:

No answer description available for this question.

Maitrayee said: (Mar 22, 2011)  
Why Default values. ?

To create a table we don't require the values.

Can someone please explain. ?

Mahesh said: (Aug 9, 2011)  
Because if there null values. When calculating the column values.

If there is null then the total will be '0'.

(anything + null = 0).

If we use default value '0' at integer column.

If we not specified the value then the 0 will be inserted in that column.

Then the total result will be correct. And also for char column it changes default. That if we don't know a person name. Instead of leaving it null. If we put default as 'not specified' then 'not specified' will be inserted in column. And so on.

Ahmed said: (Oct 5, 2011)  
But if we don't use primary keys and default values then also there is no problem in table creation. But data types must be provided prior.

Dev said: (Sep 16, 2013)  
Primary key and default values are optional. For creating table we need to consider the data type.

Kamrujjaman said: (Nov 3, 2016)  
I agree with you @Dev.

Anonymous said: (Nov 4, 2016)  
I too agree with you @Dev.

Priya said: (Jan 27, 2017)  
What is meant by default value in SQL?

Yih said: (Jun 28, 2017)  
Making full table, all are valuable.

Natasha said: (Dec 21, 2017)  
Can anyone please explain to me why option (D) All of the above, why not option (A) Datatypes?

Shubham Telavane said: (Dec 13, 2018)  
Can anyone please explain why option (D)?

Because we make one table for particular department or employee we use datatype otherwise compiler cannot identify which type of data insert in table.

Rohan said: (Dec 13, 2018)  
You are right, agree @Ahmed.

Post your comments here:

Name *:

Email   : (optional)

» Your comments will be displayed only after manual approval.