Showing posts with label MySQL. Show all posts
Showing posts with label MySQL. Show all posts

Friday, January 29, 2016

AUTO INCREMENT IN SQL: How to Set Your Primary Key To Auto Increment

I often used an auto increment primary key in creating my table due to unavailable candidate for a primary key. With the use of the use of t...

SQL SERVER MAX: Display the Maximum Number in Column

SQL Max  is used to find the maximum value in a certain column in a table. In my example, I have the SALES table below with records. Syntax ...

Thursday, January 28, 2016

SQL QUERY WILDCARD: Display Values Based on a String Pattern Using SQL Query Like and SQL Query Wildcard

We often search to find a certain data easily in our database. Such as searching for a friends name in facebook. And perhaps, searching for ...

SQL SELECT DISTINCT AND GROUP BY: Select Distinct Values in SQL and Group By

Select  is used to display all columns from a table. This includes records with redundancies. So if you want to display records without redu...

Sunday, January 24, 2016

SQL SELECT GROUP BY: Display Sum of a Certain Column With Select Group By

On my previous post, we used the SUM function to calculate the TotalSales in a store. What if we want to display the TotalSales by PRODUCT...

AVERAGE IN SQL: Display The Average of A Column From Database

Another arithmetic function in SQL is the AVERAGE function used to solve for the average of a specified column in your table. I have two (2...

SQL COUNT *: Count The Number of Rows in a Certain Table

Another arithmetic function other than SUM is COUNT . The purpose of COUNT is to return the number of rows found in a certain column. For ex...

SUM IN SQL: Solve For The Sum of A Column From Database

Instead of solving for the sum of a certain column using PHP or other programming language, you can achieve it by using the SQL SUM function...

Friday, January 22, 2016

PHP MYSQL: Display Data in Tables From Database

STUDENT First you construct  your HTML code and insert the following code between your body code. HTML, PHP and MySQL Code <table>  ...

PHP MYSQL: Search Multiple Columns Using Like

I had encountered searching multiple columns using a single input control, a textbox. That is searching from a last name and first name colu...

PHP MYSQL: Display Data in Combobox

Hi there! Today I am going to create a database-driven combobox/dropdown menu. I will display all records from the CATEGORY table into a com...

Thursday, January 21, 2016

PHP INSERT INTO: Add New Record Into A Database

Data is essential in an organization. So storing it in a database helps an organization to easily store it so they can retrieve it in the ne...

PHP ARRAYS: How To Save Multiple Arrays in Database

I have encountered saving a single array from a checkbox into the database. But in this example, I have here several input controls that are...

Wednesday, January 20, 2016

SQL JOIN: Display Records With or Without Match on The Other Table

There will be cases where you want to join two (2) table and display records that has match or even without match on the other table. Table ...

SQL NATURAL JOIN: Display Records That Have Match on the Other Table

Let's say we have two (2) table, the STUDENT and GRADE table and we are going to display all students with grades only. We'll exclud...

SQL ORDER BY: Display Records in According to Date and Time in Descending Order

ORDER BY is the keyword used to arrange records either in ascending (which is the default ordering if not set) or descending order. If you a...

SQL NOT IN: Display Records That Are NOT IN Another Table

Let's say you want to display the records from the left table which is the ENROL table  which are NOT IN the right table which is the SU...