100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
College Notes Databases Week 1 (X_401008) $3.20
Add to cart

Class notes

College Notes Databases Week 1 (X_401008)

 5 views  0 purchase
  • Course
  • Institution

Lecture notes Databases Week 1 (X_401008) for artificial intelligence and computer science at VU

Preview 2 out of 6  pages

  • May 30, 2023
  • 6
  • 2022/2023
  • Class notes
  • J. endrullis (jörg)
  • Week 1
avatar-seller
Databases Week 1 – Relational Model




Table entries are values that conform
to some data type
-Examples of SQL data types:
 Strings
 Numbers
bit, int, float
numeric, decimal number
 Binary data
Gender, Heads or Tails
 Date and Time
datetime, timestamp
Data Types and Domains
The domain dom(D) of a type D is the set of possible values.
dom(Int) = {-2134567898,…,2134567898}
dom(numeric(2,0)) = {-99,…,99}
SQL allows us to define application-specific domains as subsets of
standard data types: create domain ExampleDomain as numeric(2,0).
We may even add constraints:
create domain ExampleDomain as numeric(2,0) check(value > 0)
Domains are useful to document that 2 columns represent the same kind
of objects and that comparisons are meaningful.

, Relation schema
A relation schema s (of a single relation) defines:
 A (finite) sequence A1,…,An of distinct attribute names
 For each attribute A1 a data type (or domain) Di
A relation schema can be written as:
s = (A1 : D1, … , An : Dn)
Relational Database Schema
A relational database schema S defines:
 A finite set of relation names {R1,…,Rm}
 A relation schema schema(Ri) for every relation Ri
 A set of integrity constraints C
in summary, S = ({R1, … , Rm}, schema, C)
“relation names: {Students, Exercises, Results}
relation schema for every relation name:
 Students(SiD, first, last, address)
 Exercises(category, number, topic, maxPoints)
 Results(SiD, category, number, points)
Examples of integrity constraints: keys and foreign keys.


Schema = describes structure of database
States = actual content at a specific moment
Database States: Tuples
Tuples are used to formalize table rows.
A tuple t with respect to relation schema
is a sequence t = (d1,…,dn) of values such that di ∈ dom(Di)
So other words: t ∈ dom(D1) x … x dom(Dn).
Thus: (‘2709501’, ‘Simon’, ‘van Rens’, ‘Ouderkerk’) is a tuple in a table.
So if (‘2709501’, ‘Simon’, ‘van Rens’, ‘Ouderkerk’).name = ‘Simon’.



Database state I




2

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

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

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

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 simonvanrens. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $3.20. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

53068 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$3.20
  • (0)
Add to cart
Added