CompSci notes3

CompSci notes3 - Database Management Systems 12.3...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Database Management Systems 12.3 Database-structured set of data held in a computer Database Management System (DMS)-a combination of software and data made of 3 components: Physical Database: a collection of files and records that contain the data Database Engine: software that supports access and modification of database components. This software interacts with the database language that allows the user to add, delete, modify, and query data. (*Query: request to retrieve data from a database) Database Schema: logical structure of the data stored on the database. It shows how the data relates to each other. The Relational Model Organizes data and the relationships among them into tables A table: collection of records Field: (in a database table) contains a single data value Record: each one contains the same fields Record is also called an entity (or a database object) Fields are also called attributes of a database object Key field: gives a unique value for each record Ex: Schema: student(StudentID: key (but : key because each student has a unique value), Name, Date of Birth, Sex, Major) Relationships Movie Database and a Customer Database (page 399, 400) Schema Movie (MovieID: key, Title, Genre, Rating) Customer (CustomerID: key, Name, Address, CreditCardNumber) Use a separate relational table to connect these tables Structured Query Language (SQL) A database language for managing relation databases. (Add, delete, modify, and query information). Rules: It’s not case-sensitive. (Includes keywords, table names, and attributes). All lowercase, all uppercase, or mixed case You have to use a space to separate parts of a statements Query: Use the ‘select’ statement as the primary tool. Basic syntax: Select attribute-list From table-list Where condition Select: determines which attributes will be returned From: determines which table we are going to use Where: restricts the data that is returned Ex: Select Title from Movie where Rating = “R” What will ^^ return? A, D, and E QUIZ ON WEDNESDAY
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
KNOW EVERYTHING ABOUT DATABASES!! November 14, 2011 Modifying Database Content Add: adds a record to a database Basic syntax: Insert into Customer values (9876 [CustomerID; this does not have ““because you can add that to other things], “John Smith”, “602 Greene Street”, “1001 [CreditCardNumber]”) Modify: update a particular record Basic syntax Update Movie set Genre = “thriller drama” where title = “A” Delete: take away from a particular record Basic syntax Delete from Movie where Rating = “R” Database Design Cardinality constraints Entity-relationship model (ER model) Create the database table Cardinality Constraints Limits the number of entities in relationships (look in book) One to one One to many Many to many Entity-Relationship (ER Model)
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/20/2012 for the course COMP 101 taught by Professor Ms.biggers during the Fall '11 term at South Carolina.

Page1 / 8

CompSci notes3 - Database Management Systems 12.3...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online