MySQL Tips and Tricks

Query Syntax – an Introduction to SQL SELECT Statements by Kelly Lynn

  When you’re first learning SQL, or Structured Query Language, the first thing you’ll want to practice is querying a database for information. The SQL syntax you’ll write to get this information is called a SELECT statement. SELECT statements just return data that’s already in the database, protecting you from any accidental changes or deletions to your information. Let’s walk through some basic SELECT statements using the SalesTable dataset shown below: View all data in the database table – To see all the data in a table, use this syntax: SELECT * FROM SalesTable; The keyword “SELECT” tells the database that you want to see the data in the table as opposed to creating, updating, or deleting it. The “*” symbol directs the database engine to return all the columns … Continue reading

How to Create a Database in MySQL by Kelly Lynn

  Whether you want to keep a record of patients' appointments, track profits and sales for your business, or even store parts of resumes using MySQL, creating databases and tables are the first step. This tutorial will show you how to make databases and tables, insert values and load data into them, update entries, and drop databases and tables. To start off, create a database. mysql> CREATE DATABASE mydb; Now you will need to select this database so that you can use it. mysql> USE mydb; That was easy, huh? Things get more complicated when you start making tables, deciding on their structures and interconnections, and updating and selecting values. We'll stick with something simple for now. mysql> CREATE TABLE resumes (name VARCHAR(30), phone_number VARCHAR(20), references TEXT, email VARCHAR(30), birth … Continue reading