Posts

Showing posts from January, 2023

Introduction to Java

Image
JAVA      James Gosling Invented Java in 1991 and it is developed by Sun Microsystems. But the first version was released in 1995. The current version of Java is Java 17.  Java is an Object Oriented Programming language and it is platform-independent ( Write once and run anywhere ).  Java is easy to compile, and debug and it provides reusability of code that makes development faster.  The following four are important to run, compile and debug the Java application   JDK - Java Development Kit   JRE - Java Runtime Environment  JVM - Java Virtual Machine  Compiler - Java Compiler.    JDK           It is used to provide tools to develop Java applications it comes with Compiler, JRE, and JVM.  COMPILER  Java is the compiler used for compilation.  The compiler will check the program syntax and if it is wrong then throw the error at compile time.   If we don't hav...

MYSQL Tutorial Part 7

Image
  JOINS:     A JOIN clause is used to combine rows from two or more tables, based on a related column between them. INNER JOIN:  Returns records that have matching values in both tables. SELECT column_names FROM table1 INNER JOIN table2 ON table1.column_name = table2.column_name; LEFT JOIN:  Returns all records from the left table, and the matched records from the right table. SELECT column_names FROM table1 LEFT JOIN table2 ON table1.column_name = table2.column_name; RIGHT  JOIN:  Returns all records from the right table and the matched records from the left table. SELECT column_names FROM table1 RIGHT JOIN table2 ON table1.column_name = table2.column_name; CROSS JOIN:  Returns all records from both tables. SELECT column_names FROM table1 CROSS JOIN table2;      Example           SELECT Students.name, Departments.DeptHOD, Departments.name FROM Students INNER      JOIN Departm...

MYSQL Tutorial Part 4

MYSQL CONDITIONS      In this part, will learn about MySQL conditions. Using some operators will filter records from the database table. AND, OR, NOT OPERATORS:      The WHERE clause can be combined with AND, OR, and NOT operators.      The AND and OR operators are used to filter records based on more than one condition: • The AND operator displays a record if  all   the conditions separated by AND are TRUE. • The OR operator displays a record if  any  of the conditions separated by OR is TRUE. • The NOT operator displays a record if the condition(s) is NOT TRUE.      AND Syntax           SELECT * FROM table_name WHERE condition1 AND condition2;      Example:           SELECT * FROM Students WHERE department='ECE' AND district='Thanjavur';      OR Syntax           SELECT * FROM...

MYSQL Tutorial Part 5

Image
  CONSTRAINTS:      SQL constraints are used to specify rules for data in a table. CREATE CONSTRAINTS:      Constraints can be specified when the table is created with the CREATE TABLE statement, or after the table is created with the ALTER TABLE statement.      Syntax           CREATE TABLE table_name ( column1 datatype constraint,column2 datatype constraint);      The following constraints are commonly used in SQL: •  NOT NULL  - Ensures that a column cannot have a NULL value •  UNIQUE  - Ensures that all values in a column are different •  PRIMARY KEY  - A combination of a NOT NULL and UNIQUE. Uniquely identifies each row in a table •  FOREIGN KEY  - A key in one table, that refers to the primary key of another table. •  CHECK  - Ensures that the values in a column satisfy a specific condition •  DEFAULT ...

MYSQL Tutorial Part 6

Image
 MYSQL CLAUSE     In this part, will discuss the MySQL clause. Will learn how to filter particular records from the database table. WHERE  CLAUSE :           The WHERE clause is used to filter records.           Syntax                SELECT * FROM table_name WHERE condition;           Example:                SELECT * FROM Students WHERE department = 'CSE'; ORDER BY: The ORDER BY keyword is used to sort the result-set in ascending or descending order. The ORDER BY keyword sorts the records in ascending order by default. To sort the records in descending order, use the DESC keyword.        ORDER BY Syntax                SELECT* FROM table_name ORDER BY column1, column2 ASC|DESC;      Example:   ...

MYSQL Tutorial Part 3

Image
  AGGREGATE FUNCTIONS          Aggregate functions are used to collect the values from multiple rows as input and perform some calculations. It returns a single value. TYPES OF AGGREGATE FUNCTIONS: count sum avg max min COUNT(): The COUNT() function counts the number of rows that matches a specified criterion. It returns the total number of records. It works for both numeric and non-numeric data types.      Syntax           SELECT COUNT(column_name) FROM table_name WHERE condition;     Example           SELECT COUNT(department) FROM Student WHERE department = 'CSE'; SUM(): The SUM() function returns the sum of all the values in the selected column. It works for numeric data types only.      Syntax           SELECT SUM(column_name) FROM table_name WHERE condition;      Example        ...

MYSQL Tutorial Part 2

Image
     In this part, will learn how to create, use and delete databases and tables with syntax and examples.  DATABASE:  Database is a collection of data in a structured format.  Organize the data as a table, row, column, and index.  It is used to work with a large amount of information by storing, retrieving, and manipulating data. CREATE DATABASE:      The CREATE DATABASE statement is used to create a new SQL database.      Syntax         CREATE DATABASE databasename;     Example           CREATE DATABASE Students; RENAME DATABASE:      The RENAME DATABASE statement is used to rename the existing SQL database.      Syntax           RENAME DATABASE old_databasename TO new_databasename;      Example           RENAME DATABASE OldStudents TO S...

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 ...