Tutorialspoint

Ways to sort list of dictionaries by values in Python

Samual Sam
Answered on 20th Nov, 2018

Here one dictionary is given, our task is to sort by their values. Two values are present in this dictionary one is name and another is roll. First we display sorted list by their roll using lambda function and in-built sorted function. Second we display sorted list by the name ... Read More

Usage of backtick in SQL statements?

George John
Answered on 20th Nov, 2018

The backtick can be used in MySQL. To create a table, we can put table_name in backticks. Example of Backtick in MySQL. The CREATE command is used to create a table. Here, we have added the table name using the backtick symbol. mysql> create table `backtickSymbol` ... Read More

Matrix manipulation in Python

karthikeya Boyini
Answered on 20th Nov, 2018

In Python we can solve the different matrix manipulations and operations. Numpy Module provides different methods for matrix operations. add() − add elements of two matrices. subtract() − subtract elements of two matrices. divide() − divide elements of two matrices. multiply() − multiply elements of two matrices. dot() − It ... Read More

Sorting varchar field numerically in MySQL?

Ankith Reddy
Answered on 20th Nov, 2018

‘LPAD(lower(column_name))’ is used to sort the varchar field numerically in MySQL. Let us see an example. Firstly, we will create a table. The CREATE command is used to create a table. mysql> create table SortingvarcharDemo -> ( -> List varchar(10) ... Read More

Underscore(_) in Python

Samual Sam
Answered on 20th Nov, 2018

In Python in some cases we use Single Underscore(_) and some cases we use Double Underscores (__). In Python has following cases, where we use underscore. If we want to store the value of last expression in interpreter. If we want to ignore some values. For declaration of ... Read More

How to check similarity between two strings in MySQL?

Maheshwari Thakur
Answered on 20th Nov, 2018

Similarity between two strings can be checked with the help of ‘strcmp()’ function. Here are the conditions. If both strings are equal, then it returns 0. If first string is less than the second string, it returns -1. If first string is greater than the second string, it returns ... Read More

In-built Data Structures in Python

karthikeya Boyini
Answered on 20th Nov, 2018

Python has some simple built-in types, e.g. int, float, complex, str, bool. It has also some complex built-in types, e.g. List, Dict, Tuple, Set. List − List is one of the data types in Python. List is a collection of objects, it is ordered and mutable. In Python it is ... Read More

Is it possible to use UPDATE query with LIMIT in MySQL?

Chandu yadav
Answered on 20th Nov, 2018

Yes, it is possible to use UPDATE query with LIMIT in MySQL. Let us see how. For our example, we will first create a table. The CREATE command is used to create a table. mysql>CREATE table tblUpdateLimit -> ( -> id int, ... Read More

Different Methods to find Prime Number in Python

Samual Sam
Answered on 20th Nov, 2018

First we need to know what a prime number is. A prime number always a positive integer number and divisible by exactly 2 integers (1 and the number itself), 1 is not a prime number. Now we shall discuss some methods to find Prime Number. Method1 Using For loops Example ... Read More

How to change MySQL timezone?

George John
Answered on 20th Nov, 2018

To change the timezone in MySQL, we can use the SET command. The following is the syntax. SET time_zone=’someValue’; Let us now use the above syntax and apply it in the below query. mysql > SET time_zone = '+8:00'; Query OK, 0 rows affected (0.00 sec) ... Read More

Page Rank Algorithm and Implementation using Python

karthikeya Boyini
Answered on 20th Nov, 2018

The PageRank algorithm is applicable in web pages. Web page is a directed graph, we know that the two components of Directed graphsare -nodes and connections. The pages are nodes and hyperlinks are the connections, the connection between two nodes. We can find out the importance of each page by ... Read More

How to add super privileges to MySQL database?

Ankith Reddy
Answered on 20th Nov, 2018

Firstly, check the MySQL database with DESC command. mysql>DESC mysql.db; The following is the output. +-----------------------+---------------+------+-----+---------+-------+ | Field | Type | Null ... Read More

Binary to decimal and vice-versa in Python

Samual Sam
Answered on 20th Nov, 2018

Given Decimal number and Binary number, our task is to convert Decimal to Binary numbers and Binary to Decimal numbers. Algorithm Bintodec() Step1: Enter binary number. Step2: Next take the length of the binary number. Step3: Using for loop we convert binary to a decimal number. ... Read More

MySQL pagination without double-querying?

Maheshwari Thakur
Answered on 20th Nov, 2018

To work with MySQL pagination, firstly let us see how to use CREATE command and use it to create a table. mysql>CREATE table RowCountDemo -> ( -> ID int, -> Name varchar(100) -> ); Query OK, 0 ... Read More

How to raise an error within MySQL?

Chandu yadav
Answered on 20th Nov, 2018

MySQL has introduced signals similar to an exception in other languages. Let us first see the syntax of signal. SIGNAL SQLSTATE ' PredefinedValueforSignalError' SET MESSAGE_TEXT = 'AnyMessageInformation'; Above, we have set our own error message text as well. We will apply the above query to get an ... Read More

Advertisements
Loading...
Unanswered Questions View All

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.