Quiz
CS3319 Quizzes
This quiz has question types that open in the usual player.
Questions in this quiz (66)
1The speed and efficiency of the database is determined mainly at which level of the 3 Schema Architecture?
- AA. Internal Level
- BB. External Level
- CC. Conceptual Level
2Match the following attribute terminology to an example of each.
A. 250123456 (student number of a Western Student)
B. 65 Compton Cres, London, Ontario (street, city, prov)
C. 24 square metres (area of a rectangle where the width and height are also stored)
D. Phone Number (Cell, Home, Work)
E. Seat G4 (seat number given to a passenger taking a given flight)
[blank_start]1[blank_end]. Multivalued Attribute
[blank_start]2[blank_end]. Derived Attribute
[blank_start]3[blank_end]. Composite Attribute
[blank_start]4[blank_end]. Key Attribute
[blank_start]5[blank_end]. Relationship Attribute- AA
- BB
- CC
- DD
- EE
- FA
- GB
- HC
- ID
- JE
- KA
- LB
- MC
- ND
- OE
- PA
- QB
- RC
- SD
- TE
- UA
- VB
- WC
- XD
- YE
3Assume we are designing an ER diagram for a restaurant, which of the following would be represented as an ENTITY? (Select all that apply)
- ATable Number (identifies the table within the restaurant)
- BTable
- CWaiter
- DCustomer
- ETable Capacity (number of people who can sit at it)
- FServes (e.g. Waiter servers Table)
4Multivalued attributes in an ER diagram will map to their own table in a relational database.
- ATrue
- BFalse
5Which of the following relationships has partial participation on the RIGHT side of the relationship (reading from left to right)?
- AASTRONAUT lands on MOON
- BPLANET contains LIFE
- CPLANET orbited by MOON
- DSUN orbited by PLANET
6Which of the following entities on the RIGHT side of the relationship is NOT a weak entity?
- ABOOK has CHAPTER
- BTEACHER works at SCHOOL
- CBUILDING has ROOM
- DCOURSE offers SECTION
7Match the term to an example of it (select the best pairing):
A. An art gallery with paintings, artists, employees, rooms, customers
B. Toronto
C. A Person's Calendar
D. MySQL or MSAccess
[blank_start]1[blank_end]. Data
[blank_start]2[blank_end]. Database
[blank_start]3[blank_end]. Mini-world
[blank_start]4[blank_end]. Database Management System (DBMS)- AA
- BB
- CC
- DD
- EA
- FB
- GC
- HD
- IA
- JB
- KC
- LD
- MA
- NB
- OC
- PD
8Assuming students must work alone and they are taking an Writing course where essay writing is required, then the (min, max) participation on the LEFT side of the relationship:
STUDENT writes ESSAY
would likely be:
(1,1)- ATrue
- BFalse
9Only one relationship can exist between two different entities.
- ATrue
- BFalse
10Match the following relationships to the correct cardinality.
A. MANY to MANY
B. ONE to ONE
C. ONE to MANY
[blank_start]1[blank_end]. CITY capital of COUNTRY
[blank_start]2[blank_end]. COUNTRY headed by (lead by) PRESIDENT
[blank_start]3[blank_end]. VOTER votes for CITY MAYOR CANDIDATE
[blank_start]4[blank_end]. MOON orbits PLANET
[blank_start]5[blank_end]. COUNTRY member of INTERNATIONAL_ORGANIZATION
[blank_start]6[blank_end]. COUNTRY borders COUNTRY
[blank_start]7[blank_end]. COUNTRY has PROVINCE
[blank_start]8[blank_end]. POLITICIAN speaks to REPORTER- AA
- BB
- CC
- DA
- EB
- FC
- GA
- HB
- IC
- JA
- KB
- LC
- MA
- NB
- OC
- PA
- QB
- RC
- SA
- TB
- UC
- VA
- WB
- XC
11Given the following ER diagram, once it is completely mapped to a relational database, how many tables will be created?

- A1
- B2
- C3
- D4
- E5
- F6
- GMore than 6 tables will be created.
12Given the following ER diagram, once it is completely mapped to a relational database, the STUDENT table and the PROFESSOR table will both have the exact same number of attributes?

