CS148 Midterm

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

What is missing from the join statement? SELECT EmployeeName, Salary FROM Employee, Department WHERE Salary > 50000 Left and right tables are not specified. No columns from Department appear in the SELECT clause. A column from Employee is not compared to a column from Department.

A column from Employee is not compared to a column from Department.

1) What is the result of a relational operation? A row A column A table

A table

Collection of web development technologies first released in 2002 by Microsoft that uses the C# or VB.NET programming languages.

ASP.NET

When does feof() return TRUE? Before reading the first line from showtimes.txt. After reading the first line from showtimes.txt. After reading the last line from showtimes.txt.

After reading the last line from showtimes.txt

Discovery is a step in which phase? Analysis Logical design Database design

Analysis

Specification of database requirements without regard to implementation

Analysis

Eliminate dependencies on non-unique columns.

Boyce-Codd normal form

CREATE VIEW ___A___ (EmployeeNumber, ___B___, Dept) AS SELECT ___C___, FacultyName, DepartmentName FROM Faculty, Department WHERE Faculty.Code = Department.Code WITH ___D___; What are keywords D?

CHECK OPTION

Testing the web application's ability to work on various browsers, operating systems, and platforms.

Compatibility testing

Choose whether the information to be stored should be placed in a cookie or a session variable. Date the browser last accessed the website.

Cookie

Choose whether the information to be stored should be placed in a cookie or a session variable. The last ZIP code searched on a weather website.

Cookie

Which database is relational? DB2 IDMS MongoDB

DB2

The overall process of determining and implementing database requirements

Database design

What is wrong with the following entity description? The difference between a course and a class is that a course refers to the catalog description, while a class is an individual offering of a class in a specific term. Description does not begin with entity name. Description does not include counterexamples. Description does not use complete sentences.

Description does not begin with entity name

Which PHP error type CONSTANT does this code produce? while (TRUE);

E_ERROR - fatal error

Which PHP error type CONSTANT does this code produce? echo $uninitializedVariable;

E_NOTICE - notice

If trigger_error() is called to trigger an error, what value is myErrorHandler()'s $errno guaranteed not to be? E_USER_ERROR E_WARNING E_USER_WARNING

E_WARNING

Which PHP error type CONSTANT does this code produce? $answer = 2 / 0;

E_WARNING - warning

What is the result of FALSE AND NULL in SQL Server? TRUE FALSE NULL

FALSE

If the view table is not stored, against what tables is the query executed? SELECT * FROM DepartmentView; Department only Faculty and Department DepartmentView

Faculty and Department

"Column B depends on column A" means each value of B relates to at most one value of A. True False

False

$mysqli->affected_rows reports the number of rows selected by a SELECT statement. True False

False

$mysqli->query() returns FALSE if the UPDATE or DELETE statement did not update or delete any rows. True False

False

'Cardinality' refers to relationships only. True False

False

(AirportCode, DirectionCode) is a good primary key. True False

False

(AirportName, RunwayNumber) is a good primary key. True False

False

A web hosting company that hosts websites for free is likely to provide services like automated backups, unlimited disk space, and 24-hour customer support. tf

False

All cryptographic hash functions produce the same size hash digest. True False

False

All design decisions in the 'implement entities' step are affected by the database system. True False

False

An entity instance can be in two subtypes of the same partition. True False

False

An entity-relationship model is developed for all database design projects. True False

False

Analysis considers details of a specific database. True False

False

CSS front-end frameworks are required to build responsive websites that work well on mobile devices. True False

False

Data type depends on attribute cardinality. True False

False

Data types are independent of the database system. True False

False

Database designers should ensure all tables are in fifth normal form. True False

False

Delete cascade is an example of a structural rule. True False

False

Determining cardinality always precedes distinguishing independent and dependent entities. True False

False

Distinguishing independent and dependent entities is a logical design activity. True False

False

Entities, relationships, and attributes always map directly to tables, foreign keys, and columns, respectively. True False

False

First-normal-form tables have no dependencies between columns. True False

False

Given a hash digest, a clever hacker might be able to determine the original input that created the hash digest. True False

False

Haml code can be rendered directly in a web browser. True False

False

If the "price" cookie is not set, the code segment below creates the "price" cookie and outputs 125. if (!isset($_COOKIE["price"])) { setcookie("price", 125); echo $_COOKIE["price"]; } True False

False

In MySQL, two different queries that generate the same result table always have the same execution time. True False

False

In the analysis phase, cardinality is always determined after discovery is complete. True False

False

Many-one and one-one relationships are always implemented before many-many relationships. True False

False

NUMERIC is a decimal type supported by the Oracle database. True False

False

One partition attribute can correspond to several partitions. True False

False

PHP code runs in a web browser. True False

False

Redundancy is the repetition of a value. True False

False

