Summary CSC2001F SQL databases: commands, ER notation, normal form theory, dependencies, locking, deadlocks and more.
27 views 0 purchase
Course
CSC2001F: Computer Science 2001 (CSC2001F)
Institution
University Of Cape Town (UCT)
This summary covers everything you need to know about SQL and its commands. It goes through optimisation and ACID properties, as well as entity relationship notations and schemas. They cover database design, normal form theory, functional dependencies, as well as complex concepts such as locking, s...
A database is an organized collection of structured information, or data, typically stored
electronically in a computer system. A database is usually controlled by a database
management system (DBMS).
The data can then be easily accessed, managed, modified, updated, controlled, and
organized.
Ways to store data:
1. Remember it
2. Write it down (on paper)
3. Use a spreadsheet
What if many people are using the same data at once?
Different people need access to different parts of the data at once.
A unified access point to the data is needed, so each person can access the subset of data
that they need while everyone is accessing the same underlying data store. A DATA BASE is
needed.
Relational Data Bases:
A collection of tables.
relational databases enable users to manage predefined data relationships across
multiple databases. It helps recognise relations between stored items of information.
Terminology:
1. Attribute: A column (ie. ID, first name, last name)
2. Relation: Technical word for a table. A table defines a relationship between various
columns (i.e. ID of a book to the title of the book)
You can also get relationships across tables (i.e. Book and author's ID in one table, and
name of author in another table (use the ID to get name)).
3. Degree and Cardinality:
- Degree: Number of columns
- Cardinality: Number of rows
1
,Synonyms of the terminology that come up:
The language that we typically use to query relational databases is SQL (Structures Query
Language)
2
, Using SQL:
Commands:
Limiting Columns:
SELECT * FROM family_members
[Selects every column in table family_members]
SELECT name, species, num_books_read FROM family_members
[Selects only the columns specified]
Limiting Rows:
WHERE num_books_read > 100
[Will only print the two rows where the number of books read is greater than 100]
SELECT * FROM friends_of_pickles //Looks at all columns in friends_of_pickles table
WHERE species = 'dog' AND height > 38 //specifies species row, finds items that are dogs
// and their height is > 38
3
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller chloewalt. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $10.61. You're not tied to anything after your purchase.