![]() ![]() Bit value literals are defined using b’val’ or ‘0bval’ notations. INSERT INTO attendance (STUDENT_NAME, ATTENDANCE, CLASS)Ī BIT value is inserted as a bit literal. The attendance filed will have 5 values representing the 5 working days. Name of the student is stored as char data type, class in the INT data type and the attendance is stored as a BIT data type. So the table name is attendance with three columns. The table holds data for student name, attendance as BIT value in binary with ‘1’ denoting presence & ‘0’ denoting absence and the class to which student belongs. Our table is to store the attendance of students in a class for 5 working days. We can create a table to understand the BIT data type. Please note that, if the value ‘n’ is not specified, the BIT value is defaulted to ‘1’ bit. ![]() How Does BIT Data Type work in MySQL?īIT (n) is defined with a defining statement like ‘create table’ etc. Let’s have look at the usage and examples of BIT data type. And if otherwise, the corresponding decimal value will be returned. When called upon, to be displayed as a binary value, the BIT data type will have syntax as below. Here, the keyword BIT defines it to store binary values as bits and the bit value is mentioned in variable ‘n’. Hadoop, Data Science, Statistics & others
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |