Anda di halaman 1dari 35

IELM 3300

Industrial Data System


Instructor: Qi QI
Course Schedule
•  Lecture: 4pm-5:50pm, Wednesday, Room 4620
–  Instructor: Dr. Qi QI
•  Email: kaylaqi@ust.hk
•  Office: Room 5559A
•  Phone: 2358-7115
•  Office Hours: 6-7pm (Wednesday)

•  Lab 1: 1:30pm-4:20pm, Thursday, IS Lab (Room


3207)
•  Lab 2: 1:30pm-4:20pm, Friday, IS Lab (Room 3207)
TAs
Name Email Office Office Hours
CHEN Zhou* zchenaq@ust.hk 5569

CHENG Longwei lchengae@connect. 5569 4pm-5pm Tue


ust.hk
FAN Xiaoshuai xfanaf@connect.ust 5569 4pm-5pm Mon
.hk
WANG Wenwei wwangaw@connect 5569
.ust.hk

•  * TA leader
•  Office hours: Mon(TA), Tue(TA), Wed(Instructor)
•  Lecture: Wed
•  Lab: Thu, Fri
TA Assignment
•  Lab
–  1,3,5,7,9: WANG Wenwei, FAN Xiaoshuai
–  2,4,6,8: CHEN Zhou, CHENG Longwei
•  Homework
–  Hw1,3: CHENG Longwei
–  Hw2,4: FAN Xiaoshuai
Learning Outcomes
1.  Evaluate the rationale for the storage and use of large scale data and describe
the associated challenges and difficulties.
2.  Translate unorganized textual data requirements into Entity-Relationship
models.
3.  Describe the purpose and techniques for normalization
4.  Convert a given ER diagram informally into relational schema design
5.  Use concepts of functional dependencies to generate 3NF and BCNF schema
designs.
6.  Use operations on relational tables using Relational Algebra.
7.  Create a database in SQL and create tables in the database.
8.  Write and run a SQL query in a database.
9.  Explain the basics of Client-Server architecture in software systems.
10.  Use PHP language to write server-side CGI programs interfaced with a
database server.
11.  Design and develop a software application using the Web-server as the DB-
client model.
Course Logistics
•  Course webpage: https://canvas.ust.hk
–  Lecture/lab notes, homework, solutions, and other
announcements will be posted on this site. Please
check this site regularly.
•  Textbook: Fundamentals of Database Systems.
–  R. Elmasri and S.B. Navathe.
–  Pearson New International Edition
–  6th edition, 2014.
Grading
•  Homework(12pts), labs(18pts), midterm(30pts),
final(40pts), bonus(4pts)
•  Checking on grading must be done within one week
after handling out the graded homework or exam.
•  Homework
–  Five homework, four of them will be graded, each 3pts.
–  Late HW will be graded, but will get 1 point per late-day
penalty.
–  Copying: If N-student have copied on a HW, the total
grade of each person will be SCORE/N.
Labs
•  Nine labs, each worth 2 points (1pt attendance,
1pt performance)
–  How much you are late for the lab will also be
recorded.
•  If you are late for x minutes, then your attendance score will
be (1-x/30)+.
–  You will get 1pt for performance if you finish all the
exercises before the end of each lab.
–  If you want to switch your lab session, you need to
email your reason to the instructor for permission at
least one day before.
Exams
•  Midterm
–  Lecture time, Nov 2
•  Final
–  TBD

•  The exams are closed. No book or note.


Make-up exam policy in IELM
•  If a student cannot come for the exam due to sickness,
they must:
–  Give the instructor and/or TA notice on or before the day
of the exam;
–  Provide the instructor with the hardcopy certificate of
sickness stating the period for which the doctor
recommends the sick leave.
•  The make-up exam will be given within 1 days of the
last date of sickness indicated by the certificate. TA will
inform you about the time and location for make-up
exam.
•  The make-up exam will cover the same topics as the
regular exam, but will contain different questions.
Bonus
•  0.5pt for answering questions in one of the
lectures
•  Maximum 4pts for the whole semester
What is Database?
•  Database: collection of related data
–  Known facts that can be recorded and that have implicit
meaning
–  Models some aspect of the real world
–  Can be of any size
•  Your address book
•  Amazon.com
–  >20 million items sold on Amazon
–  About 15 million visitors use the database to make purchase every day
Why study Database??
•  Industrial age to Information age
–  Industrial revolution vs. digital revolution
•  Datasets increasing in diversity and volume.
–  Big data

“Knowledge is of two kinds: we know a subject ourselves, or we


know where we can find information upon it.”
--Samuel Johnson (1709-1784)
Database applications
•  Library
•  Flight, hotel booking

Someone or some program accessing a database.


What is the content of this course???

