Mysql

Multiple Counts With Different Conditions In Single MySQL Query

Multiple Counts With Different Conditions In Single MySQL Query

Here we show how you can use multiple count() with different conditions in single MySql query. Below is sample table with data — — Table structure for table `student` — CREATE TABLE `student` ( `id` int(11) NOT NULL, `name` varchar(255) NOT NULL, `subject` varchar(255) NOT NULL, `address` varchar(255) NOT NULL, `gender` varchar(255) NOT NULL, `class` …

Multiple Counts With Different Conditions In Single MySQL Query Read More »

Drop Table Column In MySQL

Drop Table Column In MySQL

Here we show how  you can drop a column from table in MySQL. Sometime, we not need a particular column of table. So, we delete this column from the table. Syntax:   ALTER TABLE table_name DROP COLUMN column_name; First we create a sample table with data. CREATE TABLE `employees` ( `employee_id` int(11) NOT NULL, `employee_name` varchar(100) …

Drop Table Column In MySQL Read More »

Max And Min Salary Of Employees With Employee Name In MySql

Max And Min Salary Of Employees With Employee Name In MySql

Here we write a SQL Query for retrieve Max and Min salary with employees name in MySql. First we create a sample table with data. — — Table structure for table `employees` — CREATE TABLE `employees` ( `employee_id` int(11) NOT NULL, `employee_name` varchar(100) NOT NULL, `salary` int(11) NOT NULL, `department` varchar(50) NOT NULL ) ENGINE=InnoDB …

Max And Min Salary Of Employees With Employee Name In MySql Read More »