Download as pdf or txt
Download as pdf or txt
You are on page 1of 21

UGRD-ITE6100B Fundamentals of Database System

File Content:
•Prelim Quiz 1
•Prelim Quiz 2
•Prelim Exam
•Prelim Lab Examination
•Prelim Lab Quiz
•Midterm Quiz 1
•Midterm Quiz 2
•Midterm Exam
•Midterm Lab Examination
•Midterm Lab Quiz
•Final Quiz 1
•Final Quiz 2
•Final Lab Activity

Data Manipulation Language is use for manipulating data in a database.


Answer: True

Describes how entities are related.


Answer: Relationships

Internal Level describes the physical storage structure of the database.


Answer: True

Who is responsible in administering the primary and secondary resource in the database?
Answer: database administrator

Facts that can be recorded and that have implicit meaning.


Answer: Data

A displayed schema is called Schema figure.


Answer: False

People whose jobs require access to the database for querying, updating, and generating
reports.
Answer: End users

Data model is a collection of concepts that is used to describe the structure of a database.
Answer: True

It is a question or an inquiry, sometimes loosely used for all types of interactions with databases.
Answer: Query

Controlling Redundancy is used to improve the performance of queries.


Answer: True

There’s no difference between the description of database and the database itself.
Answer: False

Physical data models is a concept that shows how the data is stored on the computer.
Answer: True

It is a collection of related data.


Answer: Database

Data abstraction is the data type, relationships and constraints that apply to the data.
Answer: False

A computerized system that permits users to create and maintain a database.


Answer: database management system

We call the database and DBMS software together as a (Answer)


Answer: database system

It is between high-level and low-level data models.


Answer: Representational or implementation data models

They are liable for identifying the data to be stored within the database and for selecting
appropriate structures to represent and store this data.
Answer: database designers

Attribute is a name for a set of similar things that you can list. Like objects, events, people.
Answer: False

Database System automatically takes care of backup and recovery.


Answer: True

An attribute that has a multiple value.


Answer: Multi-value attribute

A thing that shares a common attribute.


Answer: Entity class

Entity Instance is an instance of a particular entity.


Answer: True

Composite attribute can be divided into more attributes.


Answer: True

Is an instance of a particular entity.


Answer: Entity Instance

Level of database design use to create database.


Answer: Physical design

Logical Design – transforming the ERD into relational model.


Answer: True

Matching Type Test

Display a form to be fill out by the user.


Answer: Forms-based Interfaces

The interface allows users to access their data through their mobile phone or mobile device.
Answer: Applications for mobile devices

Used to give or control privilege in a database.


Answer: Date Control Language (DCL)

The interface presents a menu that lead to a user through request.


Answer: Menu-based Interfaces far Web Clients or Browsing

Used to performed or rollback the changes that we made in the database using DML
commands.
Answer: Transaction Control Language (TCL)

Like Web search engines (engine like Google), which the user can specify a string or any
keywords and expect to get a relevant result.
Answer: Keyword-based Database Search

Used for creating tables, schema etc. in database.


Answer: Date Cefinitian Language (DDL)

Used to manage data within the object schema.


Answer: Date Manipulation Language(DML)

Composite Attribute can be calculated from other attributes.


Answer: False

Entity Relationship Diagram (ERD) was proposed by(Answer)


Answer: Dr. peter chen

For each entity instance the value of the identifier attribute is Unique.
Answer: True

It describes how entities are related to each other.


Answer: Relationship

Attribute describes an entity class.


Answer: True

The relational model (RM) was first described by Edgar F. Codd


Answer: True

It is the number of tuples in a relation.


Answer: Cardinality of relation

Its is one or more columns of a relation or table that is used to identify a record.
Answer: Key

Minimum Cardinality describes the minimum number of entity instances that must participate in
a relationship.
Answer: True

Entities can be related indirectly by two (2) relationships.


Answer: Transitive relationship

Relational Model is a table with columns and rows.


Answer: True

This relationship exists if they are independent or different to each other.


Answer: Multiple relationships

Matching Type

Table
Answer: Relation
All possible column values
Answer: Domain

Table definition
Answer: Schema of relation

Column header / field


Answer: Attributes

Row
Answer: Tuples

Matching Type

A single entity instance of one entity class is related to a multiple entity instance of another
entity class.
Answer: One-to-Many

