Question
to http://adbc.kennesaw.edu/ Queries Basic This lab will use all 7 tabs. Write all SQL statements in the same script file and save into a text
to http://adbc.kennesaw.edu/
Queries Basic
This lab will use all 7 tabs. Write all SQL statements in the same script file and save into a text file called Lab2-queriesbasic.sql. Add a comment block to the top of your script as follows:
/***************************/
/* Name: */
/* Class: CS 3410 */
/* Term: Summer 2017 */
/* Lab #: 2 */
/***************************/
Page 1 of 3
For each answer, add a comment line right before it with the question such as:
/* What pets are in the database?*/
Select Name
From PET;
Projection:
Identify the SQL that answers each of the following questions:
What pets are in the database?
What are the names of the pets in the database?
What are the ID numbers and breeds of the pets in the database?
What are the names, species, and breeds of the pets in the database?
What are the names, genders, and altered status of the pets in the database?
Restriction:
Identify the SQL that answers each of the following questions:
What dogs are in the database?
What cats are in the database?
What rabbits are in the database?
What pets are female?
What pets are male?
Function:
Identify the SQL that answers each of the following questions:
What is the total number of scores received for the tests taken?
What is the sum of the scores of the tests taken?
What is the average of the scores of the tests taken?
What is the lowest score of the tests taken?
What is the highest score of the tests taken?
Group By:
Identify the SQL that answers each of the following questions:
What is the total number of scores received by each student?
What is the total number of scores received for each test?
What is the sum of the scores for each student?
What is the average score for each test?
What is the average score for each student? What is the lowest score received for each test? What is the lowest score received by each student? What is the highest score received for each test? What is the highest score received by each student?
Page 2 of 3 Having:
Identify the SQL that answers each of the following questions:
What is the total number of scores for each test with a total score of at least 200?
What is the total number of scores for each student with a total score of at least 200?
What is the total number of scores for each student who has taken exactly three tests (ie has 3 scores)?
What is the total number of scores for each test that has been taken by exactly 3 students (ie has 3 scores)?
What is the average score for each test which has received exactly three scores (ie taken by 3 students)?
What is the average score for each student with exactly three scores (ie taken 3 tests)?
What is the lowest score for each test with exactly three scores (ie taken by 3 students)?
What is the lowest score for each student with exactly three scores (ie taken 3 tests)?
What is the highest score for each test with exactly three scores (ie taken by 3 students)?
What is the highest score for each student with exactly three scores (ie taken 3
tests)?
Distinct:
Identify the SQL that answers each of the following questions:
What are the names of all of the different pets in the database?
What are the distinct names of the pets in the database?
What are the species of all of the different pets in the database?
What are the distinct species of the pets in the database?
What are the genders of all of the different pets in the database?
What are the distinct genders of the pets in the database?
What are the genders and altered status of all of the different pets in the database? What are the distinct genders and altered status of the pets in the database?
Order By:
Identify the SQL that answers each of the following questions:
Who are the pets in the database, sorted by ID number?
Who are the pets in the database, sorted by name?
Who are the pets in the database, sorted by name, in reverse order?
What are the names, species, and breeds of the pets in the database, sorted by ID number?
What are the names, species, and breeds of the pets in the database, sorted by name?
What are the names, species, and breeds of the pets in the database, sorted by name, in reverse order?
What are the names of the pets in the database, sorted by ID number? What are the names of the pets in the database, sorted by name?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started