Categories
Html

HTML Tables

In html there are set of elements that are needed to create tables. Table can be created using <table> element.Each row of a tables are defines via <tr> element and each cell are defines via <td> element within <tr> element. So a basic structure of a table looks like: <table> <tr> <td>Cell</td> <td>Cell</td> </tr> <tr> […]

Categories
Css Css3

Knowing !important

Using !important rules can be a dangerous way to style your webpage that usually means you are forcefully doing this, but they exist for some reason. The paragraph will be colored red, even there is a ID selector that has higher priority. So, the this rule overrides all the particular property. An !important rule works […]

Categories
MySQL

MySQL ALTER TABLE, DROP TABLE

To change the structure of a table you use ALTER TABLE statement. This allows you to add or drop column, change data type, rename table etc. Example of ALTER TABLE: ALTER TABLE table_name CHANGE COLUMN table_id table_id INT(11) NOT NULL AUTO_INCREMENT; To remove existing table you need to use DROP TABLE statement as below: Example […]

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

Data Types – MySQL

MySQL supports different data types while creating columns i.e. what type of value is using for the column or fixed/variable length etc. It has different types of data types i.e. Numeric: TINYINT, SMALLINT, MEDIUMINT, INT, BIGINT, DECIMAL, FLOAT, DOUBLE, BIT String: CHAR, VARCHAR, BINARY, VARBINARY, TINYBLOB, BLOB, MEDIUMBLOB, LONGBLOB, TINYTEXT, TEXT, MEDIUMTEXT, LONGTEXT, ENUM, SET […]

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

Understanding MySQL LEFT JOIN

MySQL LEFT JOIN allows you to get result set from two or more tables for certain matches. Suppose you have two tables i.e. A and B. So if you join A to B using left join then all rows from the A tables will be displayed with matches a row from the B table. Example […]

Categories
Css Css3

Difference between @import and link

Using both @import and link tag you can include style sheet in a webpage. But there is a difference. For performance “link” has a much better advantage. Example of @import and link: <link href=”style.css” type=”text/css” /> <style type=”text/css”> @import url(“style.css”); </style> As @import allows you to import one style sheet into another but older browsers […]

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 […]