it125 faq

Upload: jennifer-bishop

Post on 14-Apr-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/30/2019 it125 faq

    1/12

    IT125 FAQ

    cell77

    May 27, 2013

  • 7/30/2019 it125 faq

    2/12

    RealDB >

    RealDB > column(row>50(Table))1

    Error: school kid error :].

    There is no use for this

    crap in real life.

    RealDB >

    1Equivalent to SELECT column FROM Table WHERE row> 50, see the book on page 217.

  • 7/30/2019 it125 faq

    3/12

    Contents

    1 Introduction To Databases 5

    1.1 Define DBMS. . . . . . . . . . . . . . . . . . . . . . . . . . . . 51.2 List some database applications. . . . . . . . . . . . . . . . . . . 5

    1.3 What are the drawbacks of file system? . . . . . . . . . . . . . . 5

    1.4 What are the levels of abstraction? . . . . . . . . . . . . . . . . . 6

    1.5 Define database schema. . . . . . . . . . . . . . . . . . . . . . . 6

    1.6 Define an instance. . . . . . . . . . . . . . . . . . . . . . . . . . 7

    1.7 Define physical data independence. . . . . . . . . . . . . . . . . . 7

    1.8 Define data models. . . . . . . . . . . . . . . . . . . . . . . . . . 7

    1.9 List some data models. . . . . . . . . . . . . . . . . . . . . . . . 7

    1.10 Define DML. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

    1.11 What are the classes of DML? . . . . . . . . . . . . . . . . . . . 8

    1.12 Define DDL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

    1.13 What are integrity constraints? . . . . . . . . . . . . . . . . . . . 8

    1.14 Define database design. . . . . . . . . . . . . . . . . . . . . . . . 8

    1.15 Define normalization. . . . . . . . . . . . . . . . . . . . . . . . . 8

    2 Introduction to Relational Model 9

    2.1 What is a relation, an attribute and a tuple2? . . . . . . . . . . . . 9

    2.2 What are relational databases? . . . . . . . . . . . . . . . . . . . 9

    2.3 Define the domain of the attribute. . . . . . . . . . . . . . . . . . 9

    2.4 Define atomic attribute. . . . . . . . . . . . . . . . . . . . . . . . 9

    2.5 Let R = (A1, A2, A3), which is the relation and which is the at-tribute? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

    2.6 What is the superkey? . . . . . . . . . . . . . . . . . . . . . . . . 10

    2.7 What is the candidate key? . . . . . . . . . . . . . . . . . . . . . 10

    2.8 What is the primary key? . . . . . . . . . . . . . . . . . . . . . . 10

    2.9 What a foreign key means? . . . . . . . . . . . . . . . . . . . . . 10

    2Book page 41.

    3

  • 7/30/2019 it125 faq

    4/12

    4 CONTENTS

    3 Introduction to SQL 11

    3.1 What does SQL stand for? . . . . . . . . . . . . . . . . . . . . . 113.2 List some SQL DDL statements. . . . . . . . . . . . . . . . . . . 11

    3.3 List some SQL DML statements. . . . . . . . . . . . . . . . . . . 11

  • 7/30/2019 it125 faq

    5/12

    Chapter 1

    Introduction To Databases

    1.1 Define DBMS.

    DBMS stands for database management system. It contains information about a

    particular enterprise, collection of interrelated data, set of programs to manage the

    data and an environment that is both convenient and efficient to use.

    1.2 List some database applications.

    Databases are used in banking to manage customer information and theiraccounts.

    They are also used in universities to manage students registration and grades.

    Also, they are used by human resources to keep employee records and

    salaries.

    Databases touch all aspects of our lives these days.

    1.3 What are the drawbacks of file system?Databases were built on top of file system which has some drawbacks such as:

    Difficulty in accessing the data, need new program to preform new tasks.

    Data isolation, multiple files with multiple formats.

    integrity problems, integrity constraints are hidden in program code and its

    hard to add new change existing once.

    5

  • 7/30/2019 it125 faq

    6/12

    6 CHAPTER 1. INTRODUCTION TO DATABASES

    Figure 1.1: Levels of abstraction

    Security problems, its hard to provide user access to some, but not all, data.

    1.4 What are the levels of abstraction?

    There are there levels of abstraction in databases, Figure 1.1

    1. Physical level, describes how a record is stored.

    2. Logical level, describes data stored in database and the relationships among

    the data.

    3. View level, application programs that hide the details of data types. View

    also can be used to hide information like for security purposes.

    1.5 Define database schema.It is the logical structure of the database. Example, the database consists informa-

    tion about students and their classes and the relationship between them.

    Database schema analogous to type information of a variable in a program. it

    has to types:

    1. Physical schema, database design at the physical level.

    2. Logical schema, database design at the logical level.

  • 7/30/2019 it125 faq

    7/12

    1.6. DEFINE AN INSTANCE. 7

    1.6 Define an instance.

    The actual content of the database at a particular point in time, similar to the values

    of variables.

    1.7 Define physical data independence.

    Its the ability to modify the physical schema without changing the logical schema.

    1.8 Define data models.Collection of tools for describing:

    data.

    data relationships.

    data semantics.

    data constraints.

    1.9 List some data models.

    Relational model.

    Entity-Relationship data model.

    Object-based data models.

    Semistructured data model.

    And there are some older models such as network and hierarchical models.

    1.10 Define DML.

    DML stands for Data Manipulation Language, it is a language for accessing and

    manipulating the data organized by the appropriate data model, also known as

    data query language.

  • 7/30/2019 it125 faq

    8/12

    8 CHAPTER 1. INTRODUCTION TO DATABASES

    1.11 What are the classes of DML?

    1. Procedural, user specifies what data is required and how to get those data.

    2. Declarative (non-procedural), user specifies what data is required without

    specifying how to get those data. SQL is the most used non-procedural

    language 1.

    1.12 Define DDL.

    DDL stands for Data Definition Language, it specifies notation for defining the

    database schema.The DDL compiler generates a set of table templates stored in a data dictionary

    that contains metadata (data about the data) such as:

    Database schema.

    Integrity constraints.

    Authorization.

    1.13 What are integrity constraints?

    Integrity constraints ensure that changes made to the database by authorized users

    do not result in a loss of data consistency. For example an instructor name cannot

    be NULL2.

    1.14 Define database design.

    The process of designing the general structure of the database:

    Logical Design, Deciding on the database schema.

    Physical Design, Deciding on the physical layout of the database.

    1.15 Define normalization.

    Formalize what designs are bad, and test for them.

    1Look at slide 15.2Look at the book on page 128.2Note: Stopped on Slide 18.

  • 7/30/2019 it125 faq

    9/12

    Chapter 2

    Introduction to Relational Model

    2.1 What is a relation, an attribute and a tuple1?

    relation, a term refers to a column of a table.

    attribute, a term refers to a column of a table.

    tuple, a term refers to a row.

    2.2 What are relational databases?

    A relational database consists of a collection of attributes, or tables, each has a

    unique name.

    2.3 Define the domain of the attribute.

    The set of allowed values for each attribute is called the domain of the attribute.

    2.4 Define atomic attribute.

    A domain is atomic if elements of the domain are considered to be indivisible

    units.

    1Book page 41.

    9

  • 7/30/2019 it125 faq

    10/12

    10 CHAPTER 2. INTRODUCTION TO RELATIONAL MODEL

    2.5 Let R = (A1, A2, A3), which is the relation and

    which is the attribute?

    R is the relation. A1, A2 and A3 are attributes.

    2.6 What is the superkey?

    A superkey is a set of one or more attributes that allow us to identify uniquely a

    tuple in the relation.

    2.7 What is the candidate key?

    The minimal superkeys are called candidate key.

    2.8 What is the primary key?

    The selected key of the candidate key is called the primary key.

    2.9 What a foreign key means?It means that the value in one relation must appear in another.

  • 7/30/2019 it125 faq

    11/12

    Chapter 3

    Introduction to SQL

    3.1 What does SQL stand for?

    It stands for Structured Query Language.

    3.2 List some SQL DDL statements.

    create table, alter table and drop table.

    3.3 List some SQL DML statements.

    insert into, update and delete from.

    11

  • 7/30/2019 it125 faq

    12/12