Uncovering the Magic of SQL Query: My Latest Tutorial Progress


    Last week I spent time learning to speak in SQL; SQL is a programming language after all. I was able to use SQL syntax to input commands that were able to create data (e.g., INSERT INTO table_name, ALTER TABLE table_name), access data (e.g., SELECT name FROM table_name or SELECT * FROM table_name), create tables, update data (e.g., UPDATE table_name), and delete data (e.g., DELETE FROM table_name) that was in a database. 

    My learning journey this week has involved discovering the importance and function of queries. Ultimately, queries speaks to the primary function of the SQL language. At the heart of SQL lies the ability to extract information from a database. This process is called querying. A query can be thought of as way to ask a database a question, and for the database to then reply with answer. This process allows one to access and make sense of the data in a database, thus unleashing its power as a valuable resource for analysis,

🠗🠗🠗

    The first step was to learn how to query for multiple columns in one search statement. I was able to input the statement and return data that is only contained in the columns noted, as opposed to the original 5 columns that were in the table. I was also able to rename columns using an alias via using AS in leu of FROM in a SELECT statement. One important aspect of the AS clause is that it can be used to make an alias for table names. This can come in handy when one is working with multiple tables in a single query. Also, being able to use alias makes results more readable, and queries more concise.


    I also learned how to filter the data that is returned by using comparison operators added to conditions, and returning values that have a alike values. I had practice with using SQL's If-Then logic by way of working with CASE statements. I found CASE statements to be exceptionally powerful as it does allow one to add conditional logic to queries. The standard CASE statement, once executed, will first evaluate its proposed condition, then return the results of said condition only if the condition is found to be true.. If there are multiple conditions, as seen in the above example, then each condition is evaluated. Where conditions are found to be true the THEN action is then applied, but, if conditions are found to false then the ELSE action will be applied. 

    In the upcoming week, I am going to explore how to effectively use the SQL language to execute calculations! 

Comments

Popular posts from this blog

Building a Site Pt. 3: Team feedback and tweaks

Building a Site, Part 4: Adjusting the site

Creating a Webpage with Google Sites