Categories
MySQL

MySQL GROUP BY & HAVING clause

To group rows into subgroup by one or more values of columns we use MySQL GROUP BY. Suppose in user table same country name exists for many times for different user. So if we use GROUP BY for country column to a SELECT query then only unique country will be listed. EXAMPLE: SELECT * FROM […]

Categories
MySQL

MySQL CREATE TABLE

Using CREATE TABLE statement in MySQL you can create a table into the database. The following example shows the statement in the simple form: CREATE TABLE Format: CREATE TABLE IF NOT EXISTS `tbl` ( tbl_id int(11) NOT NULL AUTO_INCREMENT, tbl_title varchar(100) DEFAULT NULL, post_date DATE DEFAULT NULL, update_date DATE DEFAULT NULL, PRIMARY KEY (tbl_id) ) […]

Categories
MySQL

Intro: MySQL Stored Procedures

A segment of declarative SQL statements which is stored inside the database catalog is called stored procedures, invoked by a triggers. Advantages: When stored procedures are created it is compiled and stored in the database so that when it is called multiple times then the compiled version is used. It is very secure. It is […]

Categories
Html

Text Formatting

To format html text several elements are used. Now day we can do this by css style. But you can still use html element for formatting. Text Formatting types: <pre> Element:<pre>The quick brown fox jumps over the lazy dog</pre> <del> ElementThe quick brown fox <del>jumps</del> over the lazy dog <sup> Element<p> The quick brown fox […]

Categories
MySQL

MySQL temporary table

To store a temporary result set you can use a special type of table i.e. called MySQL temporary table. To keep temporary data, the temporary tables could be very useful in some cases. When the current client session terminates, the temporary tables is deleted. This is useful for stored procedures, join query etc. Temporary tables […]

Categories
MySQL

Mysql update fields with random sentence

Sometimes we need to add demo text in a website for checking whether it working fine or somewhere we test website with demo text. So on this case unwanted text inserted into database and you need to remove it. So, we can update fields with random sentence in this case. For example the fields value […]

Categories
Html

Div and span elements in HTML

For special formatting,  div and span elements are used. You need to add styles in css for proper formatting or looks and feel. The difference between <div> and <span> is <div> is displayed as a block and <span> is displayed as inline text. Example of div and span elements: The <div>quick brown</div> fox jumps over […]

Categories
MySQL

MySQL IN Operator

Using IN operator in MySQL you can match the value from a set of values or a subquery. Example of MySQL IN: SELECT * FROM user WHERE country IN (‘IN’,’AUS’); Here both the user from IN and AUS will be shown in the result. You can also check for exception like: SELECT * FROM user […]

Categories
Css Css3

em vs px

The most confusing part of CSS styling is that font-size attribute i.e. how this will show in various resolutions. em: This scalable unit is used in web document media due to scalability and their mobile-device-friendly environment. For instance one em is equal to current font-size i.e. if font-size of the document is 10pt then 1em […]

Categories
Html

Links in HTML

To create any links in HTML internal or external <a> element is used. Clicking on this link user goes to another page or another external url. Normal links looks like: <a href=”http://www.example.com”>Click here</a> You can parameters too: <a href=”http://www.example.com?param1=100&param2=200″>Click here</a> Note to remember that parameters are separated by (&) after each parameter value. To open […]