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

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

Q1. Which command is used to delete data from the table?

Q2. Which command is used to add column in a table?

Q3. Write a query to add the column DOB of data type date in table Student.

Q4. Write a query to add new column "Grade" of data type varchar(2) in table 'Student' 

       with default value "A".

Q5. Write a query to change the data type of above added column (Grade) to varchar(4).

Q6. Write a query to delete column Grade from table student.

Q7. ___________Command is used to delete table completely/permanently.

Q8. Write a query to delete the table "Emp" permanently.

Q9. Delete from emp;

       The above command will delete all the records from table "emp". (True/False)

Q10. Write a query to display all the records from table "Student"

        

SOLUTIONS

Q1. Which command is used to delete data from the table?

Ans. Delete

Q2. Which command is used to add column in a table?

Ans. Alter

Q3. Write a query to add the column DOB of data type date in table Student.

Ans. Alter table student add DOB date;

Q4. Write a query to add new column "Grade" of data type varchar(2) in table 'Student' 

       with default value "A".

Ans. Alter table student add( Grade char(2) default "A");

Q5. Write a query to change the data type of above added column (Grade) to varchar(4).

Ans. Alter table student modify (Grade varchar(4));

Q6. Write a query to delete column Grade from table student.

Ans. Alter table Student drop Grade;

Q7. ___________Command is used to delete table completely/permanently.

Ans. Drop table

Q8. Write a query to delete the table "Emp" permanently.

Ans. Drop table Emp;

Q9. Delete from emp;

       The above command will delete all the records from table "emp". (True/False)

Ans. True

Q10. Write a query to display all the records from table "Student"

Ans. Select * from Student;

        

No comments:

Post a 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