Showing posts with label SQL. Show all posts
Showing posts with label SQL. Show all posts

Tuesday, February 12, 2013

es queue el


Nathan gives a pretty good overview of the function of SQL servers, and the degree of standardization that is common to the language. As he mentions, it is important to have a Structured Query Language to manage databases in an understandable way, allowing us to find and modify data once the database has been created. After some initial confusion pertaining to the jargon used to describe how SQL works, I found the actual functions it implements to be very intuitive. Each function's name describes what it does. For example, the all-important SELECT function allows programs to search and retrieve data from a specific database table, with further modifiers embedded within the function to refine the search (FROM, WHERE, etc.), and organize the output (ORDER BY, GROUP BY). I found Wikipedia's explanation of this function (and others) very helpful.

Figure 1 - SELECT function explanation

I like that David describes the databases themselves as "glorified excel sheets," especially since this definition is coming from someone with some experience with databases. From my rudimentary understanding of the topic, that is exactly how I pictured and SQL database, some enormous table made up of labeled columns with rows of data beneath. It makes sense that by this system, and particular piece of data can be pinpointed by some row and column designation, much like an X and Y coordinate in the cartesian system.

What intrigued me most about this week's topic was not necessarily how the system works, but how often it needs to work. I gather from the articles I read, that every single user-interfaced program uses some form of database and query system to make it run. For simplified applications this may be a flat-file-database, as David explains. However it is my impression that, for the large majority of complex applications, the SQL format is used. A recent article puts into perspective the importance of the ability to manipulate and query these formatted data.  As our sensing capability and aptitude for data recording grows, the challenges involved in organizing, maintaining, and using this data also grows. For example in the medical field there are virtual reams of unused data pertaining to patient records, and no unified system for managing all of this. As data becomes more and more digitized, it seems reasonable that we must decide how we want to organize this data so that it is easily accessible when we need it. The SQL is currently the ANSI specified way to do that, and while it is not without complications, the basic structure of database and query language remains the same across the board.

Finally, one of the biggest issues in current SQL design is the timing of the SQL servers. Database size has grown significantly since the SQL language was invented, and as a result we are having to deal with time lag as SQL applications search through these seas of information for specific data. ANSI is still updating specifications, with its latest release in 2012, to account for the evolving nature of database organization and navigation.

References:

"Database Management: Big Data will soon be the norm" - Sunday Business Post


SQL For Dummies - 7th Edition





Structured Query Language


As everyone else has been saying, SQL (Structured Query Language) is a computer language that specifically manages databases.  It happens to be one of the first commercial languages developed by IBM in 1970.  In 1986 SQL became a part of the American National Standard Institution (ANSI) and the International Organization for Standards (ISO).  This is to help keep the SQL up to date as with all of the other technology.  There are still some issues, however, with SQL code.  This is due to the standards not being followed as strictly as they should.  This goes along the lines of what John said about interoperability.  The standards are there so that SQL will always remain interoperable.  However, if they aren’t followed as specified, that is when there become problems. 

SQL has 6 major language elements, also brought up by John, which are clauses, expressions, predicates, queries, statements, and insignificant whitespaces.  The use of these elements can be seen in the following figure. 



Note that insignificant whitespaces are “insignificant.”  SQL ignores spaces and therefore they can be used to make the language readable. 

SQL language is used for two major reasons updating data and retrieving data from a database.  Most databases use SQL, however, often times they have their own extensions that will only be used on that specific system.  Although SQL is the only thing needed to do the basic maneuvering of a database, which are: Select, Insert, Update, Delete, Create, and Drop.  For anybody interested in getting a tutorial in SQL they should visit the website SQLCourse.com and it goes through the steps in making a simple database using SQL. 

As David pointed out, SQL is a great resource to have and is much more efficient than using a flat file database.  I like his example about Facebook and filtering all of the information down to what pertains to you.  This put everything into perspective for me.  Reading the Wikipedia page on SQL and other sources I was not following.  Only when I read this example did I understand the function of SQL, which made the other literature easier to comprehend. 

Sources:


http://en.wikipedia.org/wiki/SQL

http://www.sqlcourse.com/index.html


SQL - The Language of Databases

SQL is a programing language that is very specialized and focused. While most programing languages can  be used to do a very complex series of different tasks, SQL is designed to do one complex task very, very well. The task that SQL is designed for is working with databases.

As David said, a database is just a huge, glorified excel sheet. This may sound great, but if it is put into scope, it becomes quite daunting. Like John, I have had some basic experience with coding, mostly Javascript and python, and so far I have only dealt with arrays, which are essentially very tiny databases, and trying to use the core language to something as simple as remove an element and add another takes a surprising amount of code to do properly. I have not personal experience with SQL, but if editing a database is as easy as some of the guides I found seem to indicate, it looks like it could be a real time saver and make database use so much easier.

As both speakers who have come to our class have said, the drawing programs we use to complete our projects are really just databases with a graphical interface. If you break it down far enough, every click is really just using a giant algorithm to find what you want out of the databases and present it to you in a way that is easy for you to understand. If you connect the dots, that means that the drawing programs we use to make these incredible projects, are really just glorified excel programs. This idea may be mind blowing at first, but just remember, everything the computer does breaks down into 1s and 0s eventually.

So if databases are the source behind even complex drawing programs, I think it is very important to have a way of quickly and easily changing the information that is stored inside them. SQL is the standard for the ANSI which means interoperability may be possible if the language to talk between databases as the basic level is the same, maybe one day they will become better at communicating at higher levels too.

Sources:

http://www.w3schools.com/sql/sql_intro.asp
http://www.sqlcourse.com/intro.html

