Lab Objective:
The objective of this lab exercise is to learn some simple SQL.
Lab Purpose:
SQL is a programming language used to execute queries against the database to retrieve data. These queries can be relatively complex, grabbing multiple columns from a variety of fields, and bringing them together into a single result set. You can also insert, update, and delete records from a database. SQL has several functions that can be used to create new databases. Among other things you can do, you can also create tables, and stored procedures, and views within that database. You can even set permissions on those tables, procedures, and views.
In this lab, you will create a table with two fields using SQL and after building a schema, use the SQL query commands to print the table.
Lab Tool:
You can use sqlfiddle.com, which is a tool to test your SQL scripts.
Lab Topology:
See above.
Lab Walkthrough:
Task 1:
Open sqlfiddle.com in a browser window.
Task 2:
On the left window, create a table named ‘test’ with two fields ‘first name’ and ‘last name’ using the below command. Press the ‘Build Schema’ button when done.
Create table test (
first_name VARCHAR(150),
last_name VARCHAR(150)
);
INSERT INTO test (first_name, last_name)
VALUES
(‘Adams’, ‘Baker’),
(‘Frank’, ‘Ghosh’);
Task 3:
On the right window, query the table created in Task 2 using the following command and press ‘Run SQL’.
SELECT * from test;
Here is the entire screen and test output.
Notes:
You can type in the data or get it from the resources page on 101labs.net for the Network+ and copy/paste it.


