Write a c/c++ program to add a user to MySQL.
The user should be permitted to only "select" entries from the given database. what resources did you use to do research for this project? what development tools did you do use to complete the project? how did you test & debug the project? why have you chosen to use the programming language used in...
Dude, i tried to execute it . it execute successfully . but the grantACC is not getting executed . after adding user and trying to login him , it is saying error 1045(28000)
try this :)"cpp #include #include #include #include int main() { char name[10]; char password[10]; char database[10]; char addUser[60]=""; char grantACC[60]=""; // initiali...
How is structure of a table got in MySQL?
you can also see the structure by using this statement "show create table table_name";
ya that's rightdesc table is easy to useThink this way to desc a table,DB has to save the info some where right? its the information _schema DB where all the info related to Database or table...
Which of the following is not a MySQL operator?A. Between..And..,b. Like,c. In,d. Is null
LIKE is an operator
d. Is NULL
How is stored procedures managed in MySQL?
Details of existing stored procedures in MySQL can be obtained from ROUTINES table in INFORMATION_SCHEMA database.
Stored Procedures can be managed using the following:
CREATE [FUNCTION|PROCEDURE]
ALTER [FUNCTION|PROCEDURE]
DROP [FUNCTION|PROCEDURE]
SHOW CREATE [FUNCTION|PROCEDURE]
What are the link types for joins, =? What datasets result?
What are the link types for joins, =? What datasets result? I cannot find anything about these link types online or in help.
What is better to use, views or cursors? Why?
Views are best to use.
The Reason behind this is mainly the performance. Views just have select statements and retrieves the information faster. Cursors take time to retrieve the info row by row.
Thanks In advance!
What is the differance between exec and execute in stored procedure?
They are the same, its like execute alias name is exec.there is a difference between EXEC() and EXEC , EXEC()function takes dynamic string as input and executes them and it needs more bytes compared.
How do you use outer join in MySQL
SELECT TABLE1.COLOMN ,TABLE1.COLUMN......, TABLE2.COLOMN, TABLE2.COLUMN FROM TABLE1 OUTTER JOIN ON TABLE1.COMMON COLUMN= TABLE2.COMMON COLUMN
Full outer join combines the effect of applying both left and right outer joins. A records in the full outer joined tables do not match, the result set will have NULL values for every column of the ta...
How to view all triggers in MySQL?
type
Show Triggers;
show triggers;
What are the data types available in MySQL?
Hi,
MySQL supports following data types:
Hi,
Numerical type
String type
Date and time type
If you need further clarification or discussion please mail me at altafhsayyed@yahoo.com
Thanks and regards
int varchar char date double long etc are available for mysql
What is reload privileges in MySQL used for?
Hi,When you update or add privileges in MySQL grant tables(db,users,tables,columns,hosts etc) are updated. These changes takes effect when mysql server restarts. MySQL server reads all grant tables at...
Reload privileges are used to apply any changes on settings related to privileges without re starting Mysql's current session
syntax to use:
mysql -u username -p password -e "flush privileges";
What is the command for counting all the rows in a table in MySQL?
Hi,
Select count(COLUMN_NAME) from information_schema.columns where table_name='table_name';
In above query please put your table name in place of 'table_name'
If you need any further assistance or discussion please mail me at altafhsayyed@yahoo.com
Thanks and regards
select count(*) from table_name
What are the platforms supported by MySQL?
Hi,MySQL is written in C,C++.MySQL supports following platforms.Please check URL.http://dev.mysql.com/doc/refman/5.0/en/supported-os.htmlThere are 2 methods for installing mysql:1. Installing compiled...
It supports all platforms but depending upon the platforms it have different different setup files and libraries.
Is it possible to delete duplicate records from a table with out using rowid in MySQL?
Can use rownum.If possible explain.Regards,joe
Yes it is possible.Please check following syntax:delete from table1 USING table1, table1 as vtable WHERE (NOT table1.ID=vtable.ID) AND (table1.field_name=vtable.field_name)In above place column name i...
Delete T1 from tablename as T1, tablename as T2 where T1.name=T2.name and T1.id>T2.id
How many types of join are supported by MySQL? Which are they? Explain
Straight Join is similar to inner join. But a small difference.It checks left table first to optimize query.
MySQL Supports following joins
Inner
Cross
Strainght
Outer
Natural
Please check following Link:
http://dev.mysql.com/doc/refman/5.0/en/join.html
How a database is copied from one machine to another?Explain with an example.
Hello everybody,We can copy database through following meansBackup( Physical or logical)ReplicationIn physical backup database files are copied and pasted to target location.We can use any file backup...
export the database in .sql format from 1 system and import that .sql file to another system using phpmyadmin tool.
How to display nth highest record in a table for example ?
Select salary from tablename order by desc limt 4;
Suppose we have to find records in the emp_salary table with nth highest value for salary.
select * from emp_salary whare salary in(select distinct salary from emp_salary order by salary desc limit n-1,1);
select salary form employee order by salary desc limit 1,1
3rd Highest Salary-->Change Limit 2,1
4th highest salary-->change Limit 3,1
What is the Oracle rowid counterpart in MySQL?
Hi,
There is no rowid counterpart in MySQL. But if you want same feature in MySQL then you need to add following column in each table you need rowid.
id bigint unsigned not null autoincrement
If you need any further assistance or discussion please mail me at altafhsayyed@yahoo.com
Thanks and regards
There is no concept like rowid in MySQL
Is it required to use index when the MySQL table has only 100 rows? Justify your answer
Hi,Index is used to speed up query.If particular column is used often in queries and table has lot of data.Then it is recommended to create index for that column of the table. It will speed up the que...
Index is a database structure which stores column value in order and pointer to the row containing this value.During query execution index is used to fast search column data used in where condition. I...
SELECT emp_salary FROM salary_detail ORDER BY emp_salary desc LIMIT 3,1
SELECT salary FROM customer
ORDER BY salary DESC
LIMIT 3,1