PHP WEB DEVELOPMENT PART - 1 PROBABLE MOST IMPORTANT INTERVIEW QUESTIONS AND ANSWERS MADE BY ME GENERALLY ASKED IN PITANGENT ANALYTICS AND TECHNOLOGY SOLUTIONS PVT. LTD. FOR FRESHERS

PHP WEB DEVELOPMENT PART - 1 PROBABLE MOST IMPORTANT INTERVIEW QUESTIONS AND ANSWERS MADE BY ME GENERALLY ASKED IN PITANGENT ANALYTICS AND TECHNOLOGY SOLUTIONS PVT. LTD. FOR FRESHERS

Q1. What is the difference between == and ===?

Ans: == -> This operator is used to check whether the given values are equal or not. If yes, it returns true, otherwise it returns false.

=== -> This operator is used to check whether the given values and it's data types are equal or not.

Q2. What are superglobals in PHP?

Ans: Superglobals in PHP are the pre-defined global variables. All superglobal variables are written in capital letters. For ex. : $_GLOBALS, $_GET, $_POST, $_COOKIES, $_SESSION, $_REQUEST, $_FILES, etc.

Q3. What are variables and constants in PHP?

Ans: Variables = Variables are containers for storing information. A variable start with the $ sign, followed by the name of the variable. For ex. : $x=10; $y="Capgemini";

Constants = Constants are like variables, except that once they are defined they cannot be changed or undefined. Syntax : define(name, value);

For ex. : define("GREETING","Welcome to Capgemini.com");

               echo "GREETING";

Q4. What is the difference between echo, print and print_r().

Ans: 


echo => echo returns void i.e. it doesn't return any values. echo  speed is fastest.
print => print returns 1 on success. print speed is slightly slower.
print_r() => print_r() returns data as string if the 2nd argument is true. print_r() speed is slower for debugging.

Q5. Write a SQL query to fetch employees with salary greater than 50,000.
Ans: SELECT * FROM `employees` WHERE salary>50000;

Q6. Write a SQL query to get the top 3 departments with the highest number of employees.
Ans: SELECT department, COUNT(*) AS employee_count FROM `employees` GROUP BY department ORDER BY employee_count DESC LIMIT 3;

Q7. Write a query to join two tables users and orders where user ID matches.
Ans: SELECT * FROM `users` JOIN `orders` ON users.user_id=orders.user_id;    `


Comments

Popular posts from this blog

Programmings Based On Array And String Functions To Merge The 2 Arrays, Then After Merge Convert Into String And Then Find Out The 1st And Last Word From The Reverse String

PHP WEB DEVELOPMENT INTERVIEW QUESTIONS ASKED IN APOLLO HOSPITAL ALONG WITH MY OWN CONCEPTS AND MY OWN EXPLANATION ANSWERS(PART - 1) REST OF THE QUESTIONS AND ANSWERS WILL BE PREPARED BY ME IN MY NEXT BLOG

Mini Project On Multi User CRUD Operations(Create, Read, Update & Delete) Of Donar Details Of Indian Nationals Who Donate To Ramkrishna Math, Belur Math Using PDO (PHP Data Objects) With Proper Explanation Of Each And Every Individual Line Of The Code Of connection.php Page, form.php Page, formaction.php Page, admin_display.php Page, client_display.php Page, edit.php Page, editaction.php Page And delet.php Page (Here You Will Find The Image Of Sayang Sri Ramkrishna Dev, Sayang Sri Ma Sarada Devi & Sayang Sri Swami Vivekananda) In My CRUD Operation