Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

STUDENT Observe the table STUDENT: 1 . How many records will the following query on table STUDENT return? SELECT * FROM student WHERE name LIKE

STUDENT
Observe the table STUDENT:
1.
How many records will the following query on table STUDENT return?
SELECT * FROM student WHERE name LIKE '%or%';
A)0
B)2
C)3
D)4
2.
What will be the result of the following query on table STUDENT?
SELECT COUNT(*) FROM student GROUP BY class HAVING COUNT(*)<3;
A) Number 5
B) Number 2
C) Numbers 2 and 3
D) Numbers 1 and 1
StudentID SSN Name Class
D111111-11-1111 Connor Freshman
D222222-22-2222 Trevor Freshman
D333333-33-3333 Connor Sophomore
D444444-44-4444 Parker Sophomore
D555555-55-5555 Connor Sophomore
Created by Deepak Agrawal
HAPPY INSURANCE
Observe the HAPPY INSURANCE DB:
CLIENT
AGENT
AREA
3.
What will be retrieved by the following query on the table CLIENT?
SELECT DISTINCT clientname FROM client WHERE clientspousename = 'Amy';
A) Name Amy twice
B) Name Amy
C) Name Cole
D) Names Andy and Cole
ClientID ClientName ClientAgent ClientSpouseName
C111 Tom A1 Jenny
C222 Karin A1 Bill
C333 Cole A2 Amy
C444 Dorothy A2
C555 Andy A3 Amy
C666 Tina A3 Matt
C777 Christina A4 Mike
AgentID AgentName AgentArea AgentRating AgentYearOf
Hire
SupervisedB
y
A1 Kate 11011990
A2 Amy 2922009 A1
A3 Luke 31001992
A4 James 3902010 A3
AreaID AreaName AreaHQ
1 East Boston
2 West San Francisco
3 Central Chicago
Created by Deepak Agrawal
4.
Write an SQL query for the HAPPY INSURANCE database that will list the agent ID and
agent name for each agent hired before the year 2000.
5.
Write an SQL query for the HAPPY INSURANCE database that will display the average
rating for all agents.
6.
Write an SQL query for the HAPPY INSURANCE database that will for each area display the
area ID and the number of agents in the area.
7.
Write an SQL statement for the HAPPY INSURANCE database that adds the column
ClientPhone to the table CLIENT.
8.
Write an SQL query for the HAPPY INSURANCE database that will, for each agent, retrieve
the name of the agent and the name of his or her supervisor. (The name of the agent will be
retrieved even if he or she has no supervisor.)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Using Entity Relationship Diagrams

Authors: Sikha Saha Bagui, Richard Walsh Earp

3rd Edition

103201718X, 978-1032017181

More Books

Students also viewed these Databases questions