Skip to main contentSkip to solution

Arrange the following in order to create 'STUDENT' table in the "Attendance" database:

(A) mysql> USE Attendance;

(B) mysql> DESCRIBE STUDENT;

(C) mysql> CREATE DATABASE Attendance;

(D) mysql> CREATE TABLE STUDENT(RollNumber INT, SName VARCHAR(20), SDateofBirth DATE, GUID CHAR (12), PRIMARY KEY (RollNumber));

Solution

✅ Correct Option: 4

The database must exist before it can be used, and it must be selected before a table is created in it. The table must exist before it can be described.

C: create the database Attendance

A: select it with USE Attendance

D: create the STUDENT table inside it

B: view the table structure with DESCRIBE STUDENT


Options 1 and 3: DESCRIBE STUDENT (B) comes before the table is created, so it would give an error.

Option 2: USE Attendance (A) comes before the database is created, so it would give an error.

Keyboard Shortcuts

  • Left arrow: Previous question
  • Right arrow: Next question
  • S key: Jump to solution
  • Q key: Jump to question