Referring to the figures above, if the user submitted the name as "<h1>Pam</h1>" and howmany as 4 , the browser would display: "Pam ordered 4 widgets." True False

False

Relational databases will likely not be used for many web applications in the future. True False

False

Suppose the file greeting.txt, which contains 5 words, has been successfully opened. The code below displays the entire contents of greeting.txt to the browser. $contents = fread($myfile, 5); echo "<h1>$contents</h1>"; True False

False

The CHAR data type represents a variable string of characters. True False

False

The activities of the 'implement entities' step are always executed in sequential order. True False

False

The business logic of an SPA should generally be encoded in the front-end. True False

False

The catalog allows the storage manager to quickly locate the requested data. True False

False

The code below sends an error message to the error log.error_log("my error", 1, "[email protected]"); True False

False

The code segment outputs "<p>How are you?</p>". function askQuestion() { echo "<p>$question</p>"; } $question = "How are you?"; askQuestion();

False

The include statement inserts the contents of another file before the PHP script executes. TF

False

TypeScript code is executed by the web browser. True False

False

UI libraries always use JavaScript to govern the behavior of the UI widgets. True False

False

Web hosting companies generally charge more for hosting on Linux servers than for hosting on Windows servers. tf

False

When the browser makes an API request to a third-party web API, the web API key can be kept secret from prying eyes. True False

False

Verifying that each individual application function is working as expected.

Functionality Testing

What is $_SERVER["REQUEST_METHOD"] the first time a script is loaded in the web browser?

GET

What values are required to create a mysqli object? Username and password only Hostname only Hostname, username, password, and database

Hostname, username, password, and database

What is the value of $status? $status = $mysqli->real_escape_string("I'm learning " . '"PHP"!'); I'm learning "PHP"! I\'m learning \"PHP\"! TRUE

I\'m learning \"PHP\"!

Join all rows from tables A and B where the join condition is met.

Inner join

Testing the interaction between the front-end and back-end and the interactions between the server-side programs and the database.

Interface testing

UPDATE AccountView SET Difference = 4400 WHERE Code = 'COMP'; Valid Invalid

Invalid

Used to create applets on the front-end and servlets, JavaServer Pages, and web APIs on the back-end.

Java

Implementation of database requirements as tables, keys, and columns in a specific database system

Logical design

Minimum cardinality of one.

NOT NULL

What is the result of 0 < NULL in MySQL? NULL UNKNOWN 0

NULL

Can a website that stores password hashes in their database recover lost passwords for their users? Yes No

No

Which columns can be compared in a join? Only primary and foreign key columns. Only columns with comparable data types. Any columns.

Only columns with comparable data types

Scripting language created in 1994 by Rasmus Lerdorf. Currently the most popular server-side language in use.

PHP

What is returned by a successful call to json_decode()? PHP object JSON response NULL

PHP object

Maximum and minimum cardinality of one.

PRIMARY KEY

Verifying the web server is able to respond reasonably under various load conditions.

Performance testing

____ cookies expire at a set time.

Persistent

Affects query performance but not query results

Physical design

General-purpose scripting language created by Guido van Rossum in the 1990s that uses frameworks like Django, web2py, and Flask to create web applications.

Python

Which terms are commonly used in relational database processing?

Row, table, column

Web application framework written in Ruby and created by David Heinemeier Hansson in 2004.

Ruby on Rails

Eliminate dependencies on columns contained within a composite unique column.

Second normal form

A table with a simple primary key must be in what normal form? First normal form only, and no higher Second normal form or higher Third normal form

Second normal form or higher

Ensuring the integrity and privacy of the user's data and interactions with the web application.

Security testing

Choose whether the information to be stored should be placed in a cookie or a session variable. Price of an airplane ticket.

Session

RESTRICT, when the row containing Maria Rodriguez is deleted. The Sales and Marketing managers are set to NULL. The Sales and Marketing departments are deleted. The delete is rejected.

The delete is rejected

"Employee-Manages-Employee" is a correct relationship name. True False

True

$mysqli->affected_rows reports the number of rows inserted by an INSERT statement. True False

True

("10" <=> "010") == 0 (TF)

True

("bat" <=> "ball") > 0. TF

True

A dynamic web page might look different for two different users who are accessing the same page. tf

True

A relational database can be used to store documents, objects, graphs, and key-value pairs. True False

True

A small company may host the company's own website on the company's own web server. tf

True

A view query can reference another view table. True False

True

An entity instance can be in two subtypes of different partitions. True False

True

Both relational and non-relational databases have been implemented with open source software. True False

True

CSS preprocessors allow developers to write much less code compared to writing straight CSS. True False

True

Column databases are generally faster than relational databases for accessing vast amounts of data. True False

True

Data in a relational database can violate relational rules. True False

True

