Explains why there are different versions of SQL, and helps student to identify which version they are using
- [Instructor] There's one version of SQL for each company that provides database software. Oracle has a version, as does Microsoft. There are also open sourced varieties such as PostGreSQL and MySQL. Basic commands are similar across all of them, but advanced commands can be wildly different or even unavailable in some versions. Different types of SQL are told apart either by the vendor name or by the name of the product the vendor sells. In particular, if you hear SQL developer, that is Oracle's software product, while SQL server belongs to Microsoft.
If you don't have access to a database or server, you can follow this course step by step by downloading some software and data. Your version of SQL in this case would be MySQL. If this is you, please skip the rest of this video, watch the next video to help you understand your target set up, and then follow instructions in the final video of this chapter. Before we start writing queries, it's a good idea for you to identify the type of SQL your database is using. It will probably be Oracle, Microsoft, PostGre, or MySQL, and so this course focuses on these four varieties.
If it's not clear which one you're using, ask your IT department or Google the product name if you can see one. If this isn't an option, you can usually find out by running a line of SQL. I say usually here because if you're using a less common version of SQL, the following method might not work. You should have an interface where you can write your SQL query. It might be part of your reporting software or a direct interface to your database. In this location, try running the following command, select version ();.
If it returns you number around nine, you're almost certainly using PostGre. If it returns you around five, you're probably using MySQL. If it doesn't work, try select @@version. If this works, you're using Microsoft. If that doesn't work either, try select * from v$version. If this works, you're using Oracle. If you haven't managed to establish which version you're using, don't worry.
The vendor will become clear through the course anyway as certain commands will only work in one or other language. Once the course is over, and you're building queries on your own, you might want to ask a question or read answers in a forum. It's important to know which type of SQL you're using before you do this so you can get help that will work on your database. The key point is to get started in the right type of SQL, if there is a right type for you. If there's no right type for you, I suggest you follow along this course by learning MySQL.
Join Emma Saunders as she shows you how to design and write simple SQL queries for data reporting and analysis. Review the different types of SQL, and then learn how to filter, group, and sort data, using built-in SQL functions to format or calculate results. Learn a bit about data types and database design. Discover how to perform more complex queries, such as joining data together from different database tables. Last but not least, Emma shows how to save your queries as views, so you can run them again and again.
- Using different versions of SQL
- Retrieving data with SELECT statements
- Filtering and sorting your results
- Transforming results with built-in SQL functions
- Grouping SQL results
- Merging data from multiple tables
- Identifying data types, and how to make sense of your database design
- Saving SQL queries