1/137
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
In PHP, which tags are used to embed PHP code within an HTML document?
<?php ?>
In web development, is PHP considered to be a server-side scripting language or a client-side scripting language?
Server-side
Which command is used to merge one branch into another?
git merge
In HTML, which type of button element is used to submit a form when clicked?
submit
In JavaScript, which tags are used to embed JavaScript code within an HTML document?
<script></script>
Which selector targets elements with a 'data-info' attribute?
[data-info]
Which selector targets <p>
elements that are the only child of their parent?
p:only-child
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
Which SQL statement is used to sort the result-set in ascending or descending order?
ORDER BY
Which function is used to create a password hash in PHP?
password_hash()
Which command is used to clone a repository from GitHub to your local machine?
git clone
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
Which command is used to update the local version of a repository from a remote repository?
git pull
Which command is used to initialize a new Git repository?
git init
Which function displays a dialog box with a specified message and an OK button?
alert()
Which SQL statement is used to extract data from a database?
SELECT
How do you create an associative array in PHP?
array(‘key’ => ‘value’);
array[key] = value;
Which command shows the current state of the working directory and staging area?
git status
In PHP, which operator would you use to check to match both the value and the type?
=== (identical)
Which selector selects all <p> elements?
p
How do you declare an indexed array with the elements 'apple', 'banana', and 'cherry' in PHP?
$fruits = ['apple', 'banana', 'cherry'];
Which function writes a message to the console?
console.log()
In web development, is JavaScript considered to be a server-side scripting language or a client-side scripting language?
Client-side
In JavaScript, which of the following variable declarations allows variables to have block-level scope and cannot be reassigned in the same scope?
const
Which PHP functions are used to output text or HTML content to the web browser?
echo
Which commands are used to switch to another branch in your Git repository?
git checkout
git switch
Which SQL statement is used to add data into a database?
INSERT TO
Which command adds changes in the working directory to the staging area?
git add
Which of the following is the correct way to declare a variable in PHP?
$variable = ‘value’;
Which SQL statement is used to return only unique (different) values?
DISTINCT
Which function displays a dialog box that asks the visitor for an input string?
prompt()
Which function is used to verify a password against a hash in PHP?
password_verify()
Which selector targets only direct <p>
children of <div>
elements?
div > p
Which SQL statement is used to create a new table in a database?
CREATE TABLE
Which command is used to create a new branch in your Git repository?
git branch new_branch
Which selector targets only the first child of a <ul>
element?
ul :first-child
In HTML, what is the default HTTP method used when submitting a form?
GET
What is the correct way to define a function in PHP?
function function_name() {}
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
Which function displays a dialog box with a specified message, along with an OK and a Cancel button?
confirm()
Which SQL statement is used to modify data in a database?
UPDATE
Which command is used to upload local repository content to a remote repository?
git push
In PHP, which operator checks for matching equality of value, but not type?
== (equal)
To perform client-side form validation in web development, which programming language is commonly used?
Javascript
Which command saves changes to the local repository?
git commit
Which SQL statement is used to remove data from a database?
DELETE
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
Tells git to track changes
git add
Persists/confirms current changes
git commit
Syncs changes from Local to Remote
git push
Syncs changes from Remote to Local
git pull
Shows the status of the working directory and tracked files.
git status
True or False: A commit must always have a message (even if it's blank/empty string)
true
What are the ways you can create a branch from the command line?
Select all that apply.
git branch BranchName
git checkout -b BranchName
True or False: We must manually sync our changes among our local repository and the remote repository
true
$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
$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
$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
$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
Match the language with their tags
PHP
THe thing with a ?
Match the language with their tags
javascript
<script></script>
PHP (Server side or client side)
Server side
JavaScript (Server side or client side)
Client side
function scope (less strict)
var
block scope (more restrictive)
let
block scope (also can’t be changed once set)
const
Design/looks
CSS
Layout/structure
HTML
Client-Side Functionality
JavaScript
Server-Side Functionality
PHP
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
True or False: JavaScript and CSS use the same selectors (for the most part)
True
True or False: In JavaScript, using the window keyword is optional for things like window.alert(), window.addEventListener(), window.prompt(), etc.
True
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
Select each language that'll properly run on a page that has a .html extension.
JavaScript
PHP
HTML
CSS
JavaScript, HTML, CSS
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
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
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
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 | |
1 | NULL |
2 | NULL |
3 | |
4 | NULL |
True
True or False: A foreign key must refer to a primary key or a unique key in the referenced table
True
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
True or False: A database and a table are the same thing.
False
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
Retrieves data from a table
SELECT
Adds data to a table
INSERT
Changes existing data in a table
UPDATE
Removes specific data from a table
DELETE with a condition
Filters results from a table
WHERE
Makes a table if it doesn’t exist
CREATE TABLE
Changes the structure of an existing table
ALTER TABLE
Deletes all data in a table but keeps the structure
TRUNCATE
Deletes the entire table
DROP TABLE
Prints (outputs) the working directory path to the console
pwd
Changes directory
cd
list
ls
Moving or renaming file
mv
Create a copy of the file
cp
Deletes a file
rm
Elevates the current user to have superuser/root permissions
sudo
outputs data with its respective data types
var_dump()