IT 202

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/137

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

138 Terms

1
New cards

In PHP, which tags are used to embed PHP code within an HTML document?

<?php ?>

2
New cards

In web development, is PHP considered to be a server-side scripting language or a client-side scripting language?

Server-side

3
New cards

Which command is used to merge one branch into another?

git merge

4
New cards

In HTML, which type of button element is used to submit a form when clicked?

submit

5
New cards

In JavaScript, which tags are used to embed JavaScript code within an HTML document?

<script></script>

6
New cards

Which selector targets elements with a 'data-info' attribute?

[data-info]

7
New cards

Which selector targets <p> elements that are the only child of their parent?

p:only-child

8
New cards

1 <?php

2 $a = 0;

3 $b = 1.0;

4 for ($i = 0; $i < 10; $i++) {

5 $a += 0.1;

6 }

7 echo (($a === $b) ? "yes" : "no");

No

9
New cards

Which SQL statement is used to sort the result-set in ascending or descending order?

ORDER BY

10
New cards

Which function is used to create a password hash in PHP?

password_hash()

11
New cards

Which command is used to clone a repository from GitHub to your local machine?

git clone

12
New cards

In JavaScript, which of the following variable declarations allows variables to have function-level scope and can be reassigned with new values in the same function?

var

13
New cards

Which command is used to update the local version of a repository from a remote repository?

git pull

14
New cards

Which command is used to initialize a new Git repository?

git init

15
New cards

Which function displays a dialog box with a specified message and an OK button?

alert()

16
New cards

Which SQL statement is used to extract data from a database?

SELECT

17
New cards

How do you create an associative array in PHP?

array(‘key’ => ‘value’);

array[key] = value;

18
New cards

Which command shows the current state of the working directory and staging area?

git status

19
New cards

In PHP, which operator would you use to check to match both the value and the type?

=== (identical)

20
New cards

Which selector selects all <p> elements?

p

21
New cards

How do you declare an indexed array with the elements 'apple', 'banana', and 'cherry' in PHP?

$fruits = ['apple', 'banana', 'cherry'];

22
New cards

Which function writes a message to the console?

console.log()

23
New cards

In web development, is JavaScript considered to be a server-side scripting language or a client-side scripting language?

Client-side

24
New cards

In JavaScript, which of the following variable declarations allows variables to have block-level scope and cannot be reassigned in the same scope?

const

25
New cards

Which PHP functions are used to output text or HTML content to the web browser?

print

echo

26
New cards

Which commands are used to switch to another branch in your Git repository?

git checkout

git switch

27
New cards

Which SQL statement is used to add data into a database?

INSERT TO

28
New cards

Which command adds changes in the working directory to the staging area?

git add

29
New cards

Which of the following is the correct way to declare a variable in PHP?

$variable = ‘value’;

30
New cards

Which SQL statement is used to return only unique (different) values?

DISTINCT

31
New cards

Which function displays a dialog box that asks the visitor for an input string?

prompt()

32
New cards

Which function is used to verify a password against a hash in PHP?

password_verify()

33
New cards

Which selector targets only direct <p> children of <div> elements?

div > p

34
New cards

Which SQL statement is used to create a new table in a database?

CREATE TABLE

35
New cards

Which command is used to create a new branch in your Git repository?

git branch new_branch

36
New cards

Which selector targets only the first child of a <ul> element?

ul :first-child

37
New cards

In HTML, what is the default HTTP method used when submitting a form?

GET

38
New cards

What is the correct way to define a function in PHP?

function function_name() {}

39
New cards

In JavaScript, which of the following variable declarations allows variables to have block-level scope and can be reassigned with new values in the same scope?

let

40
New cards

Which function displays a dialog box with a specified message, along with an OK and a Cancel button?

confirm()

41
New cards

Which SQL statement is used to modify data in a database?

UPDATE

42
New cards

Which command is used to upload local repository content to a remote repository?

git push

43
New cards

In PHP, which operator checks for matching equality of value, but not type?

== (equal)

44
New cards

To perform client-side form validation in web development, which programming language is commonly used?

Javascript

45
New cards

Which command saves changes to the local repository?

git commit

46
New cards

Which SQL statement is used to remove data from a database?

DELETE

47
New cards

1 <?php

2 $a = 1;

3 $b = 0;

4 while($i < 10){

5 $a -= 0.1;

6 $i++;

7 }

8 $x = ($a == $b);

9 ?>

false

48
New cards

Tells git to track changes

git add

49
New cards

Persists/confirms current changes

git commit

50
New cards

Syncs changes from Local to Remote

git push

51
New cards

Syncs changes from Remote to Local

git pull

52
New cards

Shows the status of the working directory and tracked files.

git status

53
New cards

