SQL Database Concepts: Tables, Keys, and Queries for Data Retrieval

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/50

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.

51 Terms

1
New cards

Database

A structured collection of data

2
New cards

Table

A collection of related data entries. This data is held in rows and columns, like a spreadsheet.

3
New cards

Record

A row in a table - one complete set of data about a single item

4
New cards

Field

A column in a table - stores one type of data (e.g. name, ID)

5
New cards

Primary Key

A field (or combination of fields) that uniquely identifies each record in a table.

6
New cards

Foreign Key

A field (or combination of fields) in one table that links to the primary key in another table.

7
New cards

Composite Primary Key

A primary key formed by combining multiple field types when a single field cannot uniquely identify records.

8
New cards

SQL

A language used to search for, manage, and manipulate data in a relational database.

9
New cards

SELECT Command

Used for retrieving data from a database table.

10
New cards

UPDATE Command

Used to modify existing data in a database table.

11
New cards

INSERT Command

Used to add new data into a database table.

12
New cards

DELETE Command

Used to remove data from a database table.

13
New cards

ORDER BY Clause

An optional clause in SQL that specifies the order in which to return the results.

14
New cards

Condition in SQL

A statement that must be true for the SQL command to execute.

15
New cards

Attribute in SQL

A specific column in a table that is being queried.

16
New cards

Table: Flights

Contains data about flight numbers, pilot numbers, and destinations.

17
New cards

Table: Pilots

Contains data about pilot numbers and pilot names.

18
New cards

PilotNo

The primary key in the Pilots table.

19
New cards

FlightNo

The primary key in the Flights table.

20
New cards

Data Inconsistency

Occurs when data points are stored in more than one place, but with different values.

21
New cards

Data Redundancy

Occurs when data is unnecessarily duplicated in more than one place.

22
New cards

Linked Tables

Tables that are connected through shared attributes, such as primary and foreign keys.

23
New cards

Destination

The location where the flight is headed.

24
New cards

Wildcards

Special characters used in SQL commands to specify any possible value.

25
New cards

Table: Students

A database table containing information about students.

26
New cards

Table: Cars

A database table containing information about cars.

27
New cards

Attributes in SQL

The columns in a database table that define the data stored.

28
New cards

Values in SQL

The actual data entries corresponding to the attributes in a database table.

29
New cards

SQL keywords

Reserved words in SQL that have special meaning.

30
New cards

Database Record

A single entry in a database table.

31
New cards

Email

A field in the Students table that stores the email address of a student.

32
New cards

Year in Students Table

A field indicating the academic year of a student.

33
New cards

Model in Cars Table

A field indicating the model of the car.

34
New cards

Manufacturer in Cars Table

A field indicating the manufacturer of the car.

35
New cards

Price in Cars Table

A field indicating the price of the car.

36
New cards

Wildcard

A symbol used in SQL to return all attributes, usually notated with an asterisk.

37
New cards

Join criteria

A statement used to link two tables in a SQL query, typically by setting the foreign key of one table equal to the primary key of another.

38
New cards

Attribute specific to a table

Denoted as in SQL.

39
New cards

Example 1: Selecting a Field from One Table

SELECT Students.StudentNo FROM Students, Teachers WHERE Students.TeacherID = Teachers.TeacherID

40
New cards

Example 2: Selecting multiple Fields from Both Tables

SELECT Students.Name, Teachers.Name FROM Students, Teachers WHERE Students.TeacherID = Teachers.TeacherID

41
New cards

Example 3: Filtering With a Condition from Another Table

SELECT Students.Email FROM Students, Teachers WHERE Teachers.Class = '13D' AND Students.TeacherID = Teachers.TeacherID

42
New cards

Example 4: Ordering Results

SELECT Students.Name, Students.StudentNo FROM Students, Teachers WHERE Teachers.Name = 'Mr. Davies' AND Teachers.TeacherID = Students.TeacherID ORDER BY Students.Name ASC

43
New cards

Students table

A table that includes fields such as StudentNo, Name, Email, Year, and TeacherID.

44
New cards

Teachers table

A table that includes fields such as TeacherID, Name, and Class.

45
New cards

Ascending order

An order in which results are sorted from lowest to highest, or alphabetically from A to Z.

46
New cards

Email field

A field in the Students table that contains the email addresses of the students.

47
New cards

Class field

A field in the Teachers table that indicates the class taught by the teacher.

48
New cards

Filtering results

The process of narrowing down the results of a query based on specific conditions.

49
New cards

Ordering results

The process of arranging the results of a query in a specific sequence.

50
New cards

Data retrieval

The process of obtaining data from a database using SQL queries.

51
New cards

Multiple tables

Refers to querying data from two or more tables in a database.