- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Lakshmi Srinivas has Published 315 Articles
Lakshmi Srinivas
114 Views
MySQL SUBSTRING_INDEX() function will return the same string as output if the argument ‘count’ has the value greater than the total number of occurrences of delimiter. It can be demonstrated with the following example −mysql> Select SUBSTRING_INDEX('www.google.co.in', '.', 4); +-------------------------------------------+ | SUBSTRING_INDEX('www.google.co.in', '.', 4) | +-------------------------------------------+ | www.google.co.in ... Read More
Lakshmi Srinivas
418 Views
We can use both INSTR() function and LIKE operator to search or match a particular pattern and they return same result. It can be demonstrated from the following example of ‘Student’ table.ExampleSuppose we want to search name, which contains ‘av’ in it, from ‘Student’ table. We can use INSTR() function ... Read More
Lakshmi Srinivas
6K+ Views
We can use DELETE statement along with a WHERE clause, which identifies those multiple rows, to delete multiple rows from MySQL table.Examplemysql> Select * from names; +------+-----------+ | id | name | +------+-----------+ | 1 | Rahul | | 2 | Gaurav ... Read More
Lakshmi Srinivas
10K+ Views
Roots of a quadratic equation are determined by the following formula:$$x = \frac{-b\pm\sqrt[]{b^2-4ac}}{2a}$$To calculate the roots −Calculate the determinant value (b*b)-(4*a*c).If determinant is greater than 0 roots are [-b +squareroot(determinant)]/2*a and [-b -squareroot(determinant)]/2*a.If determinant is equal to 0 root value is (-b+Math.sqrt(d))/(2*a)Exampleimport java.util.Scanner; public class RootsOfQuadraticEquation { public static ... Read More
Lakshmi Srinivas
245 Views
When two tables are connected with Foreign key and data in the parent table is deleted, for which record exists in child table too, then followings are the ways to maintain data integrity −On Delete CascadeThis option will remove the record from child table too if that value of the ... Read More
Lakshmi Srinivas
6K+ Views
We can remove a NOT NULL constraint from a column of an existing table by using the ALTER TABLE statement.ExampleSuppose we have a table ‘test123’ having a NOT NULL constraint on column ‘ID’ as follows −mysql> DESCRIBE test123; +-------+---------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | ... Read More
Lakshmi Srinivas
959 Views
Calculating the area of a triangle is a formula that you can easily implement in python. If you have the base and height of the triangle, you can use the following code to get the area of the triangle, def get_area(base, height): return 0.5 * base * height print(get_area(10, ... Read More
Lakshmi Srinivas
309 Views
The sort method on lists in python uses the given class's gt and lt operators to compare. Most built in classes already has these operators implemented so it automatically gives you sorted list. You can use it as follows:words = ["Hello", "World", "Foo", "Bar", "Nope"] numbers = [100, 12, 52, ... Read More
Lakshmi Srinivas
581 Views
You will need to use a multiprocessing library. You will need to spawn a new process and provide the code to it as an argument. For example, from multiprocessing import Processdef loop_a(): for i in range(5): print("a") def loop_b(): for i in range(5): ... Read More
Lakshmi Srinivas
5K+ Views
Python provides two ways to write inline if statements. These are:1. if condition: statement2. s1 if condition else s2Note that second type of if cannot be used without an else. Now you can use these inline in a print statement as well. For example, a = True if a: print("Hello")This ... Read More
To Continue Learning Please Login
Login with Google