SQL and Basic Statement{5}

In the article “Introduction to SQL” by authors Thomas A. McGlynn and Maria Nieto-Santisteban, the authors explain what is SQL and a few example how to use SQL. SQL is a Structured Query Language, “a language in which describes how to create, update and query relational database.” SQL also is useful to get information out of the database. There are different DBMS and within these DBMS they have their own command but standard SQL command like: “Select”, “Insert”, “Update”, “Delete”, “Create”, and “Drop” are the same through out all the DBMS so learning SQL is a big advantage for database user.

A few SQL syntax:


Create a table: CREATE TABLE tableName (name dataType1 Null/Not Null)

Delete a table: DROP TABLE tableName

Adding a row: INSERT INTO tableName VALUES(val1, val2, …)

ORDER BY: SELECT columnName FROM tableName ORDER BY columnName ASC/DESC

*(ASC – ascendent, DESC – descendent)

To update : UPDATE tableName SET columnName1 = value  WHERE columnName2 = value

This is my first time learning about SQL even though I have learned about relational database prior to this class. Because of the small size of the database, I used to go directly into the database to update the data rather than using SQL. I can see that it will be hassle to update a big database without SQL. After the reading, I think SQL is easy to use and very useful for database user.

McGlynn, T. A., Nieto-Santisteban, Ma. (2007). The National Virtual Observatory Book. Astronomical Society of the Pacific, 382,645-656.