Learning Objective
After completing this topic, you should be able to
distinguish between different scripting languages and database technologies Exercise overview
In this exercise, you're required to distinguish between different scripting languages and database technologies.
This involves the following tasks:
choosing a scripting language and
choosing a database model
You're a network administrator working for EarthFarm LLC. The company is planning a new database-driven web site. The management team is not familiar with scripting languages or database models, so you've been asked to research and write a report on the implementation options available to them.
Task 1: Choosing a scripting language
Your first task is to explain why server-side scripting is more suited to the company's needs than client-side scripting.
Question
Why should server-side scripting be used?
Options:
1. Client-side scripts connect directly to a database to process queries 2. It facilitates dynamic site content
3. It is required to query a database and provide feedback to users 4. It allows the client process information independently of the server
Answer
Option 1: Incorrect. A browser can only process client-side scripts, which are limited in their functionality and can't connect directly to a database to process queries.
97
Option 2: Correct. Server-side scripting can build HTML pages dynamically from database content and send the pages to the user's computer.
Option 3: Correct. Server-side scripting allows users to access a database and to send the relevant data back to the user's computers.
Option 4: Incorrect. Server-side scripting is always carried out on the server. The client uses client-side scripting to process information independently of the server.
Correct answer(s):
2. It facilitates dynamic site content
3. It is required to query a database and provide feedback to users
Question
Now you need to specify some of the scripting languages that EarthFarm could use.
What are the scripting languages or application frameworks that you could use?
Options:
1. ASP.NET 2. JavaScript 3. HTML 4. PHP
Answer
Option 1: Correct. ASP.NET is a server-side application framework developed by Microsoft. It allows access to databases as part of Microsoft's .NET Framework.
Option 2: Incorrect. JavaScript is incorporated in HTML files or stored in separate .js text files. It is a client-side script, which is processed by the browser.
Option 3: Incorrect. HTML is a markup language that presents text and images for display in the browser software of a client machine.
Option 4: Correct. PHP is a powerful open-source, server-side scripting language.
Correct answer(s):
1. ASP.NET 4. PHP
98 Question
You've decided to recommend a specific scripting language for EarthFarm to use. This language should always run on the server, natively support connections to several different types of databases, and be open-source software.
Which scripting language would you recommend?
Options:
1. ASP.NET 2. HTML 3. PHP 4. VBScript
Answer
Option 1: Incorrect. ASP.NET is a server-side scripting language developed by Microsoft.
Option 2: Incorrect. HTML is a markup language and doesn't provide database connectivity.
Option 3: Correct. PHP is a server-side scripting language. It is open source, which means anyone can contribute to its development. It supports connections to many types of databases but it is most often used with the free database MySQL.
Option 4: Incorrect. VBScript is a scripting language offshoot from the Visual Basic programming language. It is used to write client-side and server-side scripts.
Correct answer(s):
3. PHP
Task 2: Choosing a database model
In your report, you want to talk about the different types of management systems and database models that exist.
Question
In your report, you explain the multitiered computing models.
Match the 3-tier components with their descriptions.
Options:
99
A. Application server B. Client
C. Database server
Targets:
1. Runs the user interface 2. Runs the process logic 3. Manages data storage
Answer
The user interface programming is carried out at the client.
The application server uses rules to determine how user requests for data are communicated to the database server.
The database server contains the database and the services that control access to the data.
Correct answer(s):
Target 1 = Option B
Target 2 = Option A
Target 3 = Option C
You decide to recommend an RDBMS for EarthFarm.
Question
Identify the features of a relational database.
Options:
1. A single database can be spread across several tables 2. It is managed using an ODBMS
3. Data is stored in a single table 4. It is easy to extend
Answer
Option 1: Correct. Relational databases are different to flat-file databases, in which each database is self-contained in a single table.
100
Option 2: Incorrect. Relational databases are managed using an RDBMS. Object-oriented databases are managed using an ODBMS.
Option 3: Incorrect. Data is stored in multiple tables so that it can be accessed or reassembled in many different ways without having to reorganize the database tables.
Option 4: Correct. You can add new data categories to relational databases without requiring that all existing applications be modified.
Correct answer(s):
1. A single database can be spread across several tables 4. It is easy to extend
Question
Which language is used to access the records in an RDBMS?
Options:
1. OQL 2. JavaScript 3. PHP 4. SQL
Answer
Option 1: Incorrect. An ODBMS, rather than an RDBMS, uses OQL to construct database queries.
Option 2: Incorrect. JavaScript is a client-side scripting language. JavaScript does not possess the required functionality to connect to or query a database.
Option 3: Incorrect. PHP is a server-side scripting language that builds HTML pages from database content. Functions exist within PHP to send SQL queries to, and receive result sets from, a
database.
Option 4: Correct. SQL, which stands for Structured Query Language, is used to query information in the tables of a relational database.
Correct answer(s):
4. SQL