Summary

In this chapter, you learned how to query a single table. This included learning how to use the SQL SELECT statement and the FROM, WHERE, and ORDER BY clauses.

With the SELECT and FROM clauses, you learned how to select distinct records with the DISTINCT keyword, how to limit results with the LIMIT keyword, how to save a SQL query to a file, and how to add proper comments to SQL code. 

With the WHERE clause, you learned how and when to use the WHERE clause, along with AND, OR, NOT, IN, and BETWEEN, and how to use with the percent sign (%) and underscore (_) wildcards. 

With the ORDER BY clause, you learned how to order query results by one or more columns. 

Finally, you learned how to tell which index your query is using and if you need additional indexes by using EXPLAIN or the visual explain tool in MySQL Workbench. You also learned how to add an index to make the query more efficient. 

In the next chapter, you will learn how to query multiple tables. This includes learning how to use SQL joins. You will learn about INNER, OUTER (LEFT, RIGHT, and FULL), and advanced joins (cross and self joins). Finally, you will learn about set theory, including unioning queries. 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.253.62