Developers use ASP.NET, Java, PHP, Python, Node.js, and Ruby on Rails to create web APIs. True False

True

Each partition attribute value corresponds to one subtype. True False

True

FederalRunwayCode is a good primary key. True False

True

For a third-party web API requiring an API key, the API key must be transmitted with every API request. True False

True

Information from a third-party web API will reach the browser faster if the browser calls the web API directly instead of the web server calling the web API. True False

True

JavaScript frameworks often simplify the use of web APIs in the browser. True False

True

Many PHP applications run on Linux with an Apache web server and MySQL as the database. True False

True

Many web APIs charge a fee to the developer after a limited number of requests have been made in a 24-hour period. True False

True

Maxima and minima usually depend on business rules. True False

True

Non-key columns always depend on the primary key. True False

True

Occasionally, tables are denormalized in a frequently updated database. True False

True

PHP is used by Facebook, Wikipedia, and WordPress. True False

True

SPAs generally result in less data being sent over the network than web applications developed with dynamically generated web pages. True False

True

Tables that allow redundancy might contain inconsistent versions of the same fact. True False

True

The code below outputs "Dolly". TF $person1 = new Person; $person1->name = "Dolly"; $person2 = $person1; $person1 = NULL; echo $person2->name;

True

The mysql tool attempts to connect to MySQL server running on the same machine as the tool. True False

True

The performance of a user query on a view is identical to the performance of the corresponding merged query on base tables. True False

True

The regex /run/ matches the string "pruning". TF

True

Two different inputs may convert into the same hash digest. True False

True

Maximum cardinality of one.

UNIQUE

What is the result of FALSE OR NULL in Oracle? FALSE NULL UNKNOWN

UNKNOWN

What does a NULL in the Name column represent? Unknown Inapplicable Either unknown or inapplicable

Unknown

Testing the user's ability to properly use the web application for specific purposes.

Usability testing

Idenfication of entities, relationships, and attributes precedes documentation. Always Usually Never

Usually

Standard attribute types are determined after the ER diagram is drawn. Always Usually Never

Usually

Does password_hash() always generate a unique hash for the same input? Yes No

Yes

Illegally named? $2b_

Yes

Is the salt stored with the passwords in the database? Yes No

Yes

How many dependent entities can depend on one independent entity? Zero or one One or many Zero, one, or many

Zero, one, or many

What argument is missing that makes the prepared statement select songs with artists that start with "Black"? $sql = "SELECT * from songs WHERE artist LIKE :artist"; $stmt = $pdo->prepare($sql); $stmt->execute(____);

["artist" => "Black%"]

Match anything except a vowel (a, e, i, o, u). /[___]/

^aeiou

What does the code output? $test = "adios"; echo "$test test";

adios test

Referring to the above animation, what is output when cookie2.php is requested after the "age" cookie expires? age is 25 age cookie not found.

age cookie not found

The foreign key in the subtype table usually has the referential integrity action ________ on primary key delete.

cascade

In some diagrams, 'many' is depicted with ______ notation.

crows feet

The foreign key in a subtype table implements the ________ relationship between subtype and supertype entities.

dependency

Only PHP files may be included with the include statement. TF

false

The primary key of a subtype table is also a ________.

foreign key

preg_match("/z(\w+)/", "zing zany zone", $matches); echo $matches[1]; zing ing ing zany zone

ing

Entity Employee, attribute LanguageCode one-one one-many many-many

many-many

Person-Owns-Vehicle one-one one-many many-one many-many

many-many

Student-Takes-Course one-one one-many many-one many-many

many-many

Entity Passenger, attribute PassengerName one-one one-many many-one

many-one

Person-Has-MailingAddress one-one one-many many-one many-many

many-one

_______ columns contain no descriptive information and make good primary keys.

meaningless

Minimum cardinality of zero.

no keyword

Person-Has-Passport one-one one-many many-one many-many

one-many

Unexpired cookies are transmitted from the web browser to the web server in every HTTP ______.

request

Which statement terminates the script if util.php is not found in the current directory? include "./util.php"; require "util.php"; require "./util.php";

require "./util.php";

What function registers the myErrorHandler() function to be called when an error occurs? myErrorHandler(); set_error_handler(myErrorHandler); set_error_handler("myErrorHandler");

set_error_handler("myErrorHandler");

Enter the command to display all the tables in the music database.

show tables;

A ______ primary key is easy to specify in a WHERE clause.

simple

We track at most one contact telephone number for each student.TelephoneNumber is a(n) _______ attribute of Student.

singular

A _______ primary key reduces cascading updates in the database.

stable

The subtype table primary key is identical to the _______ table primary key.

supertype

Which verb is a relationship? taken track have

taken

Enter the command to select the music database.

use music;

Pass-by-_______ assigns a copy of an argument to the parameter.

value

