select Name
from Track
where AlbumId in (
select distinct AlbumId
from Album
where ArtistId in (
select distinct ArtistId
from Artist
where Name = 'Miles Davis'
)
)
order by Name
In this query, the innermost query find the artistId using artistName.. Once we find the artistid, then we search the albums by this artist and find albumIds from album table.. using these AlbumIds, We find the tracks from track table and then alphabetically sort them.
Using SQL Lite to code /* 2. Write a query that reports only the track names...
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...
1. Given the table above, write an SQL Query that will select
only those individuals that scored 800 or higher, sorted by last
name in ascending order.
2. Given the table above, write an SQL Query that will add a new
entry for John Smith with a score of 834. The field id is auto
incrementing.
3. Given the data below, write an SQL Query that will delete any
values where the score is below 740.
id Fname Lname Score...
5. Write the SQL to list the Total Tracks
and Music Label for all CDs with less than 10 tracks.
6. Write the SQL to add the following CD information to this
database.
a. CD Title is Marvin Gaye’s Hits
b. From the year is 1988
c. The Music Label is Motown
d. The CD serialized code is WD72645
e. The Tracks and Track Lengths are: i
. Grapevine 3.12
ii. Let’s Get It On 3.55
iii. Too Busy Thinking...
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...
SQL query: Write a SQL statement using the employees table and retrieve employees whose monthly salary (including their commission) is greater or equal to 5,000 but less than or equal to 17,000 (we are assuming the salary on the table is monthly). In other words, if their monthly salary was 1000 and their commission was .2, their total monthly salary would be 1200 and given the criteria above this instance would not be selected. Please display the full name of...
Express the following queries in SQL. Only standard SQL syntax is allowed. Each query should be answered in a single SQL statement: 1. Find the name of suppliers that are located in Mumbai. 2. Find the name of suppliers and the names of parts they sell. List the result in descending order suppliers name. 3. Find the names of parts that are sold by exactly two suppliers. 4. Find the names of parts that are sold by all suppliers. 5....
The Ch07_ConstructCo database stores data for a consulting company that tracks all charges to projects. The charges are based on the hours each employee works on each project. The structure and contents of the Ch07_ConstructCo database are shown in Figure P7.1.Note that the ASSIGNMENT table in Figure P7.1 stores the JOB_CHG_HOUR values as an attribute (ASSIGN_CHG_HR) to maintain historical accuracy of the data. The JOB_CHG_HOUR values are likely to change over time. In fact, a JOB_CHG_ HOUR change will be...
Database For this lab you will be using SQL SELECT statements to query your database tables. You will be turning in the results of the following queries: 1. List all Patients and what Bed they are assigned to 2. List all patients who had Treatments and what Treatment they received 3. List all patients who had tests and what Test they had 4. List the employees (doctors, nurses, etc.) who assisted each patient. 5. List all patients in alphabetical order...
For each question, write a SQL query and save it as a "sql" file using a different query 2, etc. Please execute these queries sequentially name, for example, query1.query product id (PK) category brand production_cost (Not Null) (FK) name (Not Null) Toothpaste Supermarket 1 Multivitami Supermarket 2 Shampoo acket T-shirt Supplements Supermarket Department4 Department5 Pharmacy Pharmacy 6 6 10 Query1. Update the Product table by adding another column as shown above ucts (name) with uery2. Retrieve all the uction cost...
Write a C++ code to make a simple program that imports the input
file in and gets the results as specified
Please follow the instructions and paste the code below as the
answer with a screenshot of the output to prove it worked.
Input file ->
https://www.dropbox.com/s/444jofkchu6ylwr/names.txt?dl=0
Scoring Names You will be using the provided names.txt file, text file containing over five-thousand first names, and you will calculate a score for each name. Begin by reading the names from the...