1
CREATE TABLE IF NOT EXISTS `product` (
  `maker` varchar(10) NOT NULL,
  `model` varchar(50) NOT NULL,
  `type` varchar(50) NOT NULL,
  PRIMARY KEY (`model`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

and

    CREATE TABLE IF NOT EXISTS `laptop` (
  `code` int(11) NOT NULL,
  `model` varchar(50) NOT NULL,
  `speed` smallint(6) NOT NULL,
  `ram` smallint(6) NOT NULL,
  `hd` double NOT NULL,
  `price` decimal(12,2) DEFAULT NULL,
  `screen` tinyint(4) NOT NULL,
  PRIMARY KEY (`code`),
  KEY `FK_Laptop_product` (`model`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

These are the two tables, now I have two queries-

SELECT * FROM `product` inner join laptop on product.model = laptop.model

and

select * from product, laptop where product.model = laptop.model

Both the queries gives same result, So is there any difference in two approaches. Please provide few good examples

Param Kumar
  • 123
  • 3
  • 18
Anjil Panchal
  • 834
  • 1
  • 8
  • 11

0 Answers0