How to use DESC command?

How to use DESC command?

Since in database we have tables, that’s why we use DESCRIBE or DESC(both are same) command to describe the structure of a table. Syntax: DESCRIBE one; OR DESC one; Note : We can use either DESCRIBE or DESC(both are Case Insensitive).

How to use the DESCRIBE command in SQL?

The DESCRIBE command enables you to describe objects recursively to the depth level set in the SET DESCRIBE command. You can also display the line number and indentation of the attribute or column name when an object contains multiple object types. For more information, see the SET command.

What means DESC in SQL?

descending order
The DESC command is used to sort the data returned in descending order.

Where does Desc go in SQL?

DESC means descending. if you have the letters A – Z in your database, and you sort them by ASC , it will go from A to Z . ORDER BY DESC will sort them from Z to A .

What is the ALTER TABLE command in SQL?

The SQL ALTER TABLE command is used to add, delete or modify columns in an existing table. You should also use the ALTER TABLE command to add and drop various constraints on an existing table.

How is the DESC command used in SQL?

DESC. The DESC command is used to sort the data returned in descending order. The following SQL statement selects all the columns from the “Customers” table, sorted descending by the “CustomerName” column:

How to add, drop, modify in SQL?

SQL | ALTER (ADD, DROP, MODIFY) 1 OUTPUT: 2 ROLL_NO. NAME AGE COURSE 1 Ram 2 Abhi 3 Rahul 4 Tanu. 3 ALTER TABLE Student MODIFY COURSE varchar (20); After running the above query maximum size of Course Column is reduced to 20 from 40. 4 ALTER TABLE Student DROP COLUMN COURSE; 5 OUTPUT:

How to reverse the descending order in SQL?

Here the records are returned in the order by class from A to Z . We can reverse the order by specifying in our sql command to change the order to Descending that is from Z to A. We have to add desc to the ORDER BY clause. Here is the command to do that SELECT * FROM `student` ORDER BY class desc Order by more than one column of a table