1 / 1

In Class SQL-Out Cheat

In Class SQL-Out Cheat . Select SELECT column_name (s) FROM schema_name.table_name SELECT DISTINCT State FROM orderdb.Customer Grouping SELECT State, COUNT( FirstName ) FROM orderdb.Customer GROUP BY State; Ordering

yoshe
Download Presentation

In Class SQL-Out Cheat

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. In Class SQL-Out Cheat Select • SELECT column_name(s) FROM schema_name.table_name • SELECT DISTINCT State FROM orderdb.Customer Grouping • SELECT State, COUNT(FirstName) FROM orderdb.CustomerGROUP BY State; Ordering • SELECT State, COUNT(FirstName) FROM orderdb.Customer GROUP BY State ORDER BY COUNT(FirstName); Stats • SELECT COUNT(FirstName) FROM orderdb.Customer; • SELECT MAX(Price) FROM orderdb.Product; • SELECT MIN(Price) FROM orderdb.Product; • SELECT AVG(Price) FROM orderdb.Product; • SELECT SUM(Price) FROM orderdb.Product; Conditionals • SELECT * FROM orderdb.Customer WHERE State= 'NJ'; • SELECT * FROM orderdb.Customer WHERE State <> 'NJ'; • SELECT COUNT(ProductName) FROM orderdb.Product WHERE Price < 3 Sum • SELECT SUM(Product.Price*`Order-Product`.Quantity) FROM…… Using Where for InnerJoin • SELECT * FROM orderdb.Customer, orderdb.`Order` WHERE Cutomer.CustomerID=`Order`.CustomerID;

More Related