Posts

Showing posts from April, 2022

Agregate functions in SQL

Image
      Aggregating functions is used to find values out of our data in SQL. Say for example if we have a books database we can group our data by authors then find out how many total books an author has written  by aggregating that query. There are many different aggregating functions in SQL but the ones I am going to focus on today are COUNT, AVG, and MIN.     The COUNT function allows you to count the total number of data in a specific row after we group our data. For example in the screenshot I attached we are using the books table. We are gathering all the first names and last names from the table. Once we do that we group by author first name that way any authors that have the same first name in our table. Once we do that we call the function COUNT(*) to count the number of duplicates in that row. That would give us the total number of books that specific author has written based off our database.     The next function is AVG. This allows you to get the AVG of data that you group by

SQL CRUD Commands

Image
      In SQL there is an acronym know as CRUD. This stands for create, read, update, and delete. These 4 terms are the 4 basic actions that are used to manipulate your database. I am going to briefly touch each one because there is so much to write about in each CRUD command. One you understand these 4 commands you have a good basic understand of how to write SQL queries.      We are going to start with create. The create command is when a user inserts new data(row) into a database. This is done using the INSERT INTO key. The way the format goes is you do INSERT INTO <table_name>(column_1, column_2) VALUES ('value_1',value_2').  After table name you designate the name of the columns that you are inserting data into and you must have the same amount of values after the VALUE keyword. In SQL every command also ends with a ; symbol just like in java. Your values must also have the same data type as the columns you are selecting or else this will cause an error.     The n

INSERTING DATA SQL

Image
      This week in my SQL journey I learned about how to insert data into table in a database. In this case I already have a database I have created called book_shop. I created this database by following along a curriculum that I found on Udemy. I already have MYSQL workbench connected with MYSQL terminal which makes it a lot more user friendly. In order to view the databases you have created in SQL you call the command SHOW DATABASES;  and it shows all the databases that are currently in your DBMS. In the screenshot I attached you will see there is a book_shop and customer_orders which I have created. The other 4 are databases that default in every MYSQL database.     In SQL the command that is used to insert data is INSERT INTO <table_name, table_name> (column_name) VALUES (value, value);.  The words that are capitalized are the actual SQL keywords and the other would just be the names of the table and columns you are using. The first parentheses after table_name is where you d

SQL

Image
         This week I will be sharing the progress I have made in my android development journey. A big part of developing apps is also being able to store data in an organized way. The most popular way big companies do that is by using a database management system as known as DBMS. I used to always hear about SQL and MYSQL and wondered what is the difference? I took a dive into databases and learned that SQL is the language itself and MYSQL is the database management system that actually holds the data. There are many different types of DBMS suck as MYSQL, Oracle, Microsoft SQL, and others. I chose MYSQL because I looked online to different internship opportunities and it looks like the most popular is MYSQL.      I started with first having to install the correct programs on my computer. This was a bit difficult on its own since databases are a bit complicated. I first installed MYSQL command line client. This is just a black terminal where you can write your MYSQL code. It is not use

Android Application Buttons

Image
      This week I learned a bit more about the way Android applications are built. I started learning about the button objects in android development. A button is just what it sounds like a button you attach to the screen however the logic of the button is attached by your java file. In this week I decided to have different buttons on the screen and depending on what button the user clicks a toast message would appear. A toast message is just a message that appears that stays on your screen for 3 seconds the goes away. The toast message that I made appear just says "You have just clicked the (color) button". It may seem simple but there are many things going on in the background.          When I placed these button objects on the screen I attached an ID to them to make a connection to them in my java file. Once they are all properly identified I connect them in my java file by calling a built in method. Once I did that I implemented an interface that has a method called on on