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 s

Differentiate between DDL and DML

DDL 

DDL stands for Data Definition Language. DDL comprises of statements that are used to define the database structure or database schema.

Following are DDL statements:

CREATE - Statement used for creating database objects like TABLE, VIEW etc.

ALTER - Statement used for modifying database structure.

DROP - Statement used for deleting database objects.

TRUNCATE - Statement for removing all records from a table and free the allocated space.

RENAME - Statement for renaming database object.



DML

DML stands for Data Manipulation Language. DML comprises of statements for managing data within the database.

Following are DML statements:

SELECT - Statement used to retrieve data from the TABLE.

INSERT - Statement used to insert/push data in the TABLE.

UPDATE - Statement used to update the existing data in the TABLE.

DELETE - Statement used to delete data from the TABLE. 




Comments

Post a Comment

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?

Define the terms: domain, tuple, attribute and relation