Lecture Lab

Data HTML,
modeling PHP

Data
SQL
language
Content of the lecture
Today’s lecture
•  Defining a DBMS
•  An Example: University database
•  Data Models
•  DBMS Architecture
•  Advantages of DBMS
•  DB Users
DBMS

•  Database management system (DBMS)


–  A software system designed to store and manage database

–  Enables users to create, maintain and query a database

•  DBMS facilitates defining, constructing, manipulating,


and sharing databases among users and applications
An Example
UNIVERSITY database
Defining a database

•  Specify structure of records of each file by


specifying data type for each data element
–  characters, integer, etc.
Constructing
•  Store data to represent each student, course,
section, grade report, and prerequisite as a
record in appropriate file
•  Relationships among the records
Manipulating
•  Examples of queries:
–  List the names of students who took the section
of the ‘Database’ course offered in Fall 2016 and
their grades in that section

•  Examples of updates:
–  Enter a grade of ‘A’ for ‘Smith’ in the ‘Database’
section of last semester
Sharing
•  Examples:
–  all students query for the course sections offered
in this semester simultaneously.
Data Models
•  Data model: a collection of concepts for describing data.

•  Three Categories
–  High-level or conceptual data models
•  close to the way many users perceive data
•  A high level description, useful for requirements understanding.
•  Example: Entity-Relationship model (ER model)

–  Representational or logical data models


•  Easily understood by end users, also similar to how data organized in computer storage
•  Describe the logical representation of data without giving details of physical
representation.
•  Example: Relational data model

–  Low-level or physical data models


•  Describe the details of how data is stored (record formats, file structures etc.)
ER Model
•  A conceptual level data model.
•  Main concepts: entity, relationship, attribute.

•  In the UNIVERSITY database context


–  Entities: student, faculty, department, course, etc.
–  Relationships:
•  teach relationship between faculty and course
•  Belong relationship between student and department etc.
–  Attributes:
•  name, student_number, class, major, of student entity etc.
Relational Model
•  A logical level data model.
•  Main concept: relation.

•  In the UNIVERSITY database context


Relation name Attributes

Tuple
Phases for designing a database

•  Requirements specification and analysis


•  Conceptual design
•  Logical design
•  Physical design
Schema
•  Database schema
–  The description of a database
–  Not change frequently
–  For example: Student schema
•  Student(name: string, student_number:
string, class: string, major: string)

•  Schema diagram
–  A displayed schema
•  Displayed only some aspects of a schema
Three-Schema Architecture
View/External Level
Each view describes part of the
database that a particular user
group is interested in

Conceptual level
Describes structure of the whole
database for a community of users

Internal level
Describes physical storage
structure of the database

Many views, single


conceptual schema and
physical schema.
•  Views describe how
users see the data.
•  Conceptual schema
defines logical structure.
•  Physical schema
describes the files and
indexes used.
Data Independence
Physical Data Independence
•  The ability to modify physical level schema without affecting the
logical or view level schema.
•  Achieved by suitably modifying conceptual/internal mapping.

Logical Data Independence


•  The ability to change the logical level schema without affecting the
view level schema.
•  For example: an attribute is deleted in some relation
•  No need to change the views that only use the remaining data
•  View definitions in external/conceptual mapping only need to be
changed for views that use the deleted attribute
Advantage of using DBMS
•  Controlling redundancy
–  Data normalization
•  Ensures consistency and saves storage space
–  Denormalization
•  Sometimes necessary to use controlled redundancy to improve the
performance of queries

•  Restricting unauthorized access


–  Security and authorization subsystem
–  Privileged software
Advantage of using DBMS
•  Providing persistent storage for program objects
•  Providing storage structures and search techniques for
efficient query processing
•  Providing backup and recovery
•  Providing multiple user interfaces
•  Representing complex relationships among data
Advantage of using DBMS
•  Enforcing integrity constraints
–  Referential integrity constraint

•  Every section record must be related to a course record

–  Key or uniqueness constraint

•  Every course record must have a unique value for


Course_number
Types of DB users
•  Database administrators (DBA)
–  Authorizing access to the database
–  Coordinating and monitoring its use
–  Acquiring software and hardware resources

•  End users
–  Casual end users: occasionally access the database
–  Naive or parametric end users: constantly querying
and updating
–  Sophisticated end users: engineers, scientists, business
analysts,etc
–  Standalone users: using software package
Types of DB users
•  Database designers
–  Identifying the data to be stored

–  Choosing appropriate structures to represent and store this data

•  System analysts
–  Determine requirements of end users

•  Application programmers
–  Implement these specifications as programs

Reading Assignment: Chapter 1.1-1.4, 1.6, 2.1-2.2

Anda mungkin juga menyukai