The participation of an entity in the relationship is mandatory.


Answer: Mandatory

Each entity instance of one entity class is related to a multiple entity instance of another entity
class; and vice versa.
Answer: Many-to-Many

The participation of an entity in the relationship is optional.


Answer: Optional

A single entity instance of one entity class is related to a single entity instance of another entity
class.
Answer: One-to-One

It is the number of attributes in a relation.


Answer: Degree of relation

Maximum Cardinality describes the maximum number of entity instances in the relationship.
Answer: True

Relationships can't have attributes.


Answer: False

The table is in a 1NF if It satisfies the definition of a relation.


Answer: True

Matching Type
Relational database schema commonly defines:

Columns
Answer: Name, data type,size, value range

Tables
Answer: name, primary key

Constraints
Answer: all kinds of keys

A non-key attribute is dependent on part of a composite primary key.


Answer: Partial dependency

A process of producing a set of tables (relations) with a proper attribute.


Answer: Normalization

Indirect relationship causes functional dependency.


Answer: Transitive dependency

No primary key can be null.


Answer: True

Matching Type
Common Data Type

Character
Answer:Text

Date
Answer: Time

Boolean
Answer: true/false

Numeric
Answer: Integer
Matching Type
Normal Forms

NO Transitive Dependency
Answer: 3rd Normal Form (3NF)

Multi-value dependency
Answer: 4th Normal Form (4NF)

NO “repeating groups” (columns)


Answer: 1st Normal Form (1NF)

NO Partial Dependency
Answer: 2nd Normal Form (2NF)

It is a stricter form of 2nd and 3rd normal form


Answer: Boyce Codd Normal Form (BC/NF)

Null means zero


Answer: False

Null means a value is unknown.


Answer: True

The table is in a 2NF if there's NO Partial Dependency.


Answer: True

Compound Conditions use logical operators to filter or connect multiple criteria.


Answer: True

Use(Answer) if there is ambiguity when distinguishing a column.


Answer: Qualifiers

SQL is not a Programming Language.


Answer: True

(Answer)means missing value.


Answer: Null

Use to retrieve data from multiple tables.


Answer: Table join

Asterisk (*) means all or a list of(Answer)


Answer: columns

Structured Query Language is a command use by relational database management system to


perform database operations.
Answer: True

In SQL the command language used is like an Spanish language.


Answer: False

Displays a record if any of the conditions separated by OR is TRUE.


Answer: OR Operator

SQL is used to retrieve data from relational databases.


Answer: True

Matching Type.
What does SQL do

Used to retrive data and manipulate data


Answer: DML

Used to control data access


Answer: DCL

Used to define and modify data structures


Answer: DDL

DDL used to control data access.


Answer: False

It is a command used or a request for information from a database.


Answer: Query

Used to sort the result.


Answer: Order by keyword

AND operator displays a record if all the conditions separated by AND are FALSE.
Answer: False

We use(Answer)to give column another name.


Answer: Alias

To sort the records in descending order, use the DESC keyword.


Answer: True
Cross Join – Used the foreign key as the matching criteria
Answer: False

An Expression can't be a number, columns, literals, functions connected by operators


Answer: False

AND operator displays a record if all the conditions separated by AND are TRUE.
Answer: True

Include all qualified records from the right table in the join condition even if they do not have
matching records in the left table.
Answer: Right join

DCL - Use the command: Permissions


Answer: True

It is a combination of symbols and operators that returns a single value.


Answer: Expression

Columns or expressions can be in the SELECT clause only if they are in the GROUP BY clause.
Answer: True

DML - Manipulate data using commands: insert, update and delete


Answer: True

Records that have matching records from two (2) tables


Answer: Inner join

Use to get aggregation results for different groups of records.


Answer: Group by

An Expression can be a single constant, column, variable, or scalar function.


Answer: True

DDL - Schema: databases, tables, views and many more


Answer: True

Matching Type
Aggregate Functions

average of all or selected values


Answer: avg
maximum of all or selected values
Answer: max

sum of all or selected values


Answer: sum

minimum of all or selected values


Answer: min

number of all or selected values


Answer: count

It is needed when minimum cardinality is optional on a table.


Answer: Outer join

Include all qualified records from the left table in the join condition even if they do not have
matching records in the right table.
Answer: Left join

