* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Using the diagram shown – fig 1, give a brief description of web
Survey
Document related concepts
Oracle Database wikipedia , lookup
Microsoft SQL Server wikipedia , lookup
Microsoft Access wikipedia , lookup
Functional Database Model wikipedia , lookup
Entity–attribute–value model wikipedia , lookup
Open Database Connectivity wikipedia , lookup
Concurrency control wikipedia , lookup
Extensible Storage Engine wikipedia , lookup
Microsoft Jet Database Engine wikipedia , lookup
Ingres (database) wikipedia , lookup
Clusterpoint wikipedia , lookup
ContactPoint wikipedia , lookup
Transcript
CITY UNIVERSITY LONDON MCS3, XFC3 BEng (Hons) Degree in Computer Systems Tutorial Questions INTERNET DATABASE SYSTEMS 1. Software & Architecture a. What is a web server? b. What is a relational database? c. What is a browser? d. What is middleware? e. What does cross-platform mean in the case of PHP? f. Using the diagram below, discuss web application architecture. 2. Databases in general a. What is database normalisation and why is it important in database design? b. What are the three main normal forms? c. What is a primary key? d. What is the objective of the 2nd normal form? e. The following table 1 – Employees - has satisfied the 1st normal form. Bring it to the 2nd normal form? Show the resulting tables. Table 1 - Employees emp_id emp_name address city state post_code position department salary hire_date f. List the main types of relationships between tables g. How do you create a relationship between two tables? 3. MySQL – access and main statements a. What are the three essential arguments required to access MySQL Server? b. Give the MySQL syntax for accessing a database. c. Write statements to: i. create a database called “Islington” ii. create a table called “Employees” d. What command do you use to check the structure of your table (to show all the columns and their attributes)? e. Give two methods of entering data into a table using MySQL commands. f. Give a list of six common types of columns g. Describe each type h. How do you designate a column the primary key? i. By giving appropriate column types and attributes to Table 1 above, write a MySQL code that will create this table in a database called “Islington”. 4. MySQL – Queries a. Give the basic select statement syntax to retrieve all data from a table. b. Write a select statement to retrieve all information from a table called users about a person whose userid is 2. c. Give all the key words in a select statement that will arrange retrieved data in a particular order. 5. PHP a. Discuss and analyse every line of the following PHP code: <?php $link = mysql_connect("mysql_host", "mysql_login", "mysql_password") or die ("Could not connect"); print ("Connected successfully"); mysql_select_db ("my_database") or die ("Could not select database"); $query = "SELECT * FROM my_table"; $result = mysql_query ($query) or die ("Query failed"); // printing HTML result print "<table>\n"; while ($line = mysql_fetch_array($result)) { print "\t<tr>\n"; while(list($col_name, $col_value) = each($line)) { print "\t\t<td>$col_value</td>\n"; } print "\t</tr>\n"; } print "</table>\n"; ?> mysql_close($link); b. Describe and write out the syntax for the following PHP functions: i. MYSQL_CREATE_DB() ii. MYSQL_DROP_DB() iii. MYSQL_LIST_DBS() iv. MYSQL_LIST_TABLE() v. EREG() vi. ECHO c. What is an array? Give an example. d. In the guestbook2k example, what is the purpose of the following functions: i. authenticate ii. cleanup_text iii. print entry iv. create entry e. How do you limit the number of entries appearing on a page? 6. MySQL Administration a. What does each of the tables in the MySQL database denote? b. In which table must a user be listed in order to have full access to all databases and tables in the MySQL server? c. Write the syntax of the command used to grant a user full access to a database. d. If a user has access to only one database, in which table will they be listed? 7. Software Installation a. Give a brief description of the process of installing MySQL, Apache and PHP4 having downloaded the appropriate versions from the Internet or from a CD ROM provided with the textbook. b. Name the two files that need to be in your C:\Windows\System\ or the location where you keep the dll files. c. To what must you rename a file called “php.ini-dist” ? d. What is the name of the file that needs to be amended in order for Apache and PHP to communicate? e. Give a list of the extra lines that need to be added to the file. What do these lines do?