Skip to main content

Data retrieving using the SQL SELECT command.

Basic SELECT Statement

SELECT *|{[DISTINCT] column|expression [alias],...} FROM table;
SELECT identifies the columns to be displayed.
FROM identifies the table containing those columns.

Selecting All Columns 

SELECT * FROM departments;

Selecting Specific Columns 

SELECT department_id, location_id FROM departments;

Writing SQL Statements(Conventions)

  • SQL statements are not case-sensitive.
  • SQL statements can be entered on one or more lines.
  • Keywords cannot be abbreviated or split across lines.
  • Clauses are usually placed on separate lines.
  • Indents are used to enhance readability.
  • In SQL Developer, SQL statements can optionally be terminated by a semicolon (;).
  • Semicolons are required when you execute multiple SQL statements.
  • In SQL*Plus, you are required to end each SQL statement
    with a semicolon (;).

    Comments

    Popular posts from this blog

    Who is Peter Lynch and what is his philosophy in equity market investment? 25 Golden Rules of the most successful Fund Manager.

    Peter Lynch (born January 19, 1944) is an American investor, mutual fund manager, and philanthropist. As the manager of the Magellan Fund at Fidelity Investments between 1977 and 1990, Lynch averaged a 29.2% annual return, consistently more than doubling the S&P 500 stock market index and making it the best-performing mutual fund in the world. During his 13 year tenure, assets under management increased from $18 million to $14 billion. He also co-authored a number of books and papers on investing and coined a number of well known mantras of modern individual investing strategies, such as Invest in what you know and ten bagger. Lynch is consistently described as a "legend" by the financial media for his performance record. Base on his career I have compiled his investing rules here. 25 GOLDEN RULES by @Peter Lynch 1: Nobody can predict interest rates, the future direction of the economy or the stock market. Dismiss all such forecasts & concentrate on what's actual

    What is version checking in Hibernate ?

    Version checking used in hibernate when more then one thread trying to access same data. For example : User A edit the row of the TABLE for update ( In the User Interface changing data This is user thinking time) and in the same time User B edit the same record for update and click the update. Then User A click the Update and update done. Change made by user B is gone. In hibernate you can prevent slate object updation using version checking. Check the version of the row when you are updating the row. Get the version of the row when you are fetching the row of the TABLE for update. On the time of updation just fetch the version number and match with your version number (on the time of fetching).

    What are JEE Containers? What are their different types?

    Containers are the interface between a component and the low-level, platform-specific functionality that supports the component. Before it can be executed, a web, enterprise bean, or application client component must be assembled into a Java EE module and deployed into its container. The assembly process involves specifying container settings for each component in the Java EE application and for the Java EE application itself. Container settings customize the underlying support provided by the Java EE server, including such services as security, transaction management, Java Naming and Directory Interface (JNDI) API lookups, and remote connectivity. Here are some of the highlights. The Java EE security model lets you configure a web component or enterprise bean so that system resources are accessed only by authorized users. The Java EE transaction model lets you specify relationships among methods that make up a single transaction so that all methods in one transaction are treated as a