OR operator displays a record if any of the conditions separated by OR is TRUE.


Answer: True

Include all qualified records from both tables in the join condition.
Answer: Full join

Database System automatically takes care of backup and recovery.


Answer: True

They are liable for identifying the data to be stored within the database and for selecting
appropriate structures to represent and store this data.
Answer: database designers

There’s no difference between the description of database and the database itself.
Answer: False

Facts that can be recorded and that have implicit meaning.


Answer: Data

Level of database design use to create database.


Answer: Physical design

Attribute describes an entity class.


Answer: True

A computerized system that permits users to create and maintain a database.


Answer: database management system

For each entity instance the value of the identifier attribute is Unique.
Answer: True

Who is responsible in administering the primary and secondary resource in the database?
Answer: database administrator

Internal Level describes the physical storage structure of the database.


Answer: True

Data model is a collection of concepts that is used to describe the structure of a database.
Answer: True

Is an instance of a particular entity.


Answer: Entity Instance

It is a collection of related data.


Answer: Database

It is between high-level and low-level data models.


Answer: Representational or implementation data models

Composite attribute can be divided into more attributes.


Answer: True

Physical data models is a concept that shows how the data is stored on the computer.
Answer: True

Entity Instance is an instance of a particular entity.


Answer: True

Controlling Redundancy is used to improve the performance of queries.


Answer: True

Data Manipulation Language is use for manipulating data in a database.


Answer: True

Describes how entities are related.


Answer: Relationships
An attribute that has a multiple value.
Answer: Multi-value attribute

People whose jobs require access to the database for querying, updating, and generating
reports.
Answer: End users

It describes how entities are related to each other.


Answer: Relationship

A thing that shares a common attribute.


Answer: Entity class

It is a question or an inquiry, sometimes loosely used for all types of interactions with databases.
Answer: Query

Attribute is a name for a set of similar things that you can list. Like objects, events, people.
Answer: False

A displayed schema is called Schema figure.


Answer: False

Composite Attribute can be calculated from other attributes.


Answer: False

We call the database and DBMS software together as a(Answer).


Answer: database system

Logical Design – transforming the ERD into relational model.


Answer: True

Matching Type Test

Like Web search engines (engine like Google), which the user can specify a string or any
keywords and expect to get a relevant result.
Answer: Keyword-based Database Search

Used to performed or rollback the changes that we made in the database using DML
commands.
Answer: Transaction Control Language (TCL)
Used for creating tables, schema etc. in database.
Answer: Date Cefinitian Language (DDL)

The interface presents a menu that lead to a user through request.


Answer: Menu-based Interfaces far Web Clients or Browsing

Used to give or control privilege in a database.


Answer: Date Control Language (DCL)

Used to manage data within the object schema.


Answer: Date Manipulation Language(DML)

The interface allows users to access their data through their mobile phone or mobile device.
Answer: Applications for mobile devices

Display a form to be fill out by the user.


Answer: Forms-based Interfaces

In the given relationship, the doctor attends to the patient. What is the relationship between
doctor and patients?
Answer: attends

Given the following relationship, the patient was assigned to a room. What is the relationship
between patient and room?
Answer: assigned

Entity CUSTOMER can be characterized by Id, Name, and Address. What is sub-attributes of
the customer address?
Answer: number, street, city, and state

An Engineer builds a house with few workers. Based on the given statement, what is the
relationship between engineer and a few workers?
Answer: builds

An Engineer builds a house with few workers and raw materials participating in this building at
the same time. What are the entities involved in this relation?
Answer: Engineer, house, few workers and raw materials
Using the table below, what is the UNF of the following table?

Answer: userID, name, company_id, company, company_address, url1,url2

Based on the given table above, what is the primary key for the user table?
Answer: userid, companyid

UserTable(userid, name)

Using the above table, what is the primary key of the table named UserTable?
Answer: userid

CompanyTable( companyid, company, company_address)

What is the primary key?


Answer: companyid

It is the process of producing a set of tables with proper attributes


Answer: Normalization
salesman_id | name | city | commission

-------------+------------+----------+------------

5001 | James Hoog | New York | 0.15

5002 | Nail Knite | Paris | 0.13

5005 | Pit Alex | London | 0.11

5006 | Mc Lyon | Paris | 0.14

