Author: ShairyPortfolio

  • Stored Procedure in MySQL

    Stored Procedure in MySQL

    A Stored procedure is a collection of pre-compiled SQL statements stored inside the database. A procedure always contains a name, parameter lists, and SQL statements. Stored Procedure increases the performance of the applications. Once stored procedures are created, they are compiled and stored in the database and have the following advantages: Code reusability. Lesser Network…

  • Views in MySQL

    Views in MySQL

    Views are virtual tables that do not store their own data but display all or a few rows of data stored in other tables. View helps to simplify the complex business logic written in the SQL queries to simple one. Syntax CREATE VIEW `view_name` AS SELECT statement; Example create view enginnringStudent as select name, email…

  • MySQL SELF JOIN

    MySQL SELF JOIN

    A SELF JOIN is a join that is used to join a table with itself. However, there is a need to combine data with other data in the same table itself. In that case, we use Self Join. Syntax SELECT s1.col_name, s2.col_name…   FROM table1 s1, table1 s2   WHERE s1.common_col_name = s2.common_col_name; Example   SELECT  s1.rollno,s2.status FROM fees s1, fees s2  WHERE s1.status = s2.status;

  • MySQL CROSS JOIN

    MySQL CROSS JOIN

    Cross JOIN is a simplest form of JOINs which matches each row from one database table to all   rows of another. In other words, it gives us combinations of each row of first table with all records in second table. Syntax SELECT select_list FROM table_1 CROSS JOIN table_2; Example SELECT r.rollno, r.name, f.fees, f.status FROM…