Share
, ,

SQL Statements: SELECT

  • To see your databases command-
    SHOW DATABASES
  • To see your tables in a database command-
    SHOW TABLES
  • To see all the column names in a table named customer command-
    SHOW COLUMNS FROM customers
  • If you want to select a column named city from the table customer then command-
    SELECT city FROM customers



Notice:
  1. SHOW: This statement is used to show anything from the database. If you want to see anything from the tables, columns or from anywhere then use this statement.
  2. FROM: You should use this statement whenever you want to see any sets of data from a specific row or column.
  3. SELECT: Use this statement to select any row or column form a specific table.
  4. Here for the tutorial purpose I have named my table as customer, column as city. Names here varies database to database. 
  5. Whenever you will input command then write the statements in capital letters and names in small letters.
                                
                                                 

0 comments:

Post a Comment