Posts From askiguru

How to create Views in SQL?

A virtual table is known as view. A view contains rows and columns, just like an actual table. The fields in a view are fields from one or more real tables in the database. To present the data as if the data is coming from a single table, SQL functions like WHERE and JOIN statements can be added. Views are created using the CREATE VIEW statement. Views can be created from a

How to insert data in tables using SQL?

To insert records into the table using MySQL, INSERT INTO statement is used. What is MySQL insert? In order to enter or insert information into the MySql table, MySQL Insert is used. To do so, one has to create a table with column(s) of the same type as that of the content one would like to insert. Thus, one cannot insert word articles in a column which accepts only integers. How to Add Data

What is a Distinct Keyword in SQL?

There may be duplicate values or records in a table. In order to eliminate those duplicate values and if you want to fetch or view only the unique (distinct) values, the SQL DISTINCT keyword is used in combination with SELECT statement. The Distinct keyword will return only the on-duplicate or different values. The syntax is as follows: Select Distinct column_name1, column_name2, …., column_namen From (table_name); Example: Consider the Students table having the