Create an SQL Query to show
how many customers there are in each state.
Sample results
ST CUST_COUNT
-- ----------
CA 1
GA 1
CO 2
DC 1
WA 4
BC 1
The Query is:
SELECT State AS ST, COUNT(CustomerID) AS CUST_COUNT
FROM CUSTOMER
GROUP BY State;
Create an SQL Query to show how many customers there are in each state. Sample results ST CUST_C...
Write one DDL statement to add ‘C_999’ as a new constraint in
Sales. This constraint ensures that no sale has a SalesPrice value
higher than AskingPrice value. This statement should only affect
new Artwork WorkID Title Copy Medium Description ArtistID Client
ClientID LastName FirstName Street City State ZipPostalCode Country
AreaCode PhoneNumber Email Sales DateAcquired AcquisitionPrice
AskingPrice DateSold SalesPrice ClientID WorkID rows inserted into
Sales in the future but not existing rows. If constraint ‘C_999’
needs to be deleted from Sales...
Suppose ‘ON UPDATE CASCADE’ is included in a foreign key
constraint of AWS. Explain its actual meaning and implication in
AWS.
Sales DateAcquired AcquisitionPrice AskingPrice DateSold SalesPrice Client ClientID Artwork LastName FirstName Street City State ZipPostalCode Country AreaCode PhoneNumber Email WorkID Title Copy Medium Description ArtistID ClientlD WorkID
The Chinook team would like to
throw a promotional Music Festival for their top 10 customers who
have spent the most in a single invoice. Write a query that returns
the first name, last name, and invoice total for the top 10
invoices ordered by invoice total descending.
MediaType Artist Album Track Artistld Albumld MediaTypeld Trackld Title Name Name Name Artistld Albumld MediaTypeld Genreld Composer Genre Playlist Track Playlist Milliseconds Genreld Playlistld Playlistld Name Bytes Name Trackld UnitPrice InvoiceLine Employee...
Write an SQL query against the Chinook Database v1.4. Each query
must run successfully using DB Browser for SQLite. Create the exact
query below. Must use sub query. I saw that a
similar solution for this question used IF and CONCAT functions
which do not work and return errors. If it is possible to use the
CASE function in place of IF that would be greatly appreciated.
Also I really hate to ask but if it could be organized neatly...
Using the database: Write SQL queries for each of the questions
below.
1. Find the media type which
has 100 or more tracks. Print the name of such media type. Number
of rows returned in the result = 3
A) Find the playlists which have one or more tracks that have
never been purchased in California (CA). Print the Id, and the name
of such playlists. Number of rows returned in the result = 18
B) Find the customers who...