Computer Science, asked by avsrikanth015, 7 months ago

Kamal is student of class 11, he wanted to create a data base named SCHOOL and table name
STUDEND_INFO help him with SQL commands to do the following actions.
(i) To Create and activate the database. (1)
(ii) Suggest five attributes for STUDEND_INFO table with data type. (1)
(iii) Name the primary key for the table with reason for your choice. (1)
(iv) To view the description of the table STUDEND_INFO (½)
(v) To view all the tables created in the database. (½)
(vi) To remove the created table STUDEND_INFO first and then the database SCHOOL.

Answers

Answered by Equestriadash
8

(i) To create and activate the database.

Create database SCHOOL;

Use SCHOOL;

(ii) Suggest five attributes for STUDENT_INFO table with its data types.

  • Roll Number, data type - int
  • Name, data type - varchar
  • Class, data type - char
  • Date Of Birth, data type - date
  • Marks, data type - int

(iii) Name the primary key for the table with the reason for your choice.

The primary key would be Roll Number since no two students can have the same roll number.

(iv) To view the description of the table STUDENT_INFO.

  • Desc STUDENT_INFO;

or

  • Describe STUDENT_INFO;

(v) To view all the tables created in the database.

Show tables;

(vi) To remove the created table STUDENT_INFO first and then the database SCHOOL.

Delete from STUDENT_INFO;

Drop database SCHOOL;

Similar questions