|
1.What is the Use of “WITH ROLLUP” in Mysql? Adding a WITH ROLLUP modifier to the GROUP BY clause causes the query to produce another row. eg: mysql> SELECT year, SUM(profit) FROM sales GROUP BY year WITH ROLLUP; | year | SUM(profit) | | 2000 | 4525 | | 2001 | 3010 | | NULL | 7535 | <<<- Note here*
So an extra row (<<<- Note here*) is created by mysql and also we get total profit in the last column. 2.What is MySQL? MySQL (pronounced "my ess cue el") is an open source relational database management system (RDBMS) that uses Structured Query Language (SQL), the most popular language for adding, accessing, and processing data in a database. Because it is open source, anyone can download MySQL and tailor it to their needs in accordance with the general public license. MySQL is noted mainly for its speed, reliability, and flexibility 3.How can we encrypt and decrypt a data present in a MySQL table using MySQL? There are two methods AES_ENCRYPT () and AES_DECRYPT () 4.Where MyISAM table is stored ? Each MyISAM table is stored on disk in three files. The ‘.frm’ file stores the table definition. The data file has a ‘.MYD’ (MYData) extension. The index file has a ‘.MYI’ (MYIndex) extension, 5.How can we find the number of rows in a table using MySQL? SELECT COUNT(*) FROM tb_nme; 6.How many type of buffers does use MySQL? global buffers and per-connection buffers 7.What is the use of –i-am-a-dummy flag in MySQL It Makes the MySQL engine refuse UPDATE and DELETE commands where the WHERE clause is not present.
8.Is MySQL better than MSSQL? Mysql is the most popular open source database server right now. It is used by large enteprise level companies and small, single websites. Is mysql actually better? Mysql 5.0 vs. Microsoft SQL 2005 --------------------------------- Features * Mysql 5.X now offers support for cursors, complete views, and stored procedures. However, Foreign Key support is still in its early stages. * SQL 2005 has native support for xml, multi-dimensional data querying, and Visual Studio .net integration. Cost * Microsoft provides a free license for development use. $1400 for a commercial license. * Mysql is free ($0) for commercial and non-commerical use. It is also possible to purchase a commerical license (to get around the GPL license) for $400. Performance * Mysql: MyISAM database table type uses less space and memory. Innodb and NDB clusters also now use 20% less space (new to 5.0). * SQL 2005: needs more disk storage and memory requirements. Replication * Mysql: One way replication using a binary log, which can easily be replicated to multile machines. * SQL 2005: Multiple forms of replication (snapshot,transactional, and merge), which are more complex and offers a greater degrees of flexibility. Recovery * SQL 2005: Very robust. There are multiple failsafes in place to prevent data loss. New features in this version also allow rapid restoration and data protection. * Mysql: Falls very short in this respect. An unexpected shutdown of your server can cause data loss. 9.What is the maximum length of a table name, a database name, or a field name in MySQL? Ans: Database name: 64 characters Table name: 64 characters Column name: 64 characters 10.How many values can the SET function of MySQL TAKE? Ans: MySQL SET function can take zero or more values, but at the maximum it can take 64 values.
|