What is basic SELECT statement?

Image
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 selected.
Semicolon at the end of SELECT statement specify the end of SQL statemen…

How database approach is different from traditional file systems?

 

Database Systems

File Systems


Database systems defines the database, storage structure, relation between data and constraints. It is defined as interrelated data and programs to access that data.

File management system defines the management of storage, retrieval and modification of set of files. This can be done by different application programs.
Database systems control redundancy and avoid inconsistency because of central storage mechanism. No chance of creating multiple copies of same data at multiple locations.
File processing systems do not offer central control. Not able to reduce redundancy. Increases data inconsistency. There are high chances of creating multiple copies of same data at multiple files stored at different locations.

Highly secured as it provides user profile management, roles and privileges for access control.
Not secured and does not provide any inbuilt user profile management. Also, does not have any role and access control mechanism.

These are expensive in terms of complex designing and complex structures.

These are cheaper because of simple designing and simple structure.
Provide integrity constraints and ensure correctness of stored data.
Does not provide any integrity constraints and does not ensure accurate data.

Data is shared.
Data is isolated.

It provides efficient backup and restore mechanism.
Backup is just simply making a copy of files at different locations. Which again creates confusions and increase redundancy and inconsistency.

It provides query language for interacting and accessing data.
Does not support any query language. Instead of query, end user need to scan the file for accessing data.

Comments

Popular posts from this blog

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

What do you mean by data model? What are different types of data models?

What are the different types of database users?