True or False: A commit must always have a message (even if it's blank/empty string)

true

54
New cards

What are the ways you can create a branch from the command line?

Select all that apply.

git branch BranchName

git checkout -b BranchName

55
New cards

True or False: We must manually sync our changes among our local repository and the remote repository

true

56
New cards
$a = 0;
$b = 1.0;
for ($i = 0; $i < 10; $i++) {
$a += 0.1;
}
echo (($a === $b) ? "yes" : "no");

How many times does this loop iterate?

10

57
New cards
$a = 0;
$b = 1.0;
for ($i = 0; $i < 10; $i++) {
$a += 0.1;
}
echo (($a === $b) ? "yes" : "no");

What is the expected output?

no

58
New cards
$a = 0;
$b = 1.0;
for ($i = 0; $i < 10; $i++) {
$a += 0.1;
}
echo ((round($a) === $b) ? "yes" : "no");

How many times does this loop iterate?

10

59
New cards
$a = 0;
$b = 1.0;
for ($i = 0; $i < 10; $i++) {
$a += 0.1;
}
echo ((round($a) === $b) ? "yes" : "no");

What is the expected output?

yes

60
New cards

Match the language with their tags

PHP

THe thing with a ?

61
New cards

Match the language with their tags
javascript

<script></script>

62
New cards

PHP (Server side or client side)

Server side

63
New cards

JavaScript (Server side or client side)

Client side

64
New cards

function scope (less strict)

var

65
New cards

block scope (more restrictive)

let

66
New cards

block scope (also can’t be changed once set)

const

67
New cards

Design/looks

CSS

68
New cards

Layout/structure

HTML

69
New cards

Client-Side Functionality

JavaScript

70
New cards

Server-Side Functionality

PHP

71
New cards

Select the correct statement about HTML elements.

 

All HTML elements must have a closing tag

All HTML elements, except for empty HTML elements, must have a closing tag

HTML Runs on the Server 

HTML elements do not need a closing tag

 All HTML elements, except for empty HTML elements, must have a closing tag

72
New cards

True or False: JavaScript and CSS use the same selectors (for the most part)

True

73
New cards

True or False: In JavaScript, using the window keyword is optional for things like window.alert(), window.addEventListener(), window.prompt(), etc.

True

74
New cards

When a <form> is submitted, what are all the options that'd make an input eligible to send data for that submission?

Select all that apply.

 

a) Input element must be only type of "text"

b) Input element must have a name attribute

c) Input element must have a form attribute if not a child of the form

d) Input element must be a child of the form (if another specific condition isn't met)

e) If provided, the form attribute onsubmit must receive/return true

b c d e

75
New cards

Select each language that'll properly run on a page that has a .html extension.


JavaScript

PHP

HTML

CSS

JavaScript, HTML, CSS

76
New cards

What does a unique constraint do?

Ensures the table is unique

Ensures every row is completely unique

Ensures the column contains only unique values

Ensures the column contains only unique values

77
New cards

What does a foreign key constraint do?

Auto increments the column

Ensures the column supports foreign character sets

Translates the data into another language

Ensures the record referenced from table A exists in table B

Ensures the record referenced from table A exists in table B

78
New cards

True or False: The following scenario is the correct way to update the structure of a table assuming the table already exists:

  • Edit the CREATE TABLE query/file

  • Rerun the CREATE TABLE query

False

79
New cards

True or False: MySQL allows multiple NULL values in a column constrained by a unique constraint.

Example: email column is unique on the Users table, will it allow more than one record to have a NULL value in this column?

id

email

1

NULL

2

NULL

3

test@test.com

4

NULL

True

80
New cards

True or False: A foreign key must refer to a primary key or a unique key in the referenced table

True

81
New cards

What does a JOIN do?

 

It's a button to become part of some group

Connects two databases together

Permanently merges multiple tables into one

Combines rows from two or more tables, based on a related column between them

Combines rows from two or more tables, based on a related column between them

82
New cards

True or False: A database and a table are the same thing.

False

83
New cards

What does the following query do?

SELECT id, email, password from Users WHERE email = :email OR username = :email

 

1. Returns records whose email or username columns equal the passed in value

2. Returns records whose email and username columns contain the passed in value
3. Verifies a password

4. Returns records where email or username columns include/contain the passed in value (partial match)

1

84
New cards

Retrieves data from a table

SELECT

85
New cards

Adds data to a table

INSERT

86
New cards

Changes existing data in a table

UPDATE

87
New cards

Removes specific data from a table

DELETE with a condition

88
New cards

Filters results from a table

WHERE

89
New cards

Makes a table if it doesn’t exist

CREATE TABLE

90
New cards

Changes the structure of an existing table

ALTER TABLE

91
New cards

Deletes all data in a table but keeps the structure

TRUNCATE

92
New cards

Deletes the entire table

DROP TABLE

93
New cards

Prints (outputs) the working directory path to the console

pwd

94
New cards

Changes directory

cd

95
New cards

list

ls

96
New cards

Moving or renaming file

mv

97
New cards

Create a copy of the file

cp

98
New cards

Deletes a file

rm

99
New cards

Elevates the current user to have superuser/root permissions

sudo

100
New cards

outputs data with its respective data types

var_dump()