Course Notes
Use this workspace to take notes, store sample queries, and build your own interactive cheat sheet!
You will need to connect your SQL cells to an integration to run a query.
- You can use a sample integration from the dropdown menu. This includes the Course Databases integration, which contains tables you used in our SQL courses.
- You can connect your own integration by following the instructions provided here.
Note: When using sample integrations such as those that contain course data, you have read-only access. You can run queries, but cannot make any changes such as adding, deleting, or modifying the data (e.g., creating tables, views, etc.).
SQL - Structured Query Language SQL Server - relational database system developed by Microsoft Transact SQL(TSQL) - Microsoft's implementation of SQL with additional functionality
Scenario: Going to the store SQL-Server: The store containing databases and tables Queries: how we pick different items, from different aisles, and load up our cart SELECT statement: key term for retrieving data
SELECT description FROM grid;
FROM statement: specify the location in a table
"Selecting more that one column" SELECT artist_id, artist_name FROM artist;
"Query formatting" SELECT description, event_year, event_date FROM grid;
similar to: SELECT description, event_year, event_date FROM grid;
"SELECT TOP()" -returns a limited amount of rows
--Return 5 rows SELECT TOP(5) artist FROM artists;
--Return top 5% of rows SELECT TOP(5) PERCENT artist FROM artists;
"SELECT DISTINCT" --return unique rows SELECT DISTINCT nerc_region FROM grid;
"SELECT " --Return all rows SELECT FROM grid;
*not suitable for large tables or production code *better to explicity select columns
Take Notes
Add notes here about the concepts you've learned and SQL cells with code you want to keep.
Add your notes here
-- A sample query for you to replace!
SELECT
*
FROM books