Introduction to SQL
Here you can access the books
table used in the course.
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.).
Take Notes
Add notes about the concepts you've learned and SQL cells with queries you want to keep.
SELECT is used for picking up the fields where as FROM is used for picking up the table. For example: SELECT title, FROM books; will bring you the list of the titles from the book table.
-- Add your own queries here
SELECT *
FROM books
Explore Datasets
Use the books
table to explore the data and practice your skills!
- Select only the
title
column. - Alias the
title
column asbook_title
. - Select the distinct author names from the
author
column. - Select all records from the table and limit your results to 10.
Aliasing the name. Alias AS command only used when you want to rename a column on the table. You can do this by SELECT name AS first_name, year_hired FROM employees; this will change the field name. Also, if there are Choose multiple fields, you can use distinct to get the data you required from different fields. Use: SELECT DISTINCT dept_id, year_hired FROM employees; . Finally you can also Save the query throug VIEW. To do this: CREATE VIEW employee_hired_years AS Select id, name, year_hired FROM employees;