SQL Databases - Veb Programiranje

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/58

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 3:50 PM on 6/10/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

59 Terms

1
New cards
SQL stands for
Structured Query Language
2
New cards
MySQL is
Open source relational database management system
3
New cards
Relational database consists of
Tables connected by relations
4
New cards
Primary key is
Field/set of fields that uniquely identifies each record in table
5
New cards
Foreign key is
"Field in secondary table for linking
6
New cards
Three relationship types
"One-to-one
7
New cards
SQL processing phases (4)
Parsing -> Optimization -> Row source generation -> Execution
8
New cards
DML statements (Data Manipulation Language)
"SELECT
9
New cards
DDL statements (Data Definition Language)
"CREATE
10
New cards
TCL statements (Transaction Control Language)
"COMMIT
11
New cards
DCL statements (Data Control Language)
"GRANT
12
New cards
SELECT returns
Data from tables based on criteria
13
New cards
Projection refers to
Selecting columns (done via SELECT)
14
New cards
Selection refers to
Selecting rows (done via WHERE clause)
15
New cards
WHERE clause
Filters rows based on condition
16
New cards
ORDER BY clause
Sorts results
17
New cards
GROUP BY clause
Groups results by one or more columns (used with aggregate functions)
18
New cards
HAVING clause
Filters results of aggregate functions (WHERE cannot filter aggregates)
19
New cards
Aggregate functions (5)
"COUNT()
20
New cards
COUNT() returns
Number of rows matching criteria
21
New cards
SUM() returns
Total of numeric column
22
New cards
AVG() returns
Average of numeric column
23
New cards
MIN() returns
Smallest value in column
24
New cards
MAX() returns
Largest value in column
25
New cards
LIKE operator uses wildcards
% (zero/more chars) and _ (exactly one char)
26
New cards
IN operator
Shortcut for multiple OR conditions in WHERE
27
New cards
BETWEEN operator
Values within defined inclusive range
28
New cards
EXISTS operator
Returns TRUE if subquery returns one or more rows
29
New cards
ANY operator
Returns TRUE if ANY subquery value satisfies condition
30
New cards
ALL operator
Returns TRUE if ALL subquery values satisfy condition
31
New cards
SQL comments single-line
-- (double dash)
32
New cards
SQL comments multi-line
/* */
33
New cards
INNER JOIN returns
Only rows with matching values in BOTH tables
34
New cards
LEFT OUTER JOIN returns
ALL rows from left table + matching from right
35
New cards
RIGHT OUTER JOIN returns
ALL rows from right table + matching from left
36
New cards
FULL OUTER JOIN returns
All rows where match exists in either table
37
New cards
WHERE vs INNER JOIN
"WHERE includes all matching rows
38
New cards
INNER JOIN is
ANSI standard syntax
39
New cards
UNION combines
Results of two or more SELECT statements
40
New cards
UNION ALL vs UNION
"UNION ALL shows duplicates
41
New cards
UNION requirements
"Same number of columns
42
New cards
SELECT INTO copies
Data from one table to NEW table (MySQL uses INSERT INTO SELECT)
43
New cards
INSERT INTO SELECT copies
Data from one table to EXISTING table
44
New cards
IFNULL() and COALESCE()
Return alternative value if column is NULL
45
New cards
mysqli_connect() creates
Connection to MySQL database
46
New cards
mysqli_connect_error() returns
Error description if connection fails
47
New cards
mysqli_query() executes
SQL query on database
48
New cards
mysqli_fetch_assoc() returns
Associative array of result row
49
New cards
mysqli_fetch_array() returns
Both numeric and associative array
50
New cards
mysqli_num_rows() returns
Number of rows in result set
51
New cards
mysqli_close()
Closes database connection
52
New cards
mysqli_connect parameters
"servername
53
New cards
mysqli_begin_transaction() starts
Database transaction
54
New cards
mysqli_commit()
Saves all changes in transaction
55
New cards
mysqli_rollback()
Undoes all changes in transaction
56
New cards
Prepared statements prevent
SQL injection attacks
57
New cards
mysqli_prepare() creates
Prepared statement template
58
New cards
mysqli_stmt_bind_param() binds
Variables to prepared statement parameters
59
New cards
mysqli_stmt_execute() executes
Prepared statement