Lab 1 Introduction To SQL Tools and Technique
Lab 1 Introduction To SQL Tools and Technique
Contribution
Lab Outline
Week Labs
1 LAB 1 – Introduction to SQL Tools and Technologies
2 LAB 2 - Introduction to HTML, CSS and Forms
3 LAB 3 – PHP Introduction and Forms Handling
4 LAB 4 – Database Connectivity and DDL Introduction
5 LAB 5 - Data Defination Language
6 LAB 6 - SQL DML (INSERT, UPDATE, DELETE, SELECT INTRODUCTION)
7 LAB 7 - View, Update and Delete Operation using Web Interface
8 LAB 8 - Data Manipulation Language (SELECT WHERE, ORDER, DISTINCT, LIMIT)
9 LAB 9 - SQL SELECT with functions, aggregate functions
10 LAB 10 - GROUP BY AND HAVING
11 LAB 11 - SQL JOINS INNER SELF OUTER
12 LAB 12 - SQL OUTER JOINS LEFT and RIGHT JOIN
13 LAB 13 - SQL SubQueries with ALL, ANY, EXISTS, SOME
Lab Manual for Introduction to Database Systems
Lab-01
Introduction to SQL Tools and Techniques
Lab 0: Introduction to SQL Tools and Techniques
Contents
1. Introduction 5
4. Concept Map 5
5.1 Task 1 9
5.2 Task 2 9
7. Practice Task 3
9. Evaluation criteria 3
10.1 Slides 3
4. Concept Map
In this section, first a brief overview of the Web Architecture is presented, then we will study
about the role of database in Web Architecture. After that we discuss the tools and technique
required for database.
The above diagram is a generic Web Architecture. There are three main component of the web
architecture system which are given below:
4.1.1 Client/User:
In web architecture the client/user request for some data from server by using the frontend of the
application. The frontend of the application is built by usingHTML, CSS etc.
For example: we can see in the above diagram that inStep 1client request for the website of
CUST University by providing the link of a website in a browser. In Step 2the request of client
go to the server by using Internet.
4.1.2 Server:
In web architecture the server (Apache Web Server)that accepts the client's requests and process
the request and provides the required data as response.
For example: In the above diagram we can see that in Step 3the server accept the request of a
client and process them by using PHP as a scripting language. In Step 4the server access the
requested file by using server port 80.
4.1.3 Database:
Databases are used for storing and managing data. These databases are installed on server. The
server ensure the accessibility of data from these databases against client request.
For example: In the above diagram we can see that in Step 5 if the request file contain data
related query, the server request from database by using port 3306. The request of data written in
SQL language. In Step 6 the requested data is returned by database to the server. At last in Step
7, the server return the requested file to the client which is in the form of HTML and CSS.
In web development, 'client side' refers to everything in a web application that is displayed or
takes place on the client (end user device). This includes what the user sees, such as text, images,
and the rest of the UI, along with any actions that an application performs within the user's
browser.
Markup languages like HTML and CSS are interpreted by the browser on the client side, which
will be discussed in next lab. These languages are used to develop to the client side interfaces.
✓ Tools:
For writing the code of these languages we can use multiple tools such as: 1) Notepad, 2)
Notepad++, 3) PHP Stormetc, which is openly available on internet. You can just download it
and install on your system. Below are some references which can help you in downloading and
installing these tools.
• https://notepad-plus-plus.org/downloads/
• https://www.jetbrains.com/phpstorm/download/#section=windows
4.2.2 Server:
Web browsers communicate with web servers using the HyperText Transfer Protocol
(HTTP). When you click a link on a web page, submit a form, or run a search, an HTTP
request is sent from your browser to the target server.
The request includes a URL identifying the affected resource, a method that defines the required
action (for example to get, delete, or post the resource), and may include additional information
encoded in URL parameters (the field-value pairs sent via a query string), as POST data (data
sent by the HTTP POST method), or in associated cookies.
Web servers wait for client request messages, process them when they arrive, if there is some data
related request so get the data from database and reply to the web browser with an HTTP
response message.
The body of a successful response to a request would contain the requested resource (e.g. a new
HTML page, data, or an image, etc...), which could then be displayed by the web browser.
For doing all of this process we have to use some server side scripting languages. The most
popular server-side scripting languages and frameworks include PHP, ASP.NET, Node. js, Java,
Ruby, Perl and Python. These scripts run on a web server and respond to client requests via
HTTP to deliver dynamic and customized content to the user.
✓ Tools:
• PHP:
We will use a PHP as a server-side scripting language it is one of the powerful tool for making
dynamic and interactive Web applications. Moreover, it is widely-used, free, and open source
language. For writing the code of PHP we can use multiple tools such as: 1) Notepad, 2)
Notepad++, 3) PhpStormetc, which is openly available on internet. You can just download it and
install on your system. Below are some references which can help you in downloading and
installing these tools.
o https://notepad-plus-plus.org/downloads/
o https://www.jetbrains.com/phpstorm/download/#section=windows
• XAMPP:
XAMPP is a free and open-source cross-platform web server solution stack package developed by
Apache Friends, consisting mainly of the Apache HTTP Server, Maria DB database, and
interpreters for scripts written in the PHP and Perl programming languages.
4.2.3 Database:
Database is the main part of this course that exist on web server. In this section, a brief overview
of the database related terminology is presented.
• MySQL:
MySQL is a free, open-source, and the most popular relational database management system
(RDBMS).
• PHPMyAdmin:
PHPMyAdmin is a free and open source tool written in PHP intended to handle the
administration of MySQL with the use of a web browser.
5.1 Task 1
Study HTML Tags used for creating web interfaces.
5.2 Task 2
Study about CSS and its types used for designing web interfaces.
• Download PhpStorm
fromhttps://www.jetbrains.com/phpstorm/download/#section=windows
• After downloading double click on .exe file the first window appear which is somehow like
given below figure:
• For proceeding Installation just click on Next button. After clicking the PhpStorm
installation starts with a splash screen, see Figure 2.
Give the path where you want to install PhpStorm, and Click Next button
• Now you can a check a bit launcher check box according to your system specification and
ignore other options which are not required now. Click Next Button
• You can create a shortcut folder for Phpstorm. But now in figure 4 you just click install
button to start the installation
• Now your PhpStorm installed successfully, if you want to run check the checkbox and
click on finish button, see figure 7
• Now when you clicking on Finish button the PhpStrom start with the following splash
Screen. You just click Do not import setting radio button and click Ok button
• Now for the time being we use phpstorm trial version so click. Evaluate for free radio
button and Evaluate button.
• Now just readout the license agreement and click on Accept button.
• Now you will create the project by clicking Create New Project option.
• The XAMPP installation starts with a splash screen, see Figure 10. Click “Next”.
• Choose which directory to install XAMPP. In Figure 12, It is being installed in a directory
xampp under drive D.
• Click Next to complete the installation. It may take a while. After the completion, it
prompts with a dialogue box, see Figure 13. Click “Yes” Button.
• The XAMPP installation completes. The XAMPP control panel can be started. Start
Apache and MySql by clicking the start button next to them, see Figure 14.
If Apache gives the error “Port 80 is in use by “Some Other Process” with PID X!”, we would
have to change the port see Appendix II.
• Go to Control Panel > System and Security > System and Click Advanced system
settings, See Figure 15.
• Variable name PATH is available double click it, otherwise click NEW, See Figure 17.
• Copy Path to MySQL > BIN folder from inside your XAMPP installation folder, See
Figure 18.
Page | 1
Lab 0: Introduction to SQL Tools and Techniques
• Paste the copied path in Variable Value field for the Variable Name PATH. See Figure
19.
• Open Statement prompt and Write statement MySQL then press Enter key, See Figure
20.
Page | 2
Lab 0: Introduction to SQL Tools and Techniques
7. Practice Task
• Visit w3school.com and start studying about HTML and CSS and make report about
HTML Tag and CSS and its types. The report contains tags and their description.
The lab instructor will give you unseen task depending upon the progress of the class.
9. Evaluation criteria
The evaluation criteria for this lab will be based on the completion of the following tasks. Each
task is assigned the marks percentage which will be evaluated by the instructor in the lab
whether the student has finished the complete/partial task(s).
Table 6: Evaluation of the Lab
Sr. No. Task No Description Marks
10.1Slides
The slides and reading material can be accessed from the folder of the class instructor available
at \\fs\lectures$\
11. REFERENCES:
Page | 3
Lab 0: Introduction to SQL Tools and Techniques
While starting the Apache server, if port default port (80) is already being used by some other
application, it would display an error in XAMPP Control Panel as shown in Figure 23. We can
change the port by performing the following steps,
In 80 is in use then you will click on “Config” button infront of “Apache”, select “httpd.conf”
from the menu. Httpd.conf file will be opened in NotePad, Find “Listen 80” and change the port
80 to someother value of your choice. i.e. 8082.
Page | 4
Lab 0: Introduction to SQL Tools and Techniques
Figure 4
Figure 5
In 443 is in use then you will click on “Config” button infront of “Apache”, select
“httpdssl.conf” from the menu.
Httpd-ssl.conf file will be opened in NotePad, Find “Listen 443” and change the port 443 to
someother value of your choice. i.e. 444,
Page | 5
Lab 0: Introduction to SQL Tools and Techniques
Figure 6
Figure 7
Page | 6
Lab 0: Introduction to SQL Tools and Techniques
Figure 8
Figure 9
Page | 7
Lab 01: Introduction to SQL Tools and Data Definition Language (CREATE)