Levels Tought:
Elementary,Middle School,High School,College,University,PHD
Teaching Since: | Apr 2017 |
Last Sign in: | 10 Weeks Ago |
Questions Answered: | 4870 |
Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
For this assignment, you will need to write a query for each of the cases mentioned below. All queries should be written against tables that you have created in your previous assignment (see attached for previous assignment).
1- Get the list of all Shippers with the character ‘A’ in any place in their CompanyName (query against the Shipper table).Â
2- A query to get the record count in the Employee table.Â
3- A Query to return all Emp_ID, Emp_Fname, Emp_Lname, Emp_Email in theEmployee table. Order the result on Emp_Fname and Emp_Lname in descending order (query against the Employee table).
4- A query to get the count of customers who are in one of the New England states(query against the Customer table).
5- A query to get the list of all Customers from ‘MA’ who are not from Boston.
Â
Â
___________________________________ CREATE TABLE Shipper ( ShipperID CHAR(2) NOT NULL, CompanyName CHAR(20), Phone CHAR(15) ); ____________________________________ CREATE TABLE Employee ( Emp_ID CHAR(3), Emp_Fname CHAR(10) NOT NULL, Emp_Lname CHAR(12) NOT NULL, Emp_Password CHAR(8) NOT NULL, Emp_email CHAR(15) ); ALTER TABLE Employee ADD CONSTRAINT PK_employee_Emp_ID PRIMARY KEY (Emp_ID); _______________________________________ Create TABLE Customer ( Cust_ID CHAR(5) NOT NULL, Cust_Fname CHAR(10) NOT NULL, Cust_Lname CHAR(12) NOT NULL, Cust_Password CHAR(8) NOT NULL, Cust_email CHAR(15), Cust_address CHAR(30), Cust_city CHAR(12), Cust_state CHAR(2), Cust_zip CHAR(9), Locked_flag CHAR(1), Emp_ID CHAR(3) ); ALTER TABLE Customer Add constraint PK_customer_Cust_id primary key (Cust_ID); ALTER TABLE Customer Add constraint FK_Customer_Emp_ID foreign key (Emp_ID) references Employee (Emp_ID);
Attachments:-----------