Posts

Showing posts with the label List

Featured Post

SQL Interview Success: Unlocking the Top 5 Frequently Asked Queries

Image
 Here are the five top commonly asked SQL queries in the interviews. These you can expect in Data Analyst, or, Data Engineer interviews. Top SQL Queries for Interviews 01. Joins The commonly asked question pertains to providing two tables, determining the number of rows that will return on various join types, and the resultant. Table1 -------- id ---- 1 1 2 3 Table2 -------- id ---- 1 3 1 NULL Output ------- Inner join --------------- 5 rows will return The result will be: =============== 1  1 1   1 1   1 1    1 3    3 02. Substring and Concat Here, we need to write an SQL query to make the upper case of the first letter and the small case of the remaining letter. Table1 ------ ename ===== raJu venKat kRIshna Solution: ========== SELECT CONCAT(UPPER(SUBSTRING(name, 1, 1)), LOWER(SUBSTRING(name, 2))) AS capitalized_name FROM Table1; 03. Case statement SQL Query ========= SELECT Code1, Code2,      CASE         WHEN Code1 = 'A' AND Code2 = 'AA' THEN "A" | "A

How to Find Max and Min Quickly in Python List

Image
Here's logic to find Max and Min values in a List. Without using built-in Max() and Min () functions you can find Max and Min values in a List. For that matter, you need to write a user-defined function. This post is all about how to write it and run. Finding Max and Min in List You can achieve this by writing a user-defined function. Here's useful logic and steps to write it precisely. IN THIS PAGE Write a Function Execute Function Get the result Write Function You can write an user-defined function to get MAX and MIN values. In this function, I am using the max(), min() built-in functions. The other variables you can use as you wish. Below is the my actual logic. Sample Code def findmaxmin (data): ax = max (data) by = min (data) return (x,y) data = ( 109 , 98 , 88 , 7 ) (maximum, minimum) = findmaxmin (data) print ( "Maximum Marks = " , maximum) print ( "Minimum Marks = " , minimum) Created a Script Using vim editor Here as the first step, I

6 Exclusive List and Tuple Differences in Python

Image
Here're the quick differences between Tuple and List in Python. These are helpful for interviews and your project. Tuple and List differences List Comma-separated elements inside a square bracket [] make a list. The elements are indexed, which starts from '0' These you need to enclose in a single quote and separate by a comma. It can contain another list, which is called a NESTED list. Use type() function to get the type of data it is. The list is mutable (you can change the data). The objects (elements) can be of different data types.  Here're  examples on the List. Tuple The elements comma-separated and enclosed in parenthesis ()  The elements are indexed, which starts from '0' It can have heterogeneous data (integer, float, string, list, etc.) It is immutable. So you can't change the elements. Use the type() function to get the type of data it is.  Here're  examples of Tuple. List Example #Illustration of creating a list  new_list=[1, 2, 3, 4]  print(

Top Data Science Tools Complete List

Image
Top data science tools and platform providers across the world. Useful information for data science and data analytics developers. 8 Top Data Analytics Tools List. Data Science is a combination of multiple skills. AI and Machine Learning are part of data science. You can create AI and Machine Learning products with data. Related Posts Top Skills You Need for Data Science Career Data Science Sample Project an Example