Tag Archives: mysql interview questions and answers
81 What are indexes? What are B-Trees? Index makes your search faster. So defining indexes to your database will make your search faster.Most of the indexing fundamentals use “B-Tree” or “Balanced-Tree” principle. It’s not a principle that is something is created by SQL Server or ORACLE but is a mathematical derived fundamental.In order that “B-tree”
more..
71 Can you explain the SELECT INTO Statement? SELECT INTO statement is used mostly to create backups. The below SQL backsup the Employee table in to the EmployeeBackUp table. One point to be noted is that the structure of pcdsEmployeeBackup and pcdsEmployee table should be same. SELECT * INTO pcdsEmployeeBackup FROM pcdsEmployee 72 What is
more..
61 How to select the first record in a given set of rows? Select top 1 * from sales.salesperson 62 What is the default “-SORT ” order for a SQL? ASCENDING 63 What is a self-join? If we want to join two instances of the same table we can use self-join. 64 What’s the difference
more..
51 What are DML and DDL statements? DML stands for Data Manipulation Statements. They update data values in table. Below are the most important DDL statements:- =>SELECT – gets data from a database table => UPDATE – updates data in a table => DELETE – deletes data from a database table => INSERT INTO –
more..
41 What is database or database management systems (DBMS)? and – What’s the difference between file and database? Can files qualify as a database? Database provides a systematic and organized way of storing, managing and retrieving from collection of logically related information. Secondly the information has to be persistent, that means even after the application
more..
31 How to Delete a column and Add a new column to database mysql> alter table [table name] drop column [column name]; mysql> alter table [table name] add column [new column name] varchar (20); 32 Change column name and Make a unique column so we get no dupes. mysql> alter table [table name] change [old
more..
21 How to Creating a new user. Login as root. Switch to the MySQL db. Make the user. Update privs. # mysql -u root -p mysql> use mysql; mysql> INSERT INTO user (Host,User,Password) VALUES(‘%’,’username’,PASSWORD(‘password’)); mysql> flush privileges; 22 How to Change a users password from unix shell. # [mysql dir]/bin/mysqladmin -u username -h hostname.blah.org -p
more..
11 How to returns the columns and column information pertaining to the designated table mysql> show columns from tablename; 12 How to Show certain selected rows with the value “pcds” mysql> SELECT * FROM tablename WHERE fieldname = “pcds”; 13 How will Show all records containing the name “sonia” AND the phone number ‘9876543210’ mysql>
more..
1.how to do login in mysql with unix shell By below method if password is pass and user name is root # [mysql dir]/bin/mysql -h hostname -u root -p pass 2. how you will Create a database on the mysql server with unix shell mysql> create database databasename; 3. how to list or view all
more..