DBA QUIZ 1

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

1/106

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 7:42 PM on 10/14/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

107 Terms

1
New cards

STRUCTURED QUERY LANGUAGE

  • It is an industry-standard programming language used to insert, retrieve, modify, and delete data in a relational database.

  • It also contains statements for defining and administering the objects in a database.


2
New cards

INSERT, UPDATE, RETRIEVE, CREATE, DELETE RECORDS

ACTIONS A DB ADMIN CAN DO USING SQL

3
New cards

RELATIONAL DATABASE

  • is a database divided into logical units called tables, where tables are related to one another within the database.

  • allows data to be broken down into logical, smaller, and manageable units for easier maintenance and better performance.


4
New cards

TABLES

  • are collections of rows and columns, and are related to one another through common keys or fields in a relational database system


5
New cards

FIELD

  • is a single characteristic, attribute or property that provides information about an object


6
New cards

RECORD

  • is a complete set of all the fields/attributes combined together for a particular object


7
New cards

DATA DEFINITION, DATA MANIPULATION, DATA CONTROL

THREE CATEGORIES OF SQL

8
New cards

DATA DEFINITION LANGUAGE

  • Commands used to define a database, including those for creating, altering, and dropping tables and establishing constraints.

  • Sample of commands are CREATE, ALTER and DROP


9
New cards

DATA MANIPULATION LANGUAGE

  • Commands are used for updating, inserting, modifying, and querying the data in the database

  • Sample of commands are INSERT, UPDATE, DELETE and SELECT


10
New cards

DATA CONTROL LANGUAGE

  • Commands that help a DBA control the database

  • they include commands to grant or revoke privileges to access the database or particular objects within the database and to store or remove transactions that would affect the database.


11
New cards

CREATE DATABASE

  • SQL COMMAND FOR CREATING A DATABASE


12
New cards

USE

  • SQL COMMAND USED FOR SELECTING THE DATABASE TO USE.


13
New cards

SP_RENAME ‘OLD_NAME‘, ‘NEW_NAME‘

  • SQL STATEMENT USED TO RENAME A DATABASE


14
New cards

DROP DATABASE

  • SQL COMMAND USED TO DELETE A DATABASE


15
New cards

TABLES

  • ARE DATABASE OBJECTS THAT STORES DATA IN A COLLECTION OF ROWS AND COLUMNS

  • CAN HAVE UP TO 1042 COLUMNS


16
New cards

TABLE NAMES

  • MUST START WITH ALPHABETIC CHARACTER AND CAN CONTAIN UNDERSCORES, @ SYMBOLS, # POUND SYMBOLS, AND NUMERALS.

  • CAN HAVE UP TO 128 CHARACTERS

  • CAN BE DELIMITED BY SPACES AND OTHER SYMBOLS


17
New cards

DATA TYPES

  • IS AN ATTRIBUTE THAT SPECIFIES THE TYPE OF DATA THAT THE COLUMN CAN STORE

  • IT CAN ALSO DECIDE THE OPERATIONS THAT CAN BE PERFORMED ON THE DATA OF THAT ATTRIBUTE.


18
New cards

EXACT NUMERIC DATA TYPES

  • STORES EXACT NUMBERS SUCH AS INTERGERS, DECIMAL, OR MONETARY AMOUNT.


19
New cards

BIT

  • STORES THREE VALUES: 0, 1, AND NULL

  • HAS A RANGE OF 0-225 AND CONSUMES 1 BYTE OF STORAGE


20
New cards

SMALLINT

  • STORES VALUES FROM -32,768 TO 32,768

  • CONSUMES 2 BYTES OF STORAGE


21
New cards

INT

  • STORES VALUES 2 ^ 31 TO 2 ^ 31 -1

  • CONSUMES 4 BYTES OF STORAGE


22
New cards

BIGINT

  • STORES VALUES FROM -2 ^ 63 TO 2 ^ 63-1

  • CONSUMES 8 BYTES OF STORAGE


23
New cards

INT, BIGINT, SMALLINT, TINYINT

DATA TYPES THAT STORES INTEGER DATA

24
New cards

MONEY AND SMALLMONEY

STORES CURRENCY VALUES

25
New cards

APPROXIMATE NUMERIC DATA TYPES

  • STORES FLOATING POINT NUMERIC DATA

  • OFTEN USED IN SCIENTIFIC CALCULATIONS


26
New cards

DATE AND TIME DATA TYPES

  • USED TO STORE DATE AND TIME DATA, AND THE DATE TIME OFFSET


27
New cards

DATETIME, SMALLDATETIME, DATE, TIME

EXAMPLE OF DATE AND TIME DATA TYPES

28
New cards

CHARACTER STRING DATA TYPES

  • CONSISTS OF ANY COMBINATION OF LETTERS, SYMBOLS, AND NUMERIC CHARACTERS

  • ALLOWS USERS TO STORE FIXED LENGTH OR VARIABLE-LENGHT DATA


29
New cards

