1. Identify the correct attribute data type and precision that can be used to create an inventory table for a
school stationery shop where:
a. the total number of unique items in the shop does not exceed 5,000
b. nothing in
Determines which columns to include in the querys result set
Identifies the tables from which to draw data and how the tables should
Restricts the number of rows in the final result
A. Was developed by E.F.Codd
B. First appeared in 1972
C. Provides a set of rules for each normal form
D. Provides a procedure for converting relations to each
E. Was first introduced with five normal forms
2. The insert anom
Examples of simple query
Select all records from a table and display all
SELECT * FROM EMPLOYEE_TBL;
Select all records from a table and display a
Select all records from a table and display a
SQL (Structured Query Language) is a computer
language designed for managing data in relational
database management systems (RDMSs).
SQL statements may be divided into the following categories:
Data Query Language (DQL) Statements that query the data
1. SQL was first developed:
A. In the 1970s
B. In 1982
C. By IBM
D. By ANSI
E. Based on ANSI specifications
2. A SELECT without a where clause:
A. Always output results to a log file
B. Results in an error message
C. Selects all columns in the source tabl
1. Retrieve the employee ID, first name, and last name for all bank
employees. Sort by last name then first name.
SELECT emp_id, fname, lname
ORDER BY lname, fname;
Database query quiz
1. Name the required parts for any SELECT statement.
The SELECT and FROM keywords, also called as clauses, are required for
all SELECT statements.
2. In the WHERE clause, are single quotation marks required for all the
What is Data?
Data is a collection of information stored in a database as one of several
different data types. Data includes names, numbers, dollar amounts, text,
graphics, decimals, figures, calculations, summarization, and just about
anything else you c
1. What does the acronym SQL stand for?
SQL stands for Structured Query Language.
2. What are the six main categories of SQL commands?
Data Definition Language (DDL)
Data Manipulation Language (DML)
Data Query Language (DQL)
Data Control Language (
Max() returns the maximum value within a set
Min() returns the minimum value within a set
Avg() returns the average value within a set
Sum() returns the sum of the values in a set
Count() returns the number of values in a set
Types of SQL commands
The following sections discuss the basic categories of commands used
in SQL to perform various functions. These functions include building
database objects, manipulating objects, populating database tables
with data, updating existin
Tutorial 6,7 ERD
Tutorial 9 ER Mapping
Objectives - On completion of this tutorial, the students will be able to:1. Transform various business requirements to the ER model.
2. Draw an ER model for a given case.
3. Map the relations using steps used in ER
C207 DATABASE SYSTEM
Storing & processing vast quantity of datas
Table stored in system
Prevents lost or duplicated data.
> (Greater Than)
DATA BASE P1 - P10
-A structured way od storing our data
-A collection of attritubes shown across the page
A single attribute of a row shown down the page
-The intersection of a row and a column
-Holds a s
Number of Attempts 1 out of 1
Total Score out of 40
Use the following table to answer all questions in this section. The
employee table sample records are given for your reference. Please note
that NOT ALL records are shown.
Sakila I Worksheet
SQL Refresher (Easy)
1. Select the first and last names for all actors. Order the list by the actors first name.
SELECT first_name, last_name
ORDER BY first_name ASC ;
2. Select the film title, release year and language (not
1) What is the difference between a column and an attribute?
A column is only used in a spreadsheet. An attribute is used in a database.
An attribute must be physical. (e.g., hair colour, gender)
There is effectively no differen
Write the SQL statement to display the list of students who borrowed more than 5 books. Take
note of the column headings and the order of rows.
Number of Books
SELECT s.name as Student
Sakila II Worksheet
1. A report from the previous problem showed actors id, last name, first name and number of films
he or she acted in (list the number of films in descending order). The report can be generated by
following SQL statement. The report has
Worksheet Henrys Helper
1) What is the maximum possible cost price? Express your answer as digits. For example 999.99
2) Within the receipt table, does the receipt_no need to be unique?
-Receipt has to be unique as
An insert anomaly is a situation where you cannot
insert a new tuple into a relation because of an
artificial dependency on another relations.
A delete anomaly is a situation where a deletion of
data about one particular entity causes unintend