1. Engineering
  2. Computer Science
  3. easy sql questions will upvote 1 download the following ms...

Question: easy sql questions will upvote 1 download the following ms...

Question details

****Easy SQL questions, Will upvote:****

1) Download the following MS SQL Query files:

DBP-e14-MSSQL-QACS-CH02-Create-Tables.sql

DBP-e14-MSSQL-QACS-CH02-Insert-Data.sql

----------------------

Download from here:

https://drive.google.com/drive/folders/1LTyij-Wo2kL2HEtBSfW00lZf84WTjRrz?usp=sharing

----------------------

2) In SQL Server Management Studio, create a new database called QACS

3) From MS SQL Server Management Studio, click File èOpen èFile and select the Create-Tables file you downloaded.

4) Execute the Create Table script ONLY ONCE. If you try to re-execute, you get error message. Verify that the tables are created. Make sure you refresh the object explorer view. You should see five tables being created.

5) Repeat steps 3, 4, and 5 for the second file (Insert-Data) to populate the tables. Again, execute the script ONLY ONCE. If you try to re-execute, you get error messages. Verify that the tables are populated using “Select Top 1000 Rows”.

For each answer, add a comment line right before it with the question letter such as:

/* A */

------------------------------------------------

Using the QACS database answer the following questions:

A. Show all data in each of the tables.

B. List the LastName, FirstName, and Phone of all customers

C. List the LastName, FirstName, and Phone for all customers with a FirstName of 'John'.

D. List the LastName, FirstName, and Phone of all customers whose first name starts with 'D'.

E. List the LastName, FirstName, and Phone of all customers whose last name includes the characters 'ne'.

F. List the LastName, FirstName, and Phone for all customers whose eighth and ninth digits (starting from the left) of their phone number are 56. For example, a phone number ending in “567” would meet the criteria.

G. Determine the maximum and minimum sales Total.

H. Determine the average sales Total.

I. Count the number of customers.

J. Group customers by LastName and then by FirstName.

K. Count the number of customers having each combination of LastName and FirstName.

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution