Warning: Creating default object from empty value in /www/htdocs/v030397/mysql-qotd/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php on line 4991

Warning: Creating default object from empty value in /www/htdocs/v030397/mysql-qotd/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php on line 4993
MySQL Question of the Day - mysql 5.0/5.1 questions for learning purposes

Skip to content

By urs in mysql questions

 
(Find all correct answers)

a) (inside the mysql-client) prompt \U \d :
b) (inside the windows command shell) set MYSQL_PS1=\U \d :
    (or inside a unix shell)  export MYSQL_PS1="\U \d : "
c) mysql -p -u root --prompt="\U \d : "

 
[ The mysql Client Program (10%) - The mysql Prompts ]
 

Tags: , ,

By urs in mysql questions

 

table1 was created like this:

create table table1 (id int primary key,name varchar(32));
insert into table1 values (1,'a'),(2,'b'),(3,'zeh');

 
(Find all correct answers)

a) delete from table1 where id+1=10;
b) update table1 v1 set v1.name='v'
     where abs(id)=12;
c) update table1 v1 set v1.name='v' where id
     between 1 and 999999 and name='f';

 
[ Tables and Indexes (15%) - Indexes ]
 

Tags: , ,

By urs in mysql questions
The following table was created:

create table dtest (n decimal(5,2),m decimal(7,2));

a) 99999.99
b) 65536
c) 2147483647
d) 999.99
 

[ Data Types (15%) - Numeric Data Types ]

 

Tags: , ,

By urs in mysql questions

(Find all correct answers)

 
a) mysql -p -u root --i-am-a-dummy
b) mysql -p -u root --safe-updates
c) mysql -p -u root -safe-updates
 

[ The mysql Client Program (10%) - Using the --safe-updates Option ]

 

Tags: , ,

By urs in mysql questions
The table "table1" has been created like follows:

create table table1 (id int primary key,name varchar(32));
insert into table1 values (1,'a'),(2,'b'),(3,'zeh');
 

(Find all correct answers)

a) update table1 set id=4 where name='zeh';
b) select * from table1;
c) delete from table1 where id=5;
d) delete from table1 where name='zeh';
 

[ The mysql Client Program (10%) - Using the --safe-updates Option ]

 

Tags: , ,

By urs in mysql questions
mysql> select "1 apple" + "1 orange";
+------------------------+
| "1 apple" + "1 orange" |
+------------------------+
|                      2 |
+------------------------+
1 row in set, 2 warnings (0.00 sec)

a) completion_type
b) sql_mode
c) datetime_format
 

[ Client/Server Concepts (5%) - Server SQL Modes ]

 

Tags: , ,

By urs in mysql questions

(Find all correct answers)

a) mysqladmin -p -u root processlist
b) mysqlps -p -u root list
c) mysql -p -u root -e "show processlist"
d) mysql -p -u root --execute "select * from mysql.processes"
 

[ Client/Server Concepts (5%) - Invoking Client Programs ]

 

Tags: , ,

By urs in mysql questions

(Find all correct answers)

a) mysqlshow -p -u root *
b) mysqllist -p -u root --all-databases
c) mysql -p -u root -e "show databases"
d) mysql -p -u root --execute "select schema_name from information_schema.schemata"
e) mysqldisplay --all-databases
 

[ Client/Server Concepts (5%) - Invoking Client Programs ]

 

Tags: , ,