Rishi Raj has Published 119 Articles

How can we sort MySQL output in descending order?

Rishi Raj

Rishi Raj

Updated on 20-Jun-2020 06:25:46

212 Views

We need to specify DESC (short form for DESCENDING) keyword in ORDER BY clause if we want to sort out the result set in descending order.SyntaxSelect column1, column2, …, columN From table_name ORDER BY column1[column2, …] DESC;ExampleIn the following example, we have sorted the result set by column ‘Id’ in ... Read More

How can we automatically define the structure of MySQL table same as the structure of another table?

Rishi Raj

Rishi Raj

Updated on 20-Jun-2020 06:07:11

195 Views

CREATE TABLE command with LIKE keyword will be able to define the structure of a MySQL table same as the structure of another table.SyntaxCREATE TABLE new_table LIKE old_table;Examplemysql> Create table employee(ID INT PRIMARY KEY NOT NULL AUTO_INCREMENT, NAME VARCHAR(20)); Query OK, 0 rows affected (0.21 sec) mysql> Describe employee; ... Read More

How can we remove PRIMARY KEY constraint from a column of an existing MySQL table?

Rishi Raj

Rishi Raj

Updated on 19-Jun-2020 11:53:03

5K+ Views

We can remove PRIMARY KEY constraint from a column of an existing table by using DROP keyword along with ALTER TABLE statement.ExampleSuppose we have a table ‘Player’ having a PRIMARY KEY constraint on column ‘ID’ as follows −mysql> DESCRIBE Player; +-------+-------------+------+-----+---------+-------+ | Field | Type        | ... Read More

Which statement, other than ALTER TABLE statement, can be used to apply UNIQUE constraint to the field of an existing MySQL table?

Rishi Raj

Rishi Raj

Updated on 19-Jun-2020 11:48:53

122 Views

CREATE UNIQUE INDEX statement can also be used to apply the UNIQUE constraint to the field of an existing MySQL table. The syntax of it is as follows −CREATE UNIQUE INDEX index_name ON table_name(Column_name);ExampleSuppose we have the following table named ‘Test5’ and we want to add UNIQUE constraint to the ... Read More

Architecture of the Internet

Rishi Raj

Rishi Raj

Updated on 17-Jun-2020 13:24:14

35K+ Views

The architecture of the Internet is ever-changing due to continuous changes in the technologies as well as the nature of the service provided. The heterogeneity and vastness of the Internet make it difficult to describe every aspect of its architecture.The overall architecture can be described in three levels −Backbone ISP ... Read More

The Transport Layer in TCP/IP Model

Rishi Raj

Rishi Raj

Updated on 17-Jun-2020 12:56:19

12K+ Views

The transport layer is responsible for error-free, end-to-end delivery of data from the source host to the destination host. It corresponds to the transport layer of the OSI model.The functions of the transport layer are −It facilitates the communicating hosts to carry on a conversation.It provides an interface for the ... Read More

Local Area Networks

Rishi Raj

Rishi Raj

Updated on 17-Jun-2020 11:00:53

16K+ Views

A Local Area Network (LAN) is a private network that connects computers and devices within a limited area like a residence, an office, a building or a campus. On a small scale, LANs are used to connect personal computers to printers. However, LANs can also extend to a few kilometers ... Read More

Ternary Search

Rishi Raj

Rishi Raj

Updated on 15-Jun-2020 14:50:10

3K+ Views

Like the binary search, it also separates the lists into sub-lists. This procedure divides the list into three parts using two intermediate mid values. As the lists are divided into more subdivisions, so it reduces the time to search a key value.The complexity of Ternary Search TechniqueTime Complexity: O(log3 n)Space ... Read More

How to give a limit to the input field in HTML?

Rishi Raj

Rishi Raj

Updated on 15-Jun-2020 11:04:46

6K+ Views

The HTML tag is used to get user input in HTML. To give a limit to the input field, use the min and max attributes, which is to specify a maximum and minimum value for an input field respectively.The max and min attributes are used with number, range, date, datetime, datetime-local, ... Read More

Troubleshooting tips

Rishi Raj

Rishi Raj

Updated on 13-Jun-2020 13:30:56

882 Views

Following steps are mostly required to Troubleshoot any problem that occurred in production.As the first step, get the time frame from the user when a particular issue occurred. Get the logs for that particular time period.If logs are very large in size, use grep command to filter out errors.$ grep -o ... Read More

Advertisements