You wish to create an attribute in a table of 6 digits in total with 2 digits to the right of the decimal point. Which of the following data types would you use?
number (6,2)
number (4,2)
number (float)
The following are the main clauses used in the SQL Select statement.
a) select b) from c) where d) group by e) having f) order by
The following describes the purpose of these clauses but are out of order.
• groups rows • Specifies columns in output • eliminates unwanted groups • sorts rows • Specifies tables used in query • eliminates unwanted rows
Which of the clauses above relates to the purpose ‘eliminates unwanted groups’?
A
B
C
D
E
F
To request all attributes in a SELECT clause, you can use the wildcard '*' character. True or False?
True
False
The percentage ‘%’ wildcard is used when searching for partial matches in a character string with attribute values; it means ‘any single value’. True or False?
True
False
Textual data is always sorted into alphabetical order in ORDER BY clauses. True or False?
True
False
A programmer wanted to write code which would list the bus drivers in the bus depot database with the name of their depots. He wrote the following code:
Select bdName, dName from BusDriver, Depot;
The programmer found that he did not get the desired results. Describe, as one of the relational algebra operators below, what the programmer has coded:
a natural join
an intersection
a product
an outer join
What should be added to the code in question 6 to give the correct results, i.e. of listing the bus drivers with the name of their depots.?
Select bdName, dName from BusDriver, Depot;
A ‘group by’ clause
aliases
a subquery
A join condition
ORACLE SQL treats NULL values in numeric fields as zeros. True or false?
True
False
We want to find the bus drivers and the depot where the bus driver is located. We are not interested in bus drivers who have not been allocated to a depot. To do this query we use an outer join. True or false?
True
False
We want to find the bus drivers and the depot where the bus driver is located. We also want to include bus drivers who have not been allocated to a depot. To do this query we use an inner join. True or false?