Explain select command : Simple Select « Select Clause « SQL / MySQL






Explain select command

   
  
CREATE TABLE Manufacturers
(
   ManfID CHAR(8) NOT NULL PRIMARY KEY,
   ManfName VARCHAR(30) NOT NULL
)
ENGINE=INNODB;


INSERT INTO Manufacturers
VALUES ('abc123', 'ABCqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq'),
       ('def456', 'DEFwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww'),
       ('ghi789', 'GHIeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'),
       ('jkl123', 'JKLrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr'),
       ('mno456', 'MNOttttttttttttttttttttttttttttttttttttttttttttttttttttttt');


CREATE TABLE Parts
(
   PartID SMALLINT NOT NULL PRIMARY KEY,
   PartName VARCHAR(30) NOT NULL,
   ManfID CHAR(8) NOT NULL
)
ENGINE=INNODB;


INSERT INTO Parts
VALUES (101, 'DVD burnerrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr', 'abc123'),
       (102, 'CD driveeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee', 'jkl123'),
       (103, '80-GB hard diskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk', 'mno456'),
       (104, 'Mini-towerrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr', 'ghi789'),
       (105, 'Power supplyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy', 'def456'),
       (106, 'LCD monitorrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr', 'mno456'),
       (107, 'Zip driveeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee', 'ghi789'),
       (108, 'Floppy driveeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee', 'jkl123'),
       (109, 'Network adapterrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr', 'def456'),
       (110, 'Network hubbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb', 'jkl123'),
       (111, 'Routerrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr', 'mno456'),
       (112, 'Sound cardddddddddddddddddddddddddddddddddddd', 'ghi789'),
       (113, 'Standard keyboarddddddddddddddddddddddddddddd', 'mno456'),
       (114, 'PS/2 mouseeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee', 'jkl123'),
       (115, '56-K modemmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm', 'ghi789'),
       (116, 'Display adapterrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr', 'mno456'),
       (117, 'IDE controllerrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr', 'def456');


SELECT PartName, ManfName
FROM Parts AS p, Manufacturers as m
WHERE p.ManfID = m.ManfID
ORDER BY PartName;


EXPLAIN SELECT PartName, ManfName
FROM Parts AS p, Manufacturers as m
WHERE p.ManfID = m.ManfID
ORDER BY PartName;



           
         
    
    
  








Related examples in the same category

1.Get the number, name, and date of birth of each player resident in Stratford; sort the result in alphabetical
2.Do math calculation with select
3.SELECT statement includes three select list elements
4.Select rows
5.The expression in the select list subtracts the Reserved value from the total
6.Removing duplicates and selecting only the unique combinations of values in the specified columns
7.Display the names of only those authors whose surname starts with one of the letters L through Z:
8.Determines all employees whose names contain the sequence of letters er.
9.Use a wildcard (*) to return all the fields
10.Using mysql as a Calculator
11.Identifying What Values to Display
12.Using the aliases p1 and p2 to refer to the book table different ways