Question:medium

Amit wants to be familiar with SQL. One of his friends Anand suggests him to execute the following SQL commands:
(A) Create Table Student
(B) Use Database DB
(C) Select * from Student
(D) Insert into Student
In which order Amit needs to run the above commands?

Updated On: Jan 16, 2026
  • (A), (B), (C), (D)
  • (A), (B), (D), (C)
  • (B), (A), (D), (C)
  • (C), (B), (D), (A)
Show Solution

The Correct Option is C

Solution and Explanation

For the structured execution of SQL commands, Amit must adhere to a precise sequence. The outlined steps are as follows:

  1. Select Database DB: The initial step involves specifying the target database for operations using the command 'USE Database DB'. This action establishes the operational context for subsequent commands.
  2. Define Table Student: Subsequently, the table structure must be defined to house the data. This is accomplished via the 'CREATE TABLE Student' statement, which delineates the table's columns and their respective data types.
  3. Populate Table Student: With the table structure in place, data insertion is performed using 'INSERT INTO Student'. This command facilitates the population of the table with the intended data entries.
  4. Retrieve Data from Student: The final step is to extract the data from the table. The command 'SELECT * FROM Student' retrieves all records from the Student table, enabling a review of the inserted data.

Adherence to this execution order is imperative for the correct processing of SQL commands: (B), (A), (D), (C).

Was this answer helpful?
0