Tag Archives: NULL

Mysql interview questions

mysql-question




Q 1- How to setup admin user for MYSQL ? Ans: Login as super user ‘root’ in mysql and execute the following commands. mysql> use mysql; mysql> create user ‘test’@’%’ identified by ‘test’; mysql> grant all on *.* to ‘test’@’%’ with grant option; mysql> flush privileges; Q 2- What types of privileges are there in MySQL ? Ans: There are 4 types of privileges. i). Global privileges like *.* (all hosts connecting to Mysql db server) Example: GRANT SELECT, INSERT […]

Mysql Join Syntax

mysql-join-syntax




SQL joins are used to query data from two or more tables, based on a relationship between certain columns in these tables. This means everything you have learned so far can be applied after you’ve created this new, joined table. How Does a Join Work?  A join works through the use of keys. Continuing our example, our supplier table contains a column designated as the supplier_id. This column is configured as the primary key (for details on primary keys see Database […]

Top 6 rules to build Solid MySQL AND PHP Applications

6_golden_rules_php




PHP & MYSQL are the those preferred technologies for building web applications, since they provide a way to build web applications rapidly. However, sometimes it leads to code that is hard to maintain , doesn’t scale well and perform poorly. And here there are several golden rules that helps you to build rock-solid applications. 1) Do not Trust your Users’ Input A first golden rules that you should bear in mind is to never write code that trusts customer input. […]

MySQL Best Practices

MySQL Best Practices




Database operations often tend to be the main bottleneck for most web applications today. It’s not only the DBA’s (database administrators) that have to worry about these performance issues. We as programmers need to do our part by structuring tables properly, writing optimized queries and better code. Here are some MySQL optimization techniques for programmers.