You are on page 1of 12

IT126 FAQ

cell77 May 27, 2013

RealDB > RealDB > column(row>50(Table))1 Error: school kid error :]. There is no use for this crap in real life. RealDB >

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

Contents
1 Introduction To Databases 1.1 Dene DBMS. . . . . . . . . . . . . . 1.2 List some database applications. . . . . 1.3 What are the drawbacks of le system? 1.4 What are the levels of abstraction? . . . 1.5 Dene database schema. . . . . . . . . 1.6 Dene an instance. . . . . . . . . . . . 1.7 Dene physical data independence. . . . 1.8 Dene data models. . . . . . . . . . . . 1.9 List some data models. . . . . . . . . . 1.10 Dene DML. . . . . . . . . . . . . . . 1.11 What are the classes of DML? . . . . . 1.12 Dene DDL. . . . . . . . . . . . . . . 1.13 What are integrity constraints? . . . . . 1.14 Dene database design. . . . . . . . . . 1.15 Dene normalization. . . . . . . . . . . 5 5 5 5 6 6 7 7 7 7 7 8 8 8 8 8 9 9 9 9 9 10 10 10 10 10

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

. . . . . . . . . . . . . . .

Introduction to Relational Model 2.1 What is a relation, an attribute and a tuple2 ? 2.2 What are relational databases? . . . . . . . 2.3 Dene the domain of the attribute. . . . . . 2.4 Dene atomic attribute. . . . . . . . . . . . 2.5 Let R = (A1 , A2 , A3 ), which is the relation tribute? . . . . . . . . . . . . . . . . . . . 2.6 What is the superkey? . . . . . . . . . . . . 2.7 What is the candidate key? . . . . . . . . . 2.8 What is the primary key? . . . . . . . . . . 2.9 What a foreign key means? . . . . . . . . .
2

. . . . . . . . . . . . . . . . . . . . . . . . and which . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . is the at. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Book page 41.

4 3

CONTENTS Introduction to SQL 3.1 What does SQL stand for? . . . . . . . . . . . . . . . . . . . . . 3.2 List some SQL DDL operations. . . . . . . . . . . . . . . . . . . 3.3 List some SQL DML operations. . . . . . . . . . . . . . . . . . . 11 11 11 11

Chapter 1 Introduction To Databases


1.1 Dene 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 efcient to use.

1.2

List some database applications.

Databases are used in banking to manage customer information and their accounts. 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 le system?

Databases were built on top of le system which has some drawbacks such as: Difculty in accessing the data, need new program to preform new tasks. Data isolation, multiple les with multiple formats. integrity problems, integrity constraints are hidden in program code and its hard to add new change existing once. 5

CHAPTER 1. INTRODUCTION TO DATABASES

view level view 1 view 2 ... view n

logical leve physical leve


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

Dene database schema.

It is the logical structure of the database. Example, the database consists information 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.

1.6. DEFINE AN INSTANCE.

1.6

Dene an instance.

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

1.7

Dene physical data independence.

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

1.8

Dene 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

Dene 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.

CHAPTER 1. INTRODUCTION TO DATABASES

1.11

What are the classes of DML?

1. Procedural, user species what data is required and how to get those data. 2. Declarative (non-procedural), user species what data is required without specifying how to get those data. SQL is the most used non-procedural language 1 .

1.12

Dene DDL.

DDL stands for Data Denition Language, it species notation for dening 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

Dene 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
1 2

Dene normalization.

Formalize what designs are bad, and test for them.


Look at slide 15. Look at the book on page 128.

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

Dene the domain of the attribute.

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

2.4

Dene atomic attribute.

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


1

Book page 41.

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 relations.

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.

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

You might also like