Posts

MySQL Tutorial Part 1

Image
MYSQL: MySQL is a very popular open-source relational database management system. It is very easy to use. MySQL is one of the most straightforward database technology to learn and use. To add, access, and process data stored in a database. SQL: SQL stands for Structured Query Language SQL is used to communicate with the database. SQL lets you access and manipulate databases SQL keywords are NOT case sensitive: select is the same as SELECT SQL VS MYSQL: SQL MYSQL SQL is a query programming language that manages RDBMS. MySQL is a relational database management system that uses SQL. SQL is primarily used to query and operate database systems. MySQL allows you to handle, store, modify and delete data and store data in an organized way. RDBMS: RDBMS stands for Relational Database Management System. RDBMS is a program used to maintain a relational ...

Swap Program with temporary variable using JAVA

Image
WHAT IS SWAP: Swapping is the process of changing the values of two variables.  Able to change the values of two variables in different ways. SWAP PROGRAM WITH TEMPORARY VARIABLE USING JAVA:      Swap the values of two variables with the use of the temporary variable.       In the above image, we have two boxes. The first box has a red ball and the second box has a green ball. We have to exchange the balls in the two boxes.      Using a temporary box, we have to swap the balls in the boxes. PROGRAM: import java.lang.*; class Swap { public static void main(String args[]) { int a = 10, b=20, temp; System.out.println("Before Swapping: a = " + a + " b = " + b); temp = a; a = b; b = temp; System.out.println("After Swapping: a = " + a + " b = " + b); } } Output:                                           ...

Pandas DataFrame empty

Image
HOW TO CHECK IF THE DATAFRAME IS EMPTY OR NOT? Check if the DataFrame is empty or not by using the  DataFrame.empty .  It returns the Boolean value. If the DataFrame is empty, then it returns True . If the DataFrame is not empty, then it returns False . CREATE A EMPTY DATAFRAME: Create an empty dataframe and will check if it is empty or not by using the property DataFrame.empty If it is empty, then it returns True. import  pandas as pd  empty_dataframe = pd.DataFrame() if empty_dataframe.empty:       print ('True') CREATE A NON-EMPTY DATAFRAME: Create a non-empty dataframe and will check if the dataframe is empty or not.  If it is not empty, then it returns False. import  pandas as pd  pd_dataframe= pd.DataFrame( [['Vetri',20],['Vishal',21],['Jack',18]],   columns=['Name', 'Age'] ) if  pd_dataframe .empty is False:      print ('False') Thanks for choosing our blog 😊. 

MySQL Interview Questions Part - 1

Image
MYSQL INTERVIEW QUESTIONS  1) What is MySQL? MySQL is a very popular open-source relational database management system. To add, access, and process data stored in a database. 2) Difference between SQL and MySQL SQL MYSQL SQL is a query programming language that manages RDBMS. MySQL is a relational database management system that uses SQL. SQL is primarily used to query and operate database systems. MySQL allows you to handle, store, modify and delete data and store data in an organized way. 3) Features of MySQL Easy to use Secure Open source 4) Default port number of MySQL?          The   MySQL Server's default port is 3306 5) What is Primary key? The PRIMARY KEY constraint uniquely identifies each record in a table. Primary keys must contain UNIQUE values, and cannot contain NULL values. A table can have only ONE primary key. 6) What is Foreign key? It is like a child table. It refers only to primary key column values from another table.  ...

Pandas DataFrame

Image
DATAFRAME: DataFrame is a two-dimensional array.  It's like a table with rows and columns. WAYS TO CREATE A DATAFRAME: DataFrame using list DataFrame using dictionary DataFrame using series DATAFRAME USING LIST:      Creating a dataframe with the list values.      Example 1:  import  pandas as pd  list_data  = ['pandas', 'numpy', 'pytest', 'pywin32'] result = pd.DataFrame( list_data ) print (result)                Example 2:  import   pandas as pd  list_data   = [['Vetri',20],['Vishal',21],['Jack',18]] result = pd.DataFrame( list_data , columns=['Name', 'Age'] ) print (result)         DATAFRAME USING DICT OF ARRAY/LIST:     Creating a dataframe with the dict of array/list values.      Example:     import  pandas as pd  data  = {'Name': ['Vetri', 'Vishal', 'Jack', 'Ram'...

Pandas Data Structure

Image
  DATA STRUCTURES IN PANDAS:      One of the most important things in Pandas is Data Structure.      Pandas have three data structures: Series DataFrame Panel SERIES: Series is a one-dimensional array. It holds any type of data.  WAYS TO CREATE A SERIES: Series using list Series using array Series using dictionary SERIES USING LIST:      Creating a series with the list values.      Example:     import pandas as pd  list_data = ['pandas', 'numpy', 'pytest', 'pywin32'] result = pd.Series( list_data ) print (result)         SERIES USING ARRAY:      Creating a series with the array values.      Example:     import  pandas as pd  import numpy as np array_data  =  np. array (['pandas', 'numpy', 'pytest', 'pywin32']) result = pd.Series( array_data ) print (result)         SERIES USI...

Introduction to Pandas in Python

Image
  WHAT IS PANDAS? Pandas is an Open Source Python package . It used to work with data sets. Mostly used for Data Analysis and Machine Learning tasks. The name Pandas have derived from the word '' Panel Data " which means Econometrics from multidimensional data.  The name Pandas is also a reference to " Python Data Analysis " Pandas is developed by Wes McKinney  in 2008 . FEATURES: High-Performance Data Analysis Tool. Works with large data sets easily. Support or load files with different formats. Represents the data in Tabular format [Rows and Columns]. Works on missing data. Indexing - Slicing - Subsetting the large data sets. Merge and Join the two different data sets easily. Pivoting and Reshaping data sets. BENEFITS: Data Representation. Shorten the procedure of handling data. Efficiently handle large data. More flexible and customizable. An extensive set of features. Thanks for choosing our blog 😊. 

Student database using MySQL Part 1

Image
MYSQL EXAMPLE     Will practice with an example. Will have an example for the Student database. CREATE DATABASE:     Create a database to store the tables.       Will create a Student database to store the details about the Students.           CREATE DATABASE Students; SHOW DATABASE:      The  SHOW DATABASES  statement lists all the databases. USE DATABASE:      The USE DATABASE statement is used to choose the database as a current database.      USE Students;      This statement makes the Student database a current database. CREATE TABLE: Create a new table in the Students Database.  Create department and Student tables.  The id column should be NOT NULL and AUTO_INCREMENT. And it is a Primary key. In the department table, the id column is the Foreign key for the Student table.           CREATE TABLE D...