2.1: First Steps To Database Management: Handling Tables Flashcards

Give examples of the most popular relational database systems. Explain databases as a collection of tables. Use SQL, the Oracle SQL Developer software, and Oracle. Create SQL tables. Insert and modify records (called tuples) in a table. Devise simple queries on the basis of a single table. Learn how to connect remotely to CISE Oracle.

1
Q

Databases are a collection of ___________

A

tables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Create a Table header (table schema) using DDL

A

create table Employee
(EmpId integer,
Name varchar(25) not null,
Birthdate date,
Salary numeric (8,2),
primary key (EmptId);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What do different relational database management systems share?

A

SQL and underlying data model

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Create the table body (table instance) using the DML

A

insert into Employee
values (567, ‘Meyer’, date ‘1975-03-25’, 23000);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Update record using DML

A

update Employee set Salary = 37000 where EmpId = 456;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Show the employee table (syntax)

A

select *
from Employee

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Example of a PROJECTION on a selected list of attributes
Show (only) the employee IDs and their salaries.

A

select EmpId, Salary
from Employee;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

varchar(25)

A

variable character string
25 max characters allowed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

not null (schema constraint)

A

cannot be empty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

numeric(8,2)

A

numeric - type for decimal numbers
8 digits long max
2 decimal places

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

primary key (EmpId)

A

unique. 2 records cannot have the same primary key

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

*

A

Selects all fields to be shown

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Example of a selection with a filter condition (together with projection)
Show the IDs and salaries of all employees whose alary exceeds $27000.

A

select EmpId, Salary
from Employee
where Salary > 27000;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

select (queries)

A

Select fields to be considered,
* if all fields are to be considered

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

where (queries)

A

filter condition
ex. Salary > 27000

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

from (queries)

A

tables to be considered

17
Q

Aggregation Query
Determine how many employees work in the company and store the result under attribute “total”

A

select count(*) as total
from Employee;

18
Q

What are projection attributes?

A

comma-separated list of attributes after the SELECT clause

19
Q
A