Monday, February 11, 2013

SQL - Why use it?

I think Tom Ben-David and John Scanlon hit the nail on the head when they described SQL as a language that can not be used standalone, but many times is used to supplement another language. If you think of how you might try and store data without a language such as SQL, you would have a hard time.

I have the luxury of having worked with SQL in the form of mySQL and PHP while designing websites. Before I was ready to use mySQL however, I used the alternatives in web design, which when you broke it down was just storing information in a text file that used semi-colons and tabs to separate the data. This is called a flat file database. It worked, and was useful for what I needed at the time, and stored data in a tabular form that I could access later. However querying in a flat file database is really just going through each entry and looking for parameters that match what you are looking for. Needless to say, the use of a flat file database did not last long into my "web design career".

mySQL (and SQL) works by creating a table that has labeled columns. A database is really just a collection of tables that can be used to connect and talk with each other using identification tags or other useful naming parameters. When you start talking about SQL databases, it sounds a little scary. However, when you break it down, the databases and tables are really just glorified excel files. The usefulness in theses tables however, is that they can be queried (searched) to find only the useful data at a time. This type of operation is extremely useful for the storage of large amounts of data. Facebook uses the same type of PHP and mySQL architecture that I am talking about, and if you consider the amount of data that must be stored on Facebook's website you may start to get overwhelmed. But to think of the database, just go to your profile, you want only information about yourself. If this information were stored in an excel file, it may take a while for you to search the excel file (even if it was a well filtered file) to find only the information about you. However, using mySQL, this operation is done neat and quickly by querying the database for only your information.

SQL BLOG

SQL (Structured/System Query Language) is a programming language that was based off of relational algebra and tuple relational calculus. SQL was purposely designed for managing data in relational database management systems. SQL was created by Donald Chamberlain and Raymond Boyce in the 1970’s. SQL uses clauses, expressions, predicates, queries, statements and insignificant white spaces in its coding. The aforementioned language criteria can be assembled to insert data, query, update and delete. The code is also used for schema creation and modification as well as data access control.
Retrieving data using SQL is relatively different from a text search using the web. Structured data simply means that the data will be represented in tables; rows and columns to be specific. The rows represent an object and the columns represent an attribute to attach to the object in each row.
To piggy-back off of what Elda Cifligu says, “SQL is a powerful and useful tool that links people, computer programs and systems to the data stored in a relational database; thus it is very important to have a well written standardized language that allows everyone to access and manipulate databases. It has multiple functions that are necessary for understanding and using databases and over the years SQL has expanded to support the new technology, hardware, operating systems and languages.”  This statement fits well into the idea of interoperability. Thus SQL can be labeled a tool for interoperability when the functions of the language create ease in transferring data.
Typically I am familiar with object oriented languages like python and C++. SQL differs from these languages in that the SQL executes one statement at a time. SQL directly interacts with the database telling it “what” to do, but object oriented programming tells the database “how” to do a specific task.  SQL can be embedded into these object oriented languages but the vice versa scenario cannot be done.
My experience with programing language is very primitive. However I have done some preliminary work with C++, Python and MATLAB. However I hope to learn more about SQL and programming as a whole in this class. It is very important that civil engineering students get a firm grasp of database and programming before entering the field of employment.
SOURCES:

SQL and Relational DBMS

A Database Management System (DBMS) is a set of logically related programs that enables storing, modifying, and extracting information from one location efficiently. The users can access the stored data by using programming interface to modify or retrieve the information, which can be presented in a variety of formats. Some examples of databases are airline reservation systems, banking systems, computerized parts inventory systems. As Jeanine mentioned in her blog, there are two major types of databases, relational and object-oriented databases.

The relational DBMS was proposed for the first time in 1970s by Edgar Codd. It stores all the data as logically structured relations or two-dimensional tables, where each table corresponds to an entity and each row corresponds to an instance of the entity. The different table of records can be connected by common key parameters and exchange information. Construction companies use relational database management systems for cost estimation and cost control; System Analysis and Design (SAD) is used to develop an integrated model which enables the transfer of the cost estimation data to the cost control processes.

System Query Language (SQL) is a self-contained data language that most databases organized according to the relational structure use; it solely exist to support the data language. It is a tool for managing, organizing and retrieving stored information from a database. For instance, when the user needs to retrieve data from a database, they use SQL to request it. Then, the DBMS processes the SQL request, retrieves the data and returns it back to the user. In the 21st century NoSQL was created, for non-relational databases, where tables do not require to be in fixed table schemas or the data stored doesn’t have to be normalized.

Figure 1 shows some components of the SQL and how it links everything together. 


Figure 1. Components of a typical DBMS

SQL is a powerful and useful tool that links people, computer programs and systems to the data stored in a relational database; thus it is very important to have a well written standardized language that allows everyone to access and manipulate databases. However, as Tom said, SQL is no a complete language - a lot of times it is embedded in another language. It has multiple functions that are necessary for understanding and using databases and over the years SQL has expanded to support the new technology, hardware, operating systems and languages. 

Sources:

Salman Azhar, Syed M. Ahmed and Amaury A. Caballero. “Development of an Integrated Cost Estimation and Cost Control System for Construction Projects,” http://fire.nist.gov/bfrlpubs/build02/PDF/b02054.pdf

Ramon A. Mata-Toled. "Database management system." in AccessScience, ©McGraw-Hill Education, LLC. 2012. http://www.accessscience.com.ezproxy2.library.drexel.edu

James R. Groff and Paul N. Weinberg. “Introduction to SQL.” 2004. http://www.devarticles.com/c/a/SQL/Introduction-to-SQL/2/