Question: SQL Data Lab 01: SQL Data Manipulation Lab submission details are listed at the bottom of this file. Consider the Branches table as follows. branch
SQL Data

Lab 01: SQL Data Manipulation Lab submission details are listed at the bottom of this file. Consider the Branches table as follows. branch No B005 B007 B003 B004 B002 street 22 Deer Rd 189 Hudson St 81 Shepford St 250 Fifth Ave 56 Clover Dr city London New York Glasgow New York London postcode SW14EH 10013 G119QX 10001 NW16EU employees 18 22 12 32 26 Preliminary Tasks: A. Copy and paste the following code into your SQL Editor, then execute it. This code will create the table Branches and insert the above five records into it. CREATE TABLE Branches ( branchNo VARCHAR (4), street VARCHAR (20), city VARCHAR(15), postcode VARCHAR(10), employees INTEGER) ; INSERT INTO Branches VALUES ('B005', '22 Deer Rd', 'London', 'SW14EH', 18); INSERT INTO Branches VALUES ('B007', '189 Hudson St', 'New York', '10013', 22); INSERT INTO Branches VALUES ('B003', '81 Shepford St', 'Glasgow', 'G1190x', 12); INSERT INTO Branches VALUES ('B004', '250 Fifth Ave', 'New York', '10001', 32); INSERT INTO Branches VALUES ('B002', '56 clover Dr', 'London', 'NW16EU',26) ; Note: To recreate the table, you will need to drop it first by running the following command. DROP TABLE Branches; B. To make sure all records are properly inserted, list the content of the Branches table by running the following statement. SELECT * FROM Branches; Lab Tasks: 1- Write the SQL statement that lists the cities of the branches. 2- Write the SQL statement that lists the cities of the branches without duplicates. Note: You should use the keyword DISTINCT to accomplish this task. 3- Write the SQL statement that lists the city and the employees sorted in the descending order of employees. 4- Write the SQL statement that lists the city and the employees sorted in the ascending order of employees. 5- Write the SQL statement that lists the branchNo, the street, the city, and the employees of branches with number of employees more than 20. 6- Write the SQL statement that lists the branch No, the street, and the city of branches from London or Glasgow cities. 7- Write the SQL statement that lists the branch No, the street, the city, and the employees of branches with number of employees between 18 and 30. Note: Use the keyword BETWEEN to accomplish this task. 8- Similarly, using a compound comparison search condition, write the SQL statement that lists the branchNo, the street, the city, and the employees of branches with number of employees between 18 and 30. Note: Don't use the keyword BETWEEN in this task
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
