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

Home
SQL / MySQL
1.Aggregate Functions
2.Backup Load
3.Command MySQL
4.Cursor
5.Data Type
6.Database
7.Date Time
8.Engine
9.Event
10.Flow Control
11.FullText Search
12.Function
13.Geometric
14.I18N
15.Insert Delete Update
16.Join
17.Key
18.Math
19.Procedure Function
20.Regular Expression
21.Select Clause
22.String
23.Table Index
24.Transaction
25.Trigger
26.User Permission
27.View
28.Where Clause
29.XML
SQL / MySQL » Select Clause » Simple Select 
Explain select command
   
  
CREATE TABLE Manufacturers
(
   ManfID CHAR(8NOT NULL PRIMARY KEY,
   ManfName VARCHAR(30NOT 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(30NOT NULL,
   ManfID CHAR(8NOT 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/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
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.