Categories
MySQL

MySQL Views

A database view is a virtual table which is defined as a SQL select query with JOIN statement. Same as database table it consists of rows and columns. When any data of a tables changes, the corresponding view reflects that changes as well. Advantages: A database view allows you to simplify complex queries. You do […]

Categories
MySQL

Use DISTINCT to eliminate duplicate rows

In a table there may be data available i.e. duplicate. Each time you querying and get all the duplicate data. Use DISTINCT to avoid it. Suppose in a coountry table there are two same country name the using DISTINCT you will get the only one name for each country. SELECT DISTINCT country_name FROM table_country;

Categories
AngularJS

AngularJS Forms & Validation

Using AngularJS Forms you can collect number of inputs. Form can also validate input data. For any type of invalid input it can throw error for notify user. But note to remember that this is just a client side validation. You need to validate from server side also. Here is a sample code for AngularJS […]

Categories
MySQL

Referential integrity

It is relational database concept in which multiple tables shares consistent relationship based on the data stored on tables. For example, a school X has 2 tables, a student table, and a student fee table. In the student table we have 2 columns – the student ID and the student name. In the student fee […]

Categories
MySQL

MySQL UPDATE Statement

Using MySQL UPDATE statement you can update existing data in a table. it can be a single column or multiple rows. Here is a simple example of MySQL UPDATE: UPDATE users SET user_address = ‘Kolkata, India’, user_state = ‘WB’ WHERE user_id = 247 You can also update fields depends on JOIN query on two or […]

Categories
MySQL

MySQL Storage Engines

When you create a database you have to choose the storage engine for storing data into the database. MySQL supports various types of storage engines i.e. MyISAM, InnoDB, MERGE, MEMORY (HEAP), ARCHIVE, CSV, FEDERATED. Each storage engines has different performance of the database and has advantages or disadvantages. Here is the list of MySQL Storage […]

Categories
MySQL

Primary Key, Unique Key, Key, Foreign Key

A primary key is a column or multiple columns that uniquely identify each row in a table.Basic key of primary key:– This must contain unique values– For multiple columns, the combination of values must be unique– Primary key is not null– Only one primary key will be present in a table As MySQL works faster […]

Categories
Html

HTML Forms

By using html forms we get input data from the user. For example registration form, contact us feedback etc. Html forms are enclosed between form element like below:<form></form> There are numerous form fields that can be use in forms: -Text field-Text area-Checkbox-Radio buttons-Select box-File field-Button-Image button-Submit button GET and POST:Form method can be two types […]

Categories
MySQL

Filter Rows Using WHERE Statement

In SELECT statement you can filter with condition to get actual result. Using WHERE clause you will get the data from the table that you exactly need. Here is sample sql for Filter Rows: SELECT name, address FROM users WHERE state = ‘AL’;

Categories
MySQL

MySQL UNION Operator

Using MySQL UNION Operator you can combine two or more result set from a multiple table into a single result set. UNION operator eliminates duplicate rows from the result set even you forgot to use DISTINCT operator. UNION ALL allows duplicate rows remain in the result. In the corresponding SELECT statements the number of columns […]