What is basic SELECT statement?

SELECT Statement A SELECT statement retrieves data from the database. With SELECT statement PROJECTION, SELECTION and JOIN can be performed on database tables. As data in relational database is stored in TABLES. TABLE has ROW and COLUMN structure. With SELECT statement all rows and all columns can be retrieved, this is known as PROJECTION. But, if rows and columns are retrieved on the basis of some condition, it is known as SELECTION. And suppose if some information is needed and that is stored in two or more different tables but are related, use JOINS to retrieve it from two or more tables. In SQL, basic SELECT statements are as follows: SELECT  * FROM  [ table_name ] ; SELECT   [ column1 ] ,  [ column2 ] ,  [ column3 ] ,   .....   FROM   [ table_name ] ; SELECT and FROM are known as clauses.  SELECT clause allows to specify columns to be selected from the database table.  FROM clause allows to specify table name that has those column to be s

What is database schema and database instance?

Database Schema

The description of the database is known as database schema. It is specified at the time of database designing. The data in a database changes frequently but database schema changes infrequently.

Following are the examples of schema:

Database Instance

The data stored in the database at a particular moment is known as database instance. It is also known as a database state or snapshot. Whenever data is inserted or updated in a database, database state changes.

Now, suppose at some moment of time an employee has following state or instance:

If because of annual increments in this employee's company, he get a raise of 20% in his salary. Then the new instance of this employee looks like below:


Popular posts from this blog

Define the terms: domain, tuple, attribute and relation

With the help of block diagram explain the architecture of a DBMS.

What are the different types of database users?