- ATrue
- BFalse
13END OF QUIZ 1
- ATrue
- BFalse
14Why is a database normally stored on a Hard Disk rather than in Main Memory? Select all that apply
- ABecause the hard disk has faster access than main memory
- BBecause the hard disk is cheaper than main memory
- CBecause the hard disk is less volatile than main memory
- DBecause the hard disk can store more data than main memory
- EBecause the hard disk takes up less physical space than main memory
15Which of the choices below would be considered good reasons for using a heap file organization? (Select ALL that apply)
- AEvery time we use this table, we need to get every single tuple/record
- BLots of searches will be required on the file
- CThis file (table/relation) is very small
- DThe data will often be bulk loaded into the relation/table
- EThe data will have to be sorted often
16When adding the following values to a B+ tree with order 3 and pleaf=2, after adding all of the items below, what value will be in the root node? If 2 values will be in the root after all the values are added then select both values. You must go left down the tree for <= (less than or equal) and you must go right down the tree for > (greater than).
Values to be inserted into the B+ tree in THIS order:
8, 33, 44, 22, 10, 5, 4- A10
- B5
- C44
- D22
- E33
- F8
- G3
17Which of the following operations below will give us closure over strings? Check all that apply
- AConcatenate 2 strings - returns the 2 strings joined together
- BLength of a string - returns the number of characters in a string
- CTrim a string (remove the spaces at the beginning and end of a string) - returns the trimmed string
- DPosition of one substring inside another - returns the position where one string is found inside another string. If the string is not found, then it returns -1
18How many rows will be returned from σd='B' (A)

- A1
- B2
- C3
- D4
- ENone of the Above
19How many rows will be returned from πd (A)

