Computer Science - Informatics Practices Class XI/XII MySQL Test Series Part 6

Computer Science - Informatics Practices Class XI/XII MySQL Test Series Part 6

Q1. ___________ command is used to remove database completely.

Q2. Which command is used to show the structure of the table.

Q3. Name the columns which are visible when we execute the following command.

desc book;

Q4. Write the command to create the following table : "Student"

Field Name                        Data type                        Constraint

Rollno                                Integer (5)                      Primary Key

Sname                               Varchar(30)             

Contactno                          Char(10)                         Not Null


Q5. Write query to insert the following record in above created table.

      Roll number --  1, Name--Amit, Contact number-- 1234567890

Q6. Write a query to insert the following values only.

       Roll number --  2 , Contact number-- 11111111

Q7. Is Null value is equivalent to Zero?

Q8. What do you mean by Null in MySQL?

Q9. Which command is used to modify data in table?

Q10. Write a query to modify the Contactno to 98789878 whose roll number is 1

         in table student.(given above)


 SOLUTIONS

Q1. ___________ command is used to remove database completely.

Ans. Drop

Q2. Which command is used to show the structure of the table.

Ans. desc or describe.

Q3. Name the columns which are visiblewhen we execute the following command.

desc book;

Ans. Columns are:

Field,      Type          Null,          Key,          Default,          Extra

Q4. Write the command to create the following table : "Student"

Field Name                        Data type                        Constraint

Rollno                                Integer (5)                      Primary Key

Sname                               Varchar(30)             

Contactno                          Char(10)                         Not Null


Ans. Create table student(Rollno integer(5) not null primary key, Sname varchar(30), Contactno char(10) not null);

Q5. Write query to insert the following record in above created table.

      Roll number --  1, Name--Amit, Contact number-- 1234567890

Ans. Insert into student values(1, "Amit", "123456780");

Q6. Write a query to insert the following values only.

       Roll number --  2 , Contact number-- 11111111

Ans. Insert into student(Rollno, Contactno) values(2,'1111111');

Q7. Is Null value is equivalent to Zero?

Ans. No

Q8. What do you mean by Null in MySQL?

Ans. Null means a value which is unavailable or in other words 

       we can say Null means no value.

Q9. Which command is used to modify data in table?

Ans. Update

Q10. Write a query to modify the Contactno to 98789878 whose roll number is 1

         in table student.(given above)

Ans. Update student set Contactno='98789878' where Rollno = 1;



1 comment:

Most Recently Published

File Handling Test 6

 File Handling Test 6 Q1 . Do we need to use the close() function when we use 'with' statement to open a file? Q2. Which mode you wi...

CS - IP Assignment/Worksheet