5007 | Paul Adam | Rome | 0.13

5003 | Lauson Hen | San Jose | 0.12

You need to create a table for a salesmen table, which statement creates the table above?
Answer: Create table salesmen( salesman_id int not null primary key, name varchar(30), city
varchar(30), commission decimal(4,2));

salesman_id | name | city | commission

-------------+------------+----------+------------

5001 | James Hoog | New York | 0.15

5002 | Nail Knite | Paris | 0.13

5005 | Pit Alex | London | 0.11

5006 | Mc Lyon | Paris | 0.14

5007 | Paul Adam | Rome | 0.13

5003 | Lauson Hen | San Jose | 0.12

Which SQL statement below displays all the information of all salesmen?
Answer: Select * from salesmen;

Which SQL statement will display the names and city of the salesman, who belongs to the city
of Paris?
Answer: Select name, city from salesmen where city='Paris';
YEAR SUBJECT CATEGORY WINNER
COUNTRY

---- ------------------------- --------------------------------------------- ------------------------- ------------

1970 Physics Scientist Hannes Alfven


Sweden

1970 Physics Scientist Louis Neel


France

1970 Chemistry Scientist Luis Federico Leloir


France

1970 Physiology Scientist Ulf von Euler


Sweden

1970 Physiology Scientist Bernard Katz


Germany

1970 Literature Linguist Aleksandr Solzhenitsyn


Russia

1970 Economics Economist Paul Samuelson


USA

1970 Physiology Scientist Julius Axelrod


USA

1971 Physics Scientist Dennis Gabor


Hungary

1971 Chemistry Scientist Gerhard Herzberg


Germany

1971 Peace Chancellor Willy Brandt


Germany

1971 Literature Linguist Pablo Neruda


Chile

1971 Economics Economist Simon Kuznets


Russia
1978 Peace President Anwar al-Sadat
Egypt

Using the nobel_win table above, give the name of the 'Physics Scientist' winner since 1970.

Which of the following SQL statement produced the desired result?


Answer: Select year, subjectcategory, winner from nobel_win where subjectcategory= 'Physics
Scientist' and year = 1970 ;

Using the nobel_win table above, you need to write all the details of the Chemistry
winner(year,subjectcategory, winner, country) from the year 1970.

Which of the SQL statement would produce the required result?


Answer: Select * from nobel_win where subjectcategory='Chemistry Scientist' and year= 1970;

Using the above nobel_win table, you need to generate a report that will show all the Physiology
winners in the year 1970.
Answer: Select year, subjectcategory, winner from nobel_win where subjectcategory =
'Physiology Scientist' and year= 1970;

Using the salesmen table above, you need to generate a report that shows the name and
commission from the table salesmen.

Which SQL statement would produce the required result?


Answer: Select name, commission from salesmen;

You need to generate a report that will show all the salesmen's commissions with less than or
equal to 15%.

Which SQL statement produced the desired result?


Answer: Select name, commission from salesmen where commission<=0.15;

Which SQL statement displays the city of the salesmen that starts with the letter P?
Answer: Select name, city from salesmen where city like 'P%';

Which SQL statement will display the name of the winner from Physiology Scientist?
Answer: Select subjectcategory, winner from nobel_win where subjectcategory='Physiology
Scientist';
Given the following data definition, select all city names in descending order:

TABLE cities

id INTEGER NOT NULL PRIMARY KEY

name VARCHAR(30) NOT NULL


Answer: select name from cities order by name desc

Write an SQL query to find the employee id whose salary lies in the range of 9000 and 15000.
Answer: SELECT EmpId, Salary FROM EmployeeSalary WHERE Salary BETWEEN 9000 AND
15000;
Write an SQL query to fetch all the employees who either live in California or work under a
manager with ManagerId – 321.
Answer: SELECT EmpId, City, ManagerId FROM EmployeeDetails WHERE City='California' OR
ManagerId='321';
Write an SQL query to fetch the employees whose name begins with any two characters,
followed by a text “hn” and ending with any sequence of characters.
Answer: SELECT FullName FROM EmployeeDetails WHERE FullName LIKE ‘__hn%’;
Fetch all the employees who are not working on any project.
Answer: SELECT EmpId FROM EmployeeSalary WHERE Project IS NULL;

You might also like