Database Fundamentals: SQL, Data Types, and Table Structures

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

1/48

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 5:42 AM on 5/6/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

49 Terms

1
New cards

What is data?

Raw facts that describe real-world objects, events, or activities

2
New cards

What is a database?

An organized collection of structured data

3
New cards

What is a DBMS?

Software that manages storing, retrieving, securing, and maintaining data

4
New cards

What are 3 responsibilities of a DBMS?

Security, consistency, availability

5
New cards

What is NOT a responsibility of a DBMS?

Creating user interfaces

6
New cards

What is a table?

A collection of rows and columns

7
New cards

What is a row (tuple)?

An ordered collection of values representing one record

8
New cards

What is a column?

A named attribute with a data type

9
New cards

What is a set?

An unordered collection of elements

10
New cards

What does SQL stand for?

Structured Query Language

11
New cards

What does SELECT do?

Chooses columns

12
New cards

What does FROM do?

Specifies the table

13
New cards

What does WHERE do?

Filters rows

14
New cards

What is DDL?

Data Definition Language (CREATE, ALTER, DROP)

15
New cards

What is DML?

Data Manipulation Language (INSERT, UPDATE, DELETE)

16
New cards

What is DQL?

Data Query Language (SELECT)

17
New cards

Which SQL type retrieves data?

DQL

18
New cards

What is INT used for?

Whole numbers

19
New cards

What is TINYINT?

Small integer values

20
New cards

What does UNSIGNED mean?

No negative values allowed

21
New cards

What is VARCHAR?

Variable-length string

22
New cards

What is CHAR?

Fixed-length string

23
New cards

What is ENUM?

A data type with predefined allowed values

24
New cards

What is a primary key?

A column that uniquely identifies each row

25
New cards

Can a primary key be NULL?

No

26
New cards

Can a primary key repeat?

No

27
New cards

Why is a primary key important?

Ensures uniqueness and allows rows to be identified

28
New cards

How do you create a database?

CREATE DATABASE DatabaseName;

29
New cards

How do you view all databases?

SHOW DATABASES;

30
New cards

How do you select a database?

USE DatabaseName;

31
New cards

What is the correct SQL structure?

SELECT columns FROM table WHERE conditions;

32
New cards

Where do conditions go?

WHERE clause

33
New cards

Can conditions go in SELECT?

No

34
New cards

Correct INSERT syntax

INSERT INTO Students (StudentID, Fullname, GradeLevel, Age, CreditScore, Sex) VALUES (21, 'John Davis', 'FR', 19, 710, 'Male');

35
New cards

What does SELECT (relational) do?

Retrieves rows

36
New cards

What does PROJECT do?

Retrieves columns

37
New cards

What does JOIN do?

Combines tables (columns)

38
New cards

What does UNION do?

Combines rows

39
New cards

What is NULL?

A value representing unknown or missing data

40
New cards

What does `= NULL` return?

Nothing (invalid comparison)

41
New cards

How do you correctly check NULL?

IS NULL, IS NOT NULL

42
New cards

What happens if a WHERE condition evaluates to NULL?

Row is NOT returned

43
New cards

What does OR do?

Returns row if ANY condition is TRUE

44
New cards

What does AND do?

Returns row only if ALL conditions are TRUE

45
New cards

What's wrong with this SQL? SELECT Name AND Age FROM Students;

Use comma, not AND

46
New cards

What's wrong with this SQL? WHERE Age = NULL

Must use IS NULL

47
New cards

What's wrong with this SQL? WHERE Age >= 20 AND Sex

Missing comparison (Sex = 'Male')

48
New cards

Write a query: students age ≥ 20

SELECT * FROM Students WHERE Age >= 20;

49
New cards

Write a query: female students with CreditScore > 700

SELECT Fullname, GradeLevel FROM Students WHERE Sex = 'Female' AND CreditScore > 700;