A university database contains the following information about each student – their full name, their student ID number (a randomly assigned 8-digit number), their date of birthday, their sex, their age and the year they joined the university. Identify which data-type each attribute belongs to, and explain your answer.
For Full name, datatype = VARCHAR. Varchar is the string of variable size, which takes size as a parameter which specifies the maximum length of string
For student ID number, datatype = INT, with size parameter as 8 as we will have 8-digit number for ID.
For day of Bithday, datatype = DATE, It has format YYYY-MM-DD. If we don't want to store the year, put 0000 in the year field.
For sex, datatype = CHAR, It is a fixed length string. It's size is 1 by default unless size parameter is passed to it. We can pass 'M' or 'F' to it for Male and Female sex respectively.
For Age , datatype = INT, description is same as that of student ID.
For year of joining, datatype = INT with size = 4. It will store integers of 4 digits like year of joining.
if it helps you, do upvote as it motivates us a lot!
if you have any doubt, do share in comments section!
Get Answers For Free
Most questions answered within 1 hours.