Code:
select customerid,firstname,lastname,address,city,country from customers where customerid=16;
What is the city and country result for CustomerID 16?
Answer : Mountain View USA
Code:
sselect c.FirstName , substr(c.FirstName, 1, 4) as FirstNameShort , c.LastName , substr(c.LastName, 1, 2) as LastNameShort , LOWER(substr(c.FirstName, 1, 4) || substr(c.LastName,1,2)) as NewID from Customers c;
What is the final result for Robert King?
Answer : RobeKi
Code :
select e.LastName,e.FirstName,e.BirthDate,DATE('now') - e.BirthDate as Age,DATE('now') - e.HireDate as Tenure from Employees e where Tenure >= 15 order by e.LastName asc;
What is the lastname of the last person on the list returned?
Answer : Peacock
Code :
select * from Customers c where c.Company is null;
Are there any columns with null values? Indicate any below. Select all that apply.
Answer : Company, Phone, Fax, Postal Code
Code :
select c.City, count(c.CustomerId) from Customers c group by c.City order by count(c.CustomerId) DESC;
Which of the following cities indicate having 2 customers?
Answer : São Paulo, Mountain View, London
Code :
select c.FirstName || c.LastName || i.InvoiceId as NewInvoiceId from Customers c left join Invoices i on c.CustomerId = i.CustomerId where NewInvoiceId like 'AstridGruber%' order by c.FirstName, c.LastName, i.InvoiceId;
Select all of the correct "AstridGruber" entries that are returned in your results below. Select all that apply.
Answer : AstridGruber273, AstridGruber296, AstridGruber370