Which command is used to select distinct subject (SUB. from the table (BOOK)?

  • SELECT ALL FROM BOOK
  • SELECT DISTINCT SUB FROM BOOK
  • SELECT SUB FROM BOOK
  • All of the above
...

SELECT DISTINCT SUB FROM BOOK

To retrieve distinct values from a table in SQL, use the SELECT DISTINCT command. As for the syntax:

SELECT DISTINCT column_name(s) FROM table_name;

The command "SELECT DISTINCT SUB FROM BOOK" will, in this case, provide a list of all distinct values for the "SUB" column in the "BOOK" table. The "DISTINCT" keyword makes sure that no duplicate values are returned. When you don't want duplicate records in your results, this can be helpful.

0 Answered this Question:

Unleash Your Voice, Share Your Thoughts: Join the Question-Answering Revolution