CS 1308 Computer Literacy and the Internet. Database Management Systems Database A structured set of...
-
Upload
amberly-kelley -
Category
Documents
-
view
219 -
download
0
Transcript of CS 1308 Computer Literacy and the Internet. Database Management Systems Database A structured set of...
![Page 1: CS 1308 Computer Literacy and the Internet. Database Management Systems Database A structured set of data Database management system (DBMS) A combination.](https://reader036.fdocuments.net/reader036/viewer/2022062321/56649f0a5503460f94c1e321/html5/thumbnails/1.jpg)
CS 1308 Computer Literacy and the Internet
![Page 2: CS 1308 Computer Literacy and the Internet. Database Management Systems Database A structured set of data Database management system (DBMS) A combination.](https://reader036.fdocuments.net/reader036/viewer/2022062321/56649f0a5503460f94c1e321/html5/thumbnails/2.jpg)
Database Management Systems
Database A structured set of dataDatabase management system (DBMS) A combination of software and data, made up of a physical database, a database engine, and a database schemaPhysical database A collection of files that contain the data
2
![Page 3: CS 1308 Computer Literacy and the Internet. Database Management Systems Database A structured set of data Database management system (DBMS) A combination.](https://reader036.fdocuments.net/reader036/viewer/2022062321/56649f0a5503460f94c1e321/html5/thumbnails/3.jpg)
Database Management Systems
Database engine
Software that supports access to and modification of the database contents
Database schema
A specification of the logical structure of the data stored in the database
Database query
A request to retrieve data from a database
3
![Page 4: CS 1308 Computer Literacy and the Internet. Database Management Systems Database A structured set of data Database management system (DBMS) A combination.](https://reader036.fdocuments.net/reader036/viewer/2022062321/56649f0a5503460f94c1e321/html5/thumbnails/4.jpg)
Database Management Systems
4
Figure 12.6 The elements of a database management system
![Page 5: CS 1308 Computer Literacy and the Internet. Database Management Systems Database A structured set of data Database management system (DBMS) A combination.](https://reader036.fdocuments.net/reader036/viewer/2022062321/56649f0a5503460f94c1e321/html5/thumbnails/5.jpg)
The Relational Model
Relational DBMS A DBMS in which the data items and the relationships among them are organized into tablesTables A collection of recordsRecords (object, entity)A collection of related fields that make up a single database entryFields (attributes)A single value in a database record
5
![Page 6: CS 1308 Computer Literacy and the Internet. Database Management Systems Database A structured set of data Database management system (DBMS) A combination.](https://reader036.fdocuments.net/reader036/viewer/2022062321/56649f0a5503460f94c1e321/html5/thumbnails/6.jpg)
A Database Table
6
Figure 12.7 A database table, made up of records and fields
How do weuniquelyidentify arecord?
![Page 7: CS 1308 Computer Literacy and the Internet. Database Management Systems Database A structured set of data Database management system (DBMS) A combination.](https://reader036.fdocuments.net/reader036/viewer/2022062321/56649f0a5503460f94c1e321/html5/thumbnails/7.jpg)
A Database Table
KeyOne or more fields of a database record that uniquely identifies it among all other records in the tableWe can express the schema for this part of the database as follows:
Movie (MovieId:key, Title, Genre, Rating)
7
![Page 8: CS 1308 Computer Literacy and the Internet. Database Management Systems Database A structured set of data Database management system (DBMS) A combination.](https://reader036.fdocuments.net/reader036/viewer/2022062321/56649f0a5503460f94c1e321/html5/thumbnails/8.jpg)
A Database Table
8
Figure 12.8 A database table containing customer data
![Page 9: CS 1308 Computer Literacy and the Internet. Database Management Systems Database A structured set of data Database management system (DBMS) A combination.](https://reader036.fdocuments.net/reader036/viewer/2022062321/56649f0a5503460f94c1e321/html5/thumbnails/9.jpg)
Relationships
How do we relate movies to customers?
By a table, of course!
9
Figure 12.9 A database table storing current movie rentals
Who isrentingwhatmovie?
![Page 10: CS 1308 Computer Literacy and the Internet. Database Management Systems Database A structured set of data Database management system (DBMS) A combination.](https://reader036.fdocuments.net/reader036/viewer/2022062321/56649f0a5503460f94c1e321/html5/thumbnails/10.jpg)
Structured Query LanguageStructured Query Language (SQL) A comprehensive relational database language for data manipulation and queries
select attribute-list from table-list where condition
name of field name of table value restriction
select Title from Movie where Rating = 'PG'
Result is a table containing all PG movies in table Movie
10
![Page 11: CS 1308 Computer Literacy and the Internet. Database Management Systems Database A structured set of data Database management system (DBMS) A combination.](https://reader036.fdocuments.net/reader036/viewer/2022062321/56649f0a5503460f94c1e321/html5/thumbnails/11.jpg)
Queries in SQL
select Name, Address from Customer
select * from Movie where Genre like '%action%'
select * from Movie where Rating = 'R' order by Title
11
What does each of these queries return?
![Page 12: CS 1308 Computer Literacy and the Internet. Database Management Systems Database A structured set of data Database management system (DBMS) A combination.](https://reader036.fdocuments.net/reader036/viewer/2022062321/56649f0a5503460f94c1e321/html5/thumbnails/12.jpg)
Modifying Database Contentinsert into Customer values (9876,
'John Smith', '602 Greenbriar Court', '2938 3212 3402 0299')
update Movie set Genre = 'thriller drama' where title = 'Unbreakable'
delete from Movie where Rating = 'R'
12
What does each of these statements do?
![Page 13: CS 1308 Computer Literacy and the Internet. Database Management Systems Database A structured set of data Database management system (DBMS) A combination.](https://reader036.fdocuments.net/reader036/viewer/2022062321/56649f0a5503460f94c1e321/html5/thumbnails/13.jpg)
Facebook, Twitter, other Internet applications How are they built? Database
What information? Network Connection? Software
13