Search This Blog

Monday, 11 February 2013

Test Your Knowledge on PHP & MySQL

0 comments

FAQ on PHP & MySQL

(You can find the links for downloading the materials for MySQL and PHP here.)

Two Marks: (2 x 5 = 10)
  1. Tell whether PHP variable and keywords are case sensitive?
  2. List the different data types supported in PHP.
  3. Write a console application in PHP for generating Prime Numbers between 1 to 50.
  4. How do you create arrays in PHP. Give an example.
  5. Write a sample code in PHP for creating and using Objects.
Big Question:
  1. Discuss in details the functions used for generating Summary Reports in MySQL. (8)
(OR)
  1. List any four string related functions in MySQL and explain its syntax. (8)
  2. Create a table called "project" which contains the following data: (16)
empno
projectID
projectname
budget
15
1
Interface Design
10000
17
2
E-Commerce Solution
20000
19
3
Advertising
50000
The employee number (empno) belongs to the employee who is in charge of project. Choose appropriate datatypes for each of the fields. Create the table and insert the data. Decide which keys you might need (primary key, foreign key) and make sure that these are correctly implemented.
Hint: If MySQL complains about warnings or errors when you insert the data, use "show warnings" and "show errors" to look at the warnings and errors.
  • The company has decided that the budgets are too small. Update the project table. Add 5000 to each of the budgets.
  • The company decides to take project number 3 from employee 19 and give it to employee 20. Update the table to reflect this change.
(OR)
  1. a) How to use MySQL left join to select data from multiple tables? Explain (8)
b) What is metadata in MySQL? How to obtain it and use it? Explain. (8)


  1. a) What is PHP? What does it do? List out its features? (8)
    b) Mention the scalar data-types provided by PHP? Explain with Examples (8)
(OR)
  1. Write a console application in PHP to find the factorial of first 10 numbers. (16)

Leave a Reply