3.3.3 Constraints

3.3.3 সীমাবদ্ধতা

In MySQL, data validation can be censured through Constraints while entering data in a table. Constraints are some ruled that help ensure the validity of the data while entering data a table. The constraints in MySQL are PRIMART KEY,NOT NULL, FOREIGN KEY,UNIQUE, ENUM. and SET. we will discuss NOT NULL and PRIMART KEY HERE.

মাইএছকিউএল-ত, তালিকা এখনত ডাটা প্ৰবিষ্ট কৰোঁতে সীমাবদ্ধতাৰ জৰিয়তে ডাটা বৈধকৰণ নিন্দা কৰিব পাৰি। সীমাবদ্ধতাবোৰ কিছুমানৰ সিদ্ধান্ত যি ডাটা এখন তালিকা প্ৰবিষ্ট কৰোঁতে ডাটাৰ বৈধতা নিশ্চিত কৰাত সহায় কৰে। মাইএছকিউএলৰ সীমাবদ্ধতাবোৰ হৈছে প্ৰাইমাৰ্ট কী, নট এনইউএল, ফৰেইন কী, ইউনিক, ইএনইউএম। আৰু ছেট। আমি ইয়াত এনইউএল আৰু প্ৰাইমাৰ্ট কী আলোচনা কৰিম।

NOT NULL: This constraint tells us that we cannot store a null value in a column any more.

এন.ইউ.এল. নহয়: এই সীমাবদ্ধতাই আমাক কয় যে আমি স্তম্ভ এটাত আৰু বাতিল মূল্য সংৰক্ষণ কৰিব নোৱাৰো।

PRIMART KEY: A primary key is a field which can table primary key.

প্ৰাইমাৰ্ট কী: প্ৰাথমিক কী হৈছে এক ক্ষেত্ৰ যি প্ৰাথমিক কী তালিকাভুক্ত কৰিব পাৰে।

For example, Create a table Student under the database School in MySQL for the specification shown in the table.

উদাহৰণ স্বৰূপে, তালিকাত দেখুওৱা নিৰ্দিষ্টকৰণৰ বাবে মাইএছকিউএল-ৰ ডাটাবেচ স্কুলৰ অধীনত এখন টেবল ষ্টুডেণ্ট সৃষ্টি কৰক।

Constraints are the rules that we can apply on the type of data in a table. That is, we specify the limit on the type of data that can be stored in a table using constraints.

Create Table student (Roll No INT PRIMARY KEY, Name VARCHAR(20) NOT NULL Class INT, Section CHAR (1), DateOfAdmission Date Not NULL, TotalMarks INT NOT NULL);Refer to Fig 3.9 to view the command in the database and its resuIt.

Fig 3.9 Greating Table