CBSE Class 12 Informatics Practices Question 58 of 79

Database Query using SQL — Question 16

Back to all questions
16
Question

Question 16

Write a MySQL command for creating a table PAYMENT whose structure is given below:

Table: PAYMENT

Field NameData typeSizeConstraint
Loan_numberInteger4Primary key
Payment_numberVarchar3
Payment_dateDate
Payment_amountInteger8Not Null
Answer
CREATE TABLE PAYMENT (
    Loan_number INT(4) PRIMARY KEY,
    Payment_number VARCHAR(3),
    Payment_date DATE,
    Payment_amount INT(8) NOT NULL
);