preg_match("/(.+) (.+) (.+)/", "zing zany zone", $matches); echo $matches[2]; zany zone zing zany zone

zany

Person-Marries-Person zero-zero zero-one one-zero one-one

zero-zero

What is the value of $line the second time fgets() is called? "Zootopia (PG): 4:45" "Zootopia,PG,4:45\n" "Zootopia"

"Zootopia,PG,4:45\n"

What argument is missing? $sql = "SELECT * from songs WHERE artist LIKE :artist"; $stmt = $pdo->prepare($sql); $stmt = $pdo->bindValue(_____, "Black%"); $stmt->execute();

"artist"

Enter the value assigned to $x in each code segment. $quote = "I am Spartacus!"; $x = strpbrk($quote, "bcd");

"cus!"

Complete the code that creates a file called results.txt or empties the contents of results.txt. $results = fopen(_____);

"results.txt", "w"

Select the expression to complete the code below.$statement = $pdo->query("SELECT gpa FROM students"); foreach (_____ as $row) { echo "<p>$row[gpa]</p>"; } $statement $statement->fetch() $pdo

$statement

Complete the code to create a reference parameter called $s function insertDashes(____) { for ($i = 0; $i < strlen($s); $i++) { if ($s[$i] == " ") { $s[$i] = "-"; } } } $words = "Pass by reference"; dashes($words); echo $words; // Pass-by-reference

&$s

What file extension does a PHP script have?

.php

What regex matches the string "that's easy"? /b?eas$/ /b?sy$/ /e+sy$/

/b?sy$/

What regex matches the string "boom"? /ba?oom/ /b\?oom/ /bo?m/

/ba?oom/

What regex matches the string "breaeak"? /bre+a+k/ /br(ea)+k/ /er|bk/

/br(ea)+k/

"3" - "2too" + "sixty6" = ?

1

In PHP, an empty string is treated like a 0 when used as a number. Assuming no student has an ID of 0, what is output if the user submits the form without typing an ID, name, and GPA? 1: was successfully inserted. 2: Couldn't insert because ID 0 already exists. 3: An exception error message.

1

Which line of code sets the "title" property? 1: $classicBook->title = 'Pride and Prejudice'; 2: $classicBook->$title = 'Pride and Prejudice';

1

What is the report level of E_USER_NOTICE

1024

Error number for SQL parsing error (bad syntax)

1064

What value does $mysqli->errno contain if query() returns FALSE because the SELECT statement is syntactically incorrect? 1054 1064 1336

1064

The INSERT statement adds a student to the student table. How many clauses are in the INSERT statement? INSERT INTO student VALUES (888, 'Smith', 'Jim', 3.0);

2

What is $numMatches? $numMatches = preg_match_all("/@\w+/", $tweet, $matches);

2

What is the report level of E_WARNING?

2

What is the report level of E_USER_ERROR?

256

What is missing to change the static theme property?static function changeTheme($theme) { ________ = $theme; } 1: $this->theme 2: self::theme 3: self::$theme

3

Which expression evaluates to true if the user does not check any checkboxes?if (_______) { echo "No titles selected"; } 1: count($_POST["books"]) == 0 2: !isset($_POST["books[]"]) 3: !isset($_POST["books"])

3

"4e3" + 1 = ?

4001

What is the report level of E_USER_WARNING

512

What is the report level of E_NOTICE?

8

What output is produced by the PHP script? <h1>This is a test</h1> echo "This is only a test";

<h1>This is a test</h1> echo "This is only a test";

What is output to the browser? preg_match_all("/@\w+/", $tweet, $matches); echo $matches[0][1];

@jan4prez

Runtime environment that uses modules written in JavaScript. Originally created in 2009 by Ryan Dahl.

Node.js

Third normal form allows fewer types of redundancy than second normal form. True False

True

A VPS generally runs slower than a dedicated host. tf

True

The web server sends a cookie's key/value to the web browser. True False

True

What string does NOT match the regex /grea*t/? gret greaaat grat

grat

Combines two tables without comparing columns.

Cross-join


Set pelajaran terkait

Chapter 30: Introduction to the Hematopoietic and Lymphatic Systems

View Set

Science 1001 self test 4 study guide

View Set

First 20 Elements and atomic number

View Set

Chapter 9 Smartbook Questions Accounting

View Set

The Internet: Chapter 2 Computers and Info Tech

View Set

NUR 356 Exam 4 Practice Questions

View Set

Chapter 56: Neurological Medications

View Set

Mercantilism- Navigation Act- Molasses Act- Sugar Act

View Set

kinesiology: head, neck and face

View Set

The Real World, Chapter 9: Constructing Gender and Sexuality

View Set

AP CALCULUS: units 1 -4 + review sheet

View Set

Quiz 3 - Variables and Data Types

View Set