UNICODE CHARACTER STRING DATA TYPES

  • STORES EITHER FIXED LENGTH OR VARIABLE-LENGTH UNICODE CHARACTER DATA


30
New cards

BINARY STRING DATA TYPES

  • STORES FIXED AND VARIABLE LENGTH BINARY DATA


31
New cards

NULL

  • A VALUE THAT MAY BE ASSIGNED TO AN ATTRIBUTE WHEN NO OTHER VALUE APPLIES OR WHEN THE APPLICABLE VALUE IS UNKNOWN

  • MEANS THAT NO ENTRY HAS BEEN MADE


32
New cards

PRIMARY KEY

  • IS A FIELD OR A COMBINATION OF FIELDS THAT IDENTIFY A RECORD UNIQUELY

  • IT IS A COLUMN OF A SET OF COLUMN THAT ARE UNIQUE


33
New cards

ONE PRIMARY KEY PER TABLE, MUST BE UNIQUE AND UNIQUELY IDENTIFIES EACH ROW, CANNOT BE NULL

RULES FOR PRIMARY KEYS

34
New cards

FOREIGN KEYS

  • PROVIDES A WAY OF ENFORCING REFERENTIAL INTEGRITY WITHIN MYSQL SERVER.

  • ENSURES THAT VALUES IN ONE TABLE MUST BE PRESENT IN ANOTHER TABLE

  • GOVERNS THE LINK BETWEEN THE PARENT AND THE CHILD TABLE


35
New cards

PARENT TABLE

  • TABLE BEING REFERENCED BY THE FOREIGN KEY


36
New cards

CHILD TABLE

  • THE TABLE WITH THE FOREIGN KEY


37
New cards

REFERENTIAL INTEGRITY

  • THE RULE PARENT-CHILD RELATIONSHIP ENFORCES

  • A STATE IN WHICH ALL FOREIGN KEY VALUES IN THE DATABASE ARE VALID.


38
New cards

DEFAULT

  • AN OPTIONAL VALUE TO A COLUMN

  • THEY ARE USED TO PUT ANY VALUE FOR THE COLUMN FOR ANY ROW THAT IS INSERTED TO, WITHOUT EXPLICITLY SUPPLYING THE VALUE FOR THAT PARTICULAR COLUMN


39
New cards

IDENTITY COLUMN

  • USED TO CREATE A COLUMN THAT CONTAINS SYSTEM-GENERATED SEQUENTIAL VALUES TO IDENTIFY EACH ROW INSERTED INTO A TABLE


40
New cards

IDENTITY SEED

  • PROVIDES THE STARTING VALUE OF THE SEED


41
New cards

IDENTITY INCREMENT

  • DEFINES HOW AN IDENTITY WILL INCREASE OR DECREASE WITH EACH NEW ROW ADDED TO A TABLE


42
New cards

DATA INTEGRITY

  • REFERS TO THE OVERALL ACCURACY, CONSISTENCY, AND COMPLETENESS OF DATA.

  • USUALLY IMPOSED DURING THE DATABASE DESIGN PHASE THROUGH THE USE OF STANDARD PROCEDURES AND RULES

  • CAN BE MAINTAINED THROUGH THE USE OF VARIOUS ERROR-CHECKING METHODS AND VALIDATION PROCEDURES


43
New cards

DOMAIN, ENTITY, REFERENTIAL

CATEGORIES OF DATA INTEGRITY

44
New cards

DOMAIN INTEGRITY

  • THIS INTEGRITY SPECIFIES A SET OF DATA VALUES THAT ARE VALID FOR A COLUMN

  • CAN BE DEFINED BY DATA TYPE, FORMAT, DATA LENGTH, NULLABILITY, DEFAULT VALUE, AND RANGE OF ALLOWABLE VALUES

  • ALSO KNOWN AS COLUMN INTEGRITY


45
New cards

ENTITY INTEGRITY

  • THIS INTEGRITY REQUIRES ALL THE ROWS IN A TABLE TO HAVE A UNIQUE IDENTIFIER

  • ENFORCED BY EITHER PRIMARY KEY OR UNIQUE CONSTRAINT

  • ALSO KNOWN AS ROW INTEGRITY


46
New cards

CONSTRAINTS

  • ARE BUSINESS LOGIC THAT THE DATABASE SERVER ENFORCES

  • ARE USED TO SPECIFY RULES FOR THE DATA IN THE TABLE.

  • ARE USED TO LIMIT THE DATA THAT GOES INTO THE TABLE TO ENSURE ACCURACY AND RELIABILITY OF THE DATA IN THE TABLE

  • THEY PREVENT DELETION OF TABLES IF THERE ARE DEPENDENCIES


47
New cards

UNIQUE CONSTRAINTS

  • ENSURES THAT THERE ARE NO DUPLICATE VALUES ENTERED INTO SPECIFID COLUMNS THAT ARE NOT A TABLE’S PRIMARY KEY


48
New cards