- A1
- B2
- C3
- DNone of the Above
20How many rows will be returned from πd (A) - πd (B)
- A0
- B1
- C2
- D3
- ENone of the Above
21The will be [blank_start]__[blank_end] row(s) returned from (A ⋈ B)
- A6
22Assume we have the following two tables A and B
If we execute the relational algebra formula: (A ⋈(aa=baa) B)
Then the resulting table will contain [blank_start]__[blank_end] tuples and [blank_start]__[blank_end] attributes
- A2
- B5
23Given the following 2 tables: AA and BB:
The operation :
AA ∪ BB
Will produce how many tuples?
- ALess than 4
- B4
- C5
- DMore than 5
- EThis operation cannot be done as these tables are not union compatible
24Match the relational algebra query to what it represents in English.
A. (πFirstName (σCity='Toronto' (TEAM) ⋈CaptainPlayerId=PlayerID PLAYER))
B. (πFirstName (σCity='Toronto' (TEAM)) ⋈ PLAYER)
C. πTeamName (TEAM)
D. (πTeamName (σCity='Toronto' (TEAM)))
E. (πFirstName (TEAM ⋈CaptainPlayerId=PlayerID PLAYER))
[blank_start]1[blank_end]. Show me the team names of all the teams
[blank_start]2[blank_end]. Show me the first name of all players who play for a Toronto team
[blank_start]3[blank_end]. Show me the team name of all Toronto teams
[blank_start]4[blank_end]. Show me the first name of all team captains
[blank_start]5[blank_end]. Show me the first name of all the team captains for Toronto teams
- AA
- BB
- CC
- DD
- EE
- FA
- GB
- HC
- ID
- JE
- KA
- LB
- MC
- ND
- OE
- PA
- QB
- RC
- SD
- TE
- UA
- VB
- WC
- XD
- YE
25Look at tables A and B
Then the relation (Table AA joined with Table BB) is an example of what kind of join?
- ANatural Join
- BFull Outer Join
- CRight Outer Join
- DLeft Outer Join
26END OF QUIZ 2
- ATrue
- BFalse
27How many rows would be returned from:
SELECT * FROM AA WHERE c = 7;
- A1
- B2
- C3
- D4
- ENone of the above
28How many attributes would be returned from:
SELECT * FROM AA WHERE c = 7;
- A1
- B2
- C3
- D4
- ENone of the above
29There would be [blank_start]__[blank_end] rows returned by this SQL statement:
SELECT b, c FROM AA WHERE d='B';
- A3
30There will be [blank_start]__[blank_end] rows returned by this SQL query:
SELECT a, f FROM AA, CC where b=e and d='B';
- A6
31This SQL command:
SELECT a, d FROM AA WHERE c NOT IN (SELECT c FROM AA WHERE d="B");
will return [blank_start]__[blank_end] row(s).- A1
32Decide if the following commands are either a MySQL command OR a standard SQL command
A. MySQL Command
B. SQL command
[blank_start]1[blank_end]. SHOW tables;
[blank_start]2[blank_end]. INSERT INTO customer (cid,first,last) VALUES ('100','Harry','Potter');- AA
- BB
- CA
- DB
33Given tables AA and BB, the SQL command:
SELECT a, AA.b, f FROM AA, BB WHERE c=5;
will return [blank_start]__[blank_end] columns and [blank_start]__[blank_end] rows.
- A3
- B6
34How many rows would be returned from:
SELECT SUM(a) FROM A GROUP BY c;
assuming you have the following tables:
- AA. less than 1
- BB. 1
- CC. 2
- DD. 3
- EE. 4
- FF. more than 4
35An instance of an entity of type A could be further classified as an entity of type B AND as an entity of type C at the same time.
- ATrue
- BFalse
36Given the following diagram and assuming you are going to store information about all Canadian animals and no additional entities will be added, what type of line should the red line be?
- ADashed
- BSingle
- CDouble
37Given these tables, the following relational calculus expression will return [blank_start]__[blank_end] tuples/rows and [blank_start]__[blank_end] attributes.
{t | B(t) AND t.baa = "a4"}
- A3
- B2
38Given the tables below, how many tuples would the following relational calculus return?
{a.aa, a.bb | A(a) and (( ∃b)(B(b) and b.baa=a.aa and a.cc>3}
- AA. Less than 2
- BB. 2
- CC. 3
- DD. 4
- EE. 5
- FF. 6
- GG. 7
- HH. 8
- II. More than 8
39Assume you have created a table called bloodtype using this command:
CREATE TABLE bloodtype (bloodtypeid CHAR(2), rhfactor CHAR(1), type CHAR(2), percent INT, PRIMARY KEY (bloodtypeid));
The SQL command to add the row for the blood type of AB positive (+) where 17% of the population have that type would be:
[blank_start]_______[blank_end] INTO bloodtype VALUES ('08','+','AB',17);- AINSERT
40END OF QUIZ 3
- ATrue
- BFalse
41$EmpName and $empname are different variables in PHP.
- ATrue
- BFalse
42PHP server scripts (PHP code) are surrounded by delimiters, what are they?
- AA. <?php...?>
- BB. <?php>...</?>
- CC. <script>...</script>
- DD. <&>...</&>
43All PHP code runs on the server, never on the client machine.
- ATrue
- BFalse
44In PHP you can use both single quotes ( ' ' ) and double quotes ( " " ) for strings.
- ATrue
- BFalse
45What PHP code will send "Hello World" to be displayed on a webpage?
- AA. Document.Write("Hello World");
- BB. echo "Hello World";
- CC. System.out("Hello World");
46Match the following PHP to the task it performs.
A. Performs a query on the database
B. Opens a connection to a database
C. Returns one row from a retreived query
D. Closes a connection to a database
[blank_start]1[blank_end]. mysqli_connect($dbhost,$dbuser,$dbpass,$dbname);
[blank_start]2[blank_end]. mysqli_fetch_assoc($result)
[blank_start]3[blank_end]. mysqli_query($connection,$query)
[blank_start]4[blank_end]. mysqli_close($connection);- AA
- BB
- CC
- DD
- EA
- FB
- GC
- HD
- IA
- JB
- KC
- LD
- MA
- NB
- OC
- PD
47Given the 2 tables: pet and owner with the following data:
And the following php code (assume the connection was made to the database):
What would be outputted by the code above?
- A1. dog
2. Waffles
3. Chimo - B1. dog
2. Brian
3. Chimo - C1. dog
2. Waffles
3. Waffles - D1. dog
2. Brian
3. Brian - ENone of the above
- A1. dog
48Assume we have tables AA (integer columns a, b and c) and BB (integer column e and d - table is empty initially) as shown below and we have the MySQL trigger shown below.
After we execute the following two SQL statements:
INSERT INTO BB (e, d) VALUES (20,10);
SELECT * FROM AA ORDER BY c;
then the values for the FIRST displayed row of table AA will be:
a will have the value of [blank_start]__[blank_end]
b will have the value of [blank_start]__[blank_end]
c will have the value of [blank_start]__[blank_end]
- A10
- B30
- C3
49Assume we are drawing an ER diagram of the entities in a relational database, match the entity name to what it would become in the ER diagram
A. Weak Entity
B. Attribute - Primary Key
C. Attribute - Weak Key
D. Entity
E. Derived Attribute
[blank_start]1[blank_end]. Table
[blank_start]2[blank_end]. Column
[blank_start]3[blank_end]. Database
[blank_start]4[blank_end]. DatabaseName
[blank_start]5[blank_end]. TableName
[blank_start]6[blank_end]. NumOfRowsInTable- AA
- BB
- CC
- DD
- EE
- FA
- GB
- HC
- ID
- JE
- KA
- LB
- MC
- ND
- OE
- PA
- QB
- RC
- SD
- TE
- UA
- VB
- WC
- XD
- YE
- ZA
- AAB
- ABC
- ACD
- ADE
50Assume I perform the following SQL commands:
If I compare the count returned from Line 1 to the count returned in Line 4, the count value would have changed by [blank_start]__[blank_end].
If I compare the count returned by Line 2 to the count returned by Line 5, the count value would have changed by [blank_start]__[blank_end].
If I compare the count returned by Line 3 to the count returned by Line 6, the count value would have changed by [blank_start]__[blank_end].
- A1
- B1
- C1
51Which of the following is NOT a method for handling leaks of information via Statistical Database Queries
- AA. Limit queries if the result returns a number of rows less than a certain threshold of rows
- BB. Limit repeated queries that refer to the same tuples
- CC. Restrict user from using aggregate functions such as AVERAGE,COUNT, MIN, MAX, ete. Only let them do SELECT * FROM ... type of queries.
- DD. Introduce "noise" (inaccuracies) into results to make it difficult to deduce individual information
- EE. All of the above are methods used to stop leaks in Statistical Database Security.
52Role Based Security is useful (select all that apply)
- AIf you have a company with thousands of employees
- BIf you need to do statistical queries that use aggregate functions such as MAX, MIN, COUNT and AVG.
- CIf groups of employees in your company have predefined roles and each role should have the same level of access (select or insert or etc..) to the tables/databases/columns.
- Dif you want to give people and the data top secret, secret, confidential and unclassified levels of control.
53END OF QUIZ 4
- ATrue
- BFalse
54Assume you have the following table: R with attributes: {A, B, C, D, E, F, G, H, I, J, K} and the following dependencies: { (B, D, G --> C, E), (B, D --> K), (B-->A, F), (G-->H), {H-->I}, {I-->J}}
How many tables, in total, will there be when you put R into second normal form?- AA. 1
- BB. 2
- CC. 3
- DD. 4
- EE. More than 4
55Assume you have the following table: R with attributes: {A, B, C, D, E, F, G, H, I, J, K} and the following dependencies: { (B, D, G --> C, E), (B, D --> K), (B-->A, F), (G-->H), {H-->I}, {I-->J}}
How many tables, in total, will there be when you put R into third normal form?- AA. 3
- BB. 4
- CC. 5
- DD. 6
- EE. more than 6
56Assume you have the following table: R with attributes: {A, B, C, D, E, F, G, H, I, J, K} and the following dependencies: { (B, D, G --> C, E), (B, D --> K), (B-->A, F), (G-->H), {H-->I}, {I-->J}}
K is partially functionally dependent on B, D?- ATrue
- BFalse
57LicencePlateNumber --> CarColour
- ATrue
- BFalse
58Which of the following granualarities of locking will be the least restrictive to other transactions that are waiting for a locked item?
- AWhich of the following granualarities of locking will be the least restrictive to other transactions that are waiting for a locked item?
- BTable Level
- CRowLevel
- DField Level
- EPage Level
59Assume we have two transactions T1 and T2. We could have a schedule S1 which performs all of T1 then all of T2. Or we could have another schedule S2, which performs all of T2 then all of T1. If S1 results in different values in the database than S2 would have given, S1 and/or S2 did NOT represent serializable schedules.
- ATrue
- BFalse
60Assume you create a transaction called T1 that requests the average of the prices for all the items in your warehouse. After T1 has started running, T2 starts running to increase all the item prices by 5%. Thus, your final average represents the average of some prices with the old value and some with the new value. This type of transaction corruption is referred to as:
- AA Lost Update
- BUncommitted Data
- CInconsistent Retrieval
- DIt is okay for a transaction to allow this to happen, as long as it is only reading the data and reporting the results without updating the data (Thus, transaction T1 is not a problem)
61Assuming you have three transactions: T1, T2 and T3.
Then, the number of possible serial schedules that exist is: [blank_start]__[blank_end]- A6
62Assume we have a sparse index on the Price attribute in a Products table. Which of the following SQL statements would be speed up the query AND give the correct results by ONLY referencing the index file (and never touching the actual product table). Check all that apply.
- ASELECT MIN(price) FROM product;
- BSELECT MAX(price) FROM product;
- CSELECT AVERAGE(price) FROM product;
- DSELECT SUM(price) FROM product;
- ESELECT COUNT(price) FROM product;
63The following table is not normalized:

- ATrue
- BFalse
64When using Time Stamping, which of the following Time Stamps do you need to save in a situation where Transaction T is trying to use the piece of data called Quantity? (Select all that apply)
- AStart Time of Transaction T
- BRead Time of (Quantity)
- CWrite Time of (Quantity)
- DEnd Time of Transaction T
65Which operation should be closest to the leaves of a query optimization tree?
- ACartesian Product
- BJoin
- CProjection
- DSelection
66END OF QUIZ 5
- ATrue
- BFalse
Information
- Description
- Computer Science Quiz on CS3319 Quizzes, created by Kashawn Brown on 10/12/2021.
- Author
- Kashawn Brown
- Language
- English
- Views
- 14
- Tags
- Rating
- No ratings yet Rate this quiz