NEW
Font size
WorksheetsDatabases
Total questions: 55
Worksheet time: 41mins
Text, Integer, Currency, Boolean and Date/Time are all examples of...
Data Types
Filters
Sorts
Validations
The HD field is using the data type Boolean
True
False
Which of the following is an example of a field?
347
ChannelType
351, Nature, Documentary, Bling, False
Which data type would be most suitable for Length?
Integer
Float/Double
Boolean
String
Normalisation is:
Removing all necessary data from a database
Organising a database to remove repeated entries and increase the accuracy of the data
Putting fields from different tables into one big database
What is an atomic field?
A field that contains multiple items of data
A field that is repeated
A field that contains only one item of data
What is a foreign key?
A unique identifier in a database
A primary key of one table that appears in another table
A field that should not be in a table and needs removing
A relation is in 1NF if it doesn't contain any ____________?
Determinants
Repeating groups
Null values in primary key fields
Functional dependencies
When you normalize a relation by breaking it into two smaller relations, what must you do to maintain data integrity?
Remove any functional dependencies from both relations
Assign both relations the same primary key field(s)
Create a primary key(s) for the new relation
Tables in ____ will perform suitably in business transactional databases.
0NF
1NF
2NF
3NF
SELECT *
_______ CUSTOMER;
In ACID, A stands for Atomicity. But what does that mean?
A transaction must be processed in its entirety or not at all
A field must have a field length
There must be validation on the key fields
A transaction must have a valid link to another record on a linked table
In ACID, the C stands for consistency. What does this mean?
A transaction must be consistent
A transaction must have a related record on another table
A transaction cannot break any of the validation rules which maintain the integrity of the database
A transaction must not force a failure in the database which causes ACID to fail overall
The I in ACID stands for isolation. What does this mean?
A transaction that has been bad must be placed in isolation until it knows what it has done wrong. Usually 1 minute per year after it has been created.
No other transaction can be completed until the current transaction is completed even if they have to be completed concurrently.
If somebody is accessing the same record, they must be stopped
Records are put on their own for identification
The D in ACID stands for durability. What does this mean?
All transactions must be recorded on the database
The database is able to be used by anybody
If somebody drops the storage drive with the database on, it will still function
Once a transaction has been committed, the transactions dependent on this will be completed even if there is a power cut
If you don’t specify ASC or DESC after a SQL ORDER BY clause, the following is used by default
ASC
DESC
There is no default value
None of the mentioned
Which SQL function is used to count the number of rows in a SQL query?
COUNT()
NUMBER()
SUM()
COUNT(*)
With SQL, how do you select all the records from a table named “Persons” where the value of the column “FirstName” ends with an “a”?
SELECT * FROM Persons WHERE FirstName=’a’
SELECT * FROM Persons WHERE FirstName LIKE ‘a%’
SELECT * FROM Persons WHERE FirstName LIKE ‘%a’
SELECT * FROM Persons WHERE FirstName=’%a%’
How can you change “Hansen” into “Nilsen” in the “LastName” column in the Persons table?
UPDATE Persons SET LastName=’Hansen’ INTO LastName=’Nilsen’
MODIFY Persons SET LastName=’Nilsen’ WHERE LastName=’Hansen’
MODIFY Persons SET LastName=’Hansen’ INTO LastName=’Nilsen’
UPDATE Persons SET LastName=’Nilsen’ WHERE LastName=’Hansen’
SQL query to find all the cities whose humidity is 95.
SELECT city WHERE humidity = 95
SELECT city FROM weather WHERE humidity = 95
SELECT humidity = 89 FROM weather
SELECT city FROM weather
SQL query to find the temperature in increasing order of all cities.
SELECT city FROM weather ORDER BY temperature
SELECT city, temperature FROM weather
SELECT city, temperature FROM weather ORDER BY temperature
SELECT city, temperature FROM weather ORDER BY city
Find the name of those cities with temperature and condition whose condition is either sunny or cloudy but temperature must be greater than 70.
SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND condition = ‘cloudy’ OR temperature > 70
SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ OR temperature > 70
SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ AND temperature > 70
SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND condition = ‘cloudy’ AND temperature > 70
The command to remove rows from a table ‘CUSTOMER’ is __________________
DROP FROM CUSTOMER
UPDATE FROM CUSTOMER
REMOVE FROM CUSTOMER
DELETE FROM CUSTOMER WHERE
Find the names of these cities with temperature and condition whose condition is neither sunny nor cloudy.
SELECT city, temperature, condition FROM weather WHERE condition NOT IN (‘sunny’, ‘cloudy’)
SELECT city, temperature, condition FROM weather WHERE condition NOT BETWEEN (‘sunny’, ‘cloudy’)
SELECT city, temperature, condition FROM weather WHERE condition IN (‘sunny’, ‘cloudy’)
SELECT city, temperature, condition FROM weather WHERE condition BETWEEN (‘sunny’, ‘cloudy’);
SQL is
Structured Query Language
Simple Query Language
Structured Question Language
Structure Quality Language
Which statement is used to extract data from a database?
Extract
Get
Open
Select
In order to modify data in a database we would use which SQL statement?
Update
Amend
Alter
Modify
To remove a record from a table which SQL statement would you use?
Remove
Cancel
Delete
Eradicate
Which statement allows us to add a record to a table?
Add To
Update To
Add Into
Insert Into
______________ constraint prevents NULL values
UNIQUE
NOT NULL
NULL
FOREIGN KEY
