MySQLi Articles

Page 341 of 341

How changes, made in the current transaction, can be permanently eliminated from MySQL database?

Sai Subramanyam
Sai Subramanyam
Updated on 30-Jul-2019 161 Views

We can use ROLLBACK command to eliminate the changes, made in a current transaction, permanently from MySQL database. Suppose if we run some DML statements and it updates some data objects, then ROLLBACK command will eliminate these updates permanently from the database. Example Suppose we have the following data in table ‘marks’ and we applied the transaction and ROLLBACK command as follows − mysql> SELECT * FROM Marks; +------+---------+---------+-------+ | Id | Name | Subject | Marks | +------+---------+---------+-------+ | 1 | Aarav | Maths | ...

Read More

How can we count a number of unique values in a column in MySQL table?

Ankitha Reddy
Ankitha Reddy
Updated on 30-Jul-2019 331 Views

By using DISTINCT keyword along with column name as the argument of COUNT() function we can count the number of unique values in a column. The syntax is as follows − SELECT COUNT(DISTINCT Col_name) FROM table_name; Example Suppose we have the following table mysql> Select * from tender; +----------+--------------+--------------+-------+ | clientid | client_Fname | Client_Lname | value | +----------+--------------+--------------+-------+ | 100 | Mohan | Kumar | 60000 | | 101 | Sohan ...

Read More

How OLD and NEW keywords enable us to access columns in row affected by\\na trigger?

Sai Subramanyam
Sai Subramanyam
Updated on 30-Jul-2019 1K+ Views

As we know that in trigger definition, we can refer to columns of the row being inserted, updated or deleted. Following are the ways OLD and NEW keywords enable us to access columns − We must have to prefix the column name with a qualifier of OLD to refer to a value from the original row. We must have to prefix the column name with a qualifier of NEW to refer to a value in the new row. Now, the use of OLD and NEW must be done appropriately because the triggering event Determines which of them are ...

Read More

How can we create a MySQL view with GROUP BY clause?

Sai Subramanyam
Sai Subramanyam
Updated on 30-Jul-2019 2K+ Views

We can use GROUP BY to group values from a column, and, if we want, we can perform calculations on that column. You can use COUNT, SUM, AVG, etc., functions on the grouped column. To understand GROUP BY clause with views we are creating a view named ‘Info’ using the base table ‘Student_info’ having the following data − mysql> Select * from Student_info; +------+---------+------------+------------+ | id | Name | Address | Subject | +------+---------+------------+------------+ | 101 | YashPal | Amritsar | History ...

Read More
Showing 3401–3404 of 3,404 articles
« Prev 1 337 338 339 340 341 Next »
Advertisements