Posts

Showing posts with the label SQL

SQL Join Queries Tutorial

Image
  Joining tables in SQL MySQL JOINS: In this tutorial, you are going to learn how to use different types of  joins on tables. Below you will find different types of join queries with examples. Types of JOINS in SQL INNER JOIN   OUTER JOIN   LEFT OUTER JOIN RIGHT OUTER JOIN SELF JOIN         INNER JOIN –  Returns only all common rows from both the tables     TOC     Create following tables in order to test the query        Use the queries below to create tables in MySQL:   Query -T1   -- -- Table structure for table `t1` -- CREATE TABLE IF NOT EXISTS `t1` ( `sno` int ( 11 ) NOT NULL AUTO_INCREMENT, `sname` varchar ( 30 ) NOT NULL , PRIMARY KEY (`sno`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT= 4 ; -- -- Dumping data for table `t1` -- INSERT INTO `t1` (`sno`, `sname`) VALUES ( 1 , 'AAA' ), ( 2 , 'BBB' ), ( 3 , 'CCC' );     Query -T2...

Working with phpmyadmin tool

Image
Working with PhpMyAdmin in XAMPP What is PhpMyAdmin in PHP PhpMyAdmin is a GUI(Graphical User Interface) tool for MySQL Database. This is bundled with Xampp, no need to install separately. Why we Use it  Database management. Tables structure management     How to Open PhpMyAdmin First open XMPP control panel Start Apache server next Start the MySQL server and click on the admin button of MySQL server. Or you can open with the link: http://localhost/phpmyadmin/ Creating Databases Click on Databases Tab  In create database box, enter the name of the database and click create button         Creating Table Click on Database " usersdb". In the bottom in create table box, enter table name and number of columns and click on Go. In the next window provide all the field names, field datatype, field size and click on Save. Specifying Field names, Data Types and sizes For table register field details are as given below   id      ...

Learn SQL Queries Part2

Image
    Learn SQL Queries using  MySQL Database Part-2 ←Part-1 In a previous blog, we have gone through the introduction of RDBMS and SQL Language . This article lets you know how to work with databases using different types of  SQL Queries.  As  we discussed  earlier, SQL Queries are grouped into 3 categories. In this tutorial, we are going to learn each of them in detail.    Table of contents  DDL Queries   CREATE     ALTER   DROP  DML Queries   SELECT Statement    INSERT Statement   UPDATE Statement   DELETE Statement  DCL Queries   GRANT  REVOKE   1. DDL Queries   TopMenu 1. Creating command:  Used to create database and tables   CREATE Database < Database - name > CREATE Database SampleDB syntax:     CREATE TABLE < Table - name > ( col1 data_type (size), col2 data_type (size), col3 data_type (size) ); example: ...