CST363 - Week 17
- YZ

- May 5, 2020
- 2 min read
Relational Tables VS. Spreadsheets
Relational tables and spreadsheets are similar in the fact that they both have rows and columns, or records and fields. However, relational tables have specific characteristics. A relation has rows that contain data about an entity and no two rows can be identical or have the same key. Additionally, a relation has columns that contain attribute data of an entity, with a unique name and data type, in which all entries in the same column are of the same data type. Lastly, each cell of the table holds a single value and the order of the rows and columns is unimportant. If a spreadsheet has these characteristics, then I believe it, too, would be considered a relational table.
Reasons for Using a Database
As opposed to a regular file, databases make it easy to retrieve information with its use of an index. With a database, you can read parts of file by using the search key value. Additionally, it's easy to insert, delete, and update data without reading and writing up the whole file. Due to a databases's data independence, you can add information and make changes to the format of the file without having to always update programs that access the file. For security measures, a user can determine who can see which certain parts of the data as opposed to giving access to the whole file. Databases are also important when it comes to transactions; they keep all of the data together. Lastly, databases support distributed access. A database can be accessed remotely, copies of the data can be replicated, and large data can be portioned into multiple files divided among hard drives or computer systems.

SQL Select Statements
The only required clause of a select statement is the SELECT clause which defines which columns will be displayed in the results set. The FROM clause is not needed to define a table if you are testing and what you are displaying does not come from a table. The WHERE clause specifies the search conditions, but is not always necessary, like when displaying all of the information. The ORDER BY clause can be used to specify how the result set will be sorted or it can be omitted. Lastly, you can specify the number of rows displayed with the LIMIT clause, or display everything without it.



Comments