DEFAULT CONSTRAINTS

  • ENABLES USERS TO DEFINES THE VALUE THAT WILL BE SUPPLIED FOR A COLUMN WHENEVER A USER FAILS TO ENTER A VALUE


49
New cards

CHECK CONSTRAINTS

  • IS USED TO ENFORCE DOMAIN INTEGRITY BY RESTRICTING VALUES ALLOWED IN A COLUMN TO SPECIFIC VALUES

  • IT CONTAINS A BOOLEAN EXPRESSION THAT CAUSES A DATABASE TO EVALUATE WHETHER THE VALUE OF AN INSERTED OR UPDATED RECORD MATCHES THE CRITERIA


50
New cards

DROP CONSTRAINT

  • COMMAND USED TO DELETE A CONSTRAINT


51
New cards

SP_HELPCONSTRAINT

  • COMMAND USED TO LIST AVAILABLE CONSTRAINTS IN A TABLE


52
New cards

SELECT

  • RETRIVES INFORMATION FROM THE DATABASE


53
New cards

Selection

  • the capability used to choose rows in a table that you wanted returned by a query


54
New cards

Projection

  • the capability to choose the columns in a table that you want returned by your query


55
New cards

Join

  • the capability to bring together the data that you stored in different tables by creating a link through a column that both tables share


56
New cards

Select Clause

  • Specifies the columns to be displayed


57
New cards

From clause

  • specifies the table containing the columns listed in the select clause


58
New cards

Keyword

  • Refers to an individual SQL element

  • ex: SELECT and FROM


59
New cards

Clause

  • Is a part of an SQL statement

  • ex: SELECT empmo,ename…


60
New cards

Statement

  • Is a combination of two or more clauses

  • ex: Select * From emp


61
New cards

“*“

  • Used to display all columns of data in a table


62
New cards

Column Alias

  • Renames a column heading

  • Useful with calculations


63
New cards

AS

  • Used to give column aliases


64
New cards

+

  • Concatenation operator


65
New cards

Literal

  • Is a character, expression, or number included in the SELECT list


66
New cards

DISTINCT

  • Used to eliminate duplicate rows in the result

  • Provides uniqueness across set of selected columns


67
New cards

WHERE clause

  • Add restriction to the query and displays rows that meet the condtions


68
New cards

condition

  • Is composed of column names, expressions, constants, and a comparison operator


69
New cards

BETWEEN

  • An operator used to display rows based on a range of values


70
New cards

IN

  • An operator used to test for values in a list


71
New cards

Like

  • Used to select rows that match a character pattern


72
New cards

NULL operator

  • Used to test for values that are null


73
New cards

Logical Operator

  • Combines the result of two component conditions to produce a single result based on them or to invert the result of a single condition


74
New cards

AND

  • Requires both conditions to be true


75
New cards

OR

  • Requires either condition to be true


76
New cards

NOT

  • Displays a record if the conditions is not true


77
New cards

Parentheses

  • used to force priority in the rules of precedence


78
New cards

Order By

  • used to sort rows

  • specifies the order in which retrieved rows are displayed


79
New cards

ASC

  • Default sorting order

  • Sorts the result from lowest to highest or in dates, earliest to oldest


80
New cards

DESC

  • Sorts the result from highest to lowest


81
New cards

Function

  • Is a programming unit returning a single value, allowing values to be passed in as parameters


82
New cards

Single-row Functions

  • These can be used to execute an operation on each row of a query.

  • Can be used to execute the same operation for every row a query retrieves


83
New cards

Multiple-row Functions

  • These functions manipulate groups of rows to give one result per group of rows


84
New cards

String Functions

  • Used to perform operations on input string and return an output string


85
New cards

UPPER

  • Converts string to upper-case


86
New cards

LOWER

  • Converts string to lower-case


87
New cards

LEN

  • Returns the number of characters of the specified string expression


88
New cards

LEFT

  • Returns the part of a string starting at a specified number of characters from the left.


89
New cards

Right

  • Returns part of a character string starting at a specified number of characters from the right


90
New cards

LTRIM

  • Returns a character expression after removing the leading blanks on the left


91
New cards

RTRIM

  • Returns a character expression after removing the leading blanks on the right


92
New cards

REPLACE

  • Replaces all occurences of the the second given string expression in the first string expression with a third expression


93
New cards

REPLICATE

  • Repeats a character expression for a specified number of times


94
New cards

SUBSTRING

  • Returns part of a character, binary, text, or image expression based on the supplied length


95
New cards

CHARINDEX

  • Returns the starting position of a string specified in the parameter


96
New cards

Numeric Functions

  • These functions operates on values of number class datatype

  • They return and accept just numeric values


97
New cards

ABS

  • Returns the absolute value of the number


98
New cards

POWER

  • Returns the value of the given expression to the specified power


99
New cards

CEILING

  • Returns the smallest integer greater than, or equal to the given numeric expression


100
New cards

FLOOR

  • Returns the largest integer less than